Skip to content

Commit 3b4202a

Browse files
committed
Merge branch 'nexthop-add-support-for-nexthop-objects-offload'
Ido Schimmel says: ==================== nexthop: Add support for nexthop objects offload This patch set adds support for nexthop objects offload with a dummy implementation over netdevsim. mlxsw support will be added later. The general idea is very similar to route offload in that notifications are sent whenever nexthop objects are changed. A listener can veto the change and the error will be communicated to user space with extack. To keep listeners as simple as possible, they not only receive notifications for the nexthop object that is changed, but also for all the other objects affected by this change. For example, when a single nexthop is replaced, a replace notification is sent for the single nexthop, but also for all the nexthop groups this nexthop is member in. This relieves listeners from the need to track such dependencies. To simplify things further for listeners, the notification info does not contain the raw nexthop data structures (e.g., 'struct nexthop'), but less complex data structures into which the raw data structures are parsed into. Tested with a new selftest over netdevsim and with fib_nexthops.sh: Tests passed: 164 Tests failed: 0 Patch set overview: Patches #1-#4 introduce the aforementioned data structures and convert existing listeners (i.e., the VXLAN driver) to use them. Patches #5-#6 add a new RTNH_F_TRAP flag and the ability to set it and RTNH_F_OFFLOAD on nexthops. This flag is used by netdevsim for testing purposes and will also be used by mlxsw. These flags are consistent with the existing RTM_F_OFFLOAD and RTM_F_TRAP flags. Patches #7-#14 gradually add the new nexthop notifications. Patches #15-#18 add a dummy implementation for nexthop offload over netdevsim and a selftest to exercise both good and bad flows. Changes since RFC [1]: Patch #1: s/is_encap/has_encap/ Patch #3: Add a blank line in __nh_notifier_single_info_init() Patch #5: Reword commit message Patch #6: s/nexthop_hw_flags_set/nexthop_set_hw_flags/ Patch #7: Reword commit message Patch #11: Allocate extack on the stack Follow-up patch sets: selftests: forwarding: Add nexthop objects tests mlxsw: Preparations for nexthop objects support - part 1/2 mlxsw: Preparations for nexthop objects support - part 2/2 mlxsw: Add support for nexthop objects mlxsw: Add support for blackhole nexthops mlxsw: Update adjacency index more efficiently [1] https://lore.kernel.org/netdev/[email protected]/ ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents c9448e8 + 21584e6 commit 3b4202a

File tree

12 files changed

+995
-47
lines changed

12 files changed

+995
-47
lines changed

Documentation/networking/devlink/netdevsim.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,15 @@ Resources
4646
=========
4747

4848
The ``netdevsim`` driver exposes resources to control the number of FIB
49-
entries and FIB rule entries that the driver will allow.
49+
entries, FIB rule entries and nexthops that the driver will allow.
5050

5151
.. code:: shell
5252
5353
$ devlink resource set netdevsim/netdevsim0 path /IPv4/fib size 96
5454
$ devlink resource set netdevsim/netdevsim0 path /IPv4/fib-rules size 16
5555
$ devlink resource set netdevsim/netdevsim0 path /IPv6/fib size 64
5656
$ devlink resource set netdevsim/netdevsim0 path /IPv6/fib-rules size 16
57+
$ devlink resource set netdevsim/netdevsim0 path /nexthops size 16
5758
$ devlink dev reload netdevsim/netdevsim0
5859
5960
Driver-specific Traps

drivers/net/netdevsim/dev.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,12 @@ static int nsim_dev_resources_register(struct devlink *devlink)
324324
return err;
325325
}
326326

327+
/* Resources for nexthops */
328+
err = devlink_resource_register(devlink, "nexthops", (u64)-1,
329+
NSIM_RESOURCE_NEXTHOPS,
330+
DEVLINK_RESOURCE_ID_PARENT_TOP,
331+
&params);
332+
327333
out:
328334
return err;
329335
}

0 commit comments

Comments
 (0)