Skip to content

net: Add route offload indication

Ido Schimmel netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest10 patches 7 repliesIn review
  2. v110 patches 6 repliesSuperseded

Changes in v2 from the cover letter

* Patch #2: Name last argument of fib_dump_info()
* Patch #2: Move 'struct fib_rt_info' to include/net/ip_fib.h so that it could later be passed to fib_alias_hw_flags_set()
* Patch #3: Make use of 'struct fib_rt_info' in fib_alias_hw_flags_set()
* Patch #6: Convert to new fib_alias_hw_flags_set() interface
* Patch #7: Convert to new fib_alias_hw_flags_set() interface

[1] https://patchwork.ozlabs.org/cover/1170530/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10ipv4: Replace route in list before notifyingnet/ipv4/fib_trie.c+7 -40 replies
2/10ipv4: Encapsulate function arguments in a structinclude/net/ip_fib.h net/ipv4/fib_lookup.h net/ipv4/fib_semantics.c +2 more+45 -212 replies
3/10ipv4: Add "offload" and "trap" indications to routesinclude/net/ip_fib.h include/uapi/linux/rtnetlink.h net/ipv4/fib_lookup.h +3 more+87 -02 replies
4/10ipv6: Add "offload" and "trap" indications to routesinclude/net/ip6_fib.h net/ipv6/route.c+17 -10 replies
5/10mlxsw: spectrum_router: Separate nexthop offload indication from routedrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+75 -170 replies
6/10mlxsw: spectrum_router: Set hardware flags for routesdrivers/net/ethernet/mellanox/mlxsw/spectrum_router.c+77 -771 reply
7/10netdevsim: fib: Add dummy implementation for FIB offloaddrivers/net/Kconfig drivers/net/netdevsim/fib.c+663 -91 reply
8/10selftests: forwarding: Add helpers and tests for FIB offloadtools/testing/selftests/net/forwarding/fib_offload_lib.sh+873 -00 replies
9/10selftests: netdevsim: Add test for FIB offload APItools/testing/selftests/drivers/net/netdevsim/fib.sh+341 -00 replies
10/10selftests: mlxsw: Add test for FIB offload APItools/testing/selftests/drivers/net/mlxsw/fib.sh+180 -00 replies

Reviews trailers per patch

All 10 patches have a Reviewed-by or Acked-by.

PatchJiri PirkoDavid AhernRoopa Prabhu
1/10R-b R-b
2/10R-b R-b
3/10R-b R-b
4/10R-b R-b A-b
5/10A-b
6/10A-b
7/10R-b
8/10A-b
9/10A-b
10/10A-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v2 thread

Cover letter [PATCH net-next v2 00/10] net: Add route offload indication

From: Ido Schimmel <[email protected]>

This patch set adds offload indication to IPv4 and IPv6 routes. So far offload indication was only available for the nexthop via 'RTNH_F_OFFLOAD', which is problematic as a nexthop is usually shared between multiple routes.

Based on feedback from Roopa and David on the RFC [1], the indication is split to 'offload' and 'trap'. This is done because not all the routes present in hardware actually offload traffic from the kernel. For example, host routes merely trap packets to the kernel. The two flags are dumped to user space via the 'rtm_flags' field in the ancillary header of the rtnetlink message.

In addition, the patch set uses the new flags in order to test the FIB offload API by adding a dummy FIB offload implementation to netdevsim. The new tests are added to a shared library and can be therefore shared between different drivers.

Patches #1-#3 add offload indication to IPv4 routes. Patches #4 adds offload indication to IPv6 routes. Patches #5-#6 add support for the offload indication in mlxsw. Patch #7 adds dummy FIB offload implementation in netdevsim. Patches #8-#10 add selftests.

v2 (feedback from David Ahern):
* Patch #2: Name last argument of fib_dump_info()
* Patch #2: Move 'struct fib_rt_info' to include/net/ip_fib.h so that it could later be passed to fib_alias_hw_flags_set()
* Patch #3: Make use of 'struct fib_rt_info' in fib_alias_hw_flags_set()
* Patch #6: Convert to new fib_alias_hw_flags_set() interface
* Patch #7: Convert to new fib_alias_hw_flags_set() interface

[1] https://patchwork.ozlabs.org/cover/1170530/

Ido Schimmel (10):
ipv4: Replace route in list before notifying
ipv4: Encapsulate function arguments in a struct
ipv4: Add "offload" and "trap" indications to routes
ipv6: Add "offload" and "trap" indications to routes
mlxsw: spectrum_router: Separate nexthop offload indication from route
mlxsw: spectrum_router: Set hardware flags for routes
netdevsim: fib: Add dummy implementation for FIB offload
selftests: forwarding: Add helpers and tests for FIB offload
selftests: netdevsim: Add test for FIB offload API
selftests: mlxsw: Add test for FIB offload API

 drivers/net/Kconfig                           |   1 +
 .../ethernet/mellanox/mlxsw/spectrum_router.c | 246 +++--
 drivers/net/netdevsim/fib.c                   | 671 +++++++++++++-
 include/net/ip6_fib.h                         |  11 +-
 include/net/ip_fib.h                          |  13 +
 include/uapi/linux/rtnetlink.h                |   2 +
 net/ipv4/fib_lookup.h                         |   8 +-
 net/ipv4/fib_semantics.c                      |  33 +-
 net/ipv4/fib_trie.c                           |  77 +-
 net/ipv4/route.c                              |  31 +-
 net/ipv6/route.c                              |   7 +
 .../selftests/drivers/net/mlxsw/fib.sh        | 180 ++++
 .../selftests/drivers/net/netdevsim/fib.sh    | 341 +++++++
 .../net/forwarding/fib_offload_lib.sh         | 873 ++++++++++++++++++
 14 files changed, 2365 insertions(+), 129 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/mlxsw/fib.sh
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/fib.sh
 create mode 100644 tools/testing/selftests/net/forwarding/fib_offload_lib.sh
Signature · 1 line
2.24.1