netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RFC PATCH net-next 00/22] nexthop: Add support for nexthop objects offload
@ 2020-09-08  9:10 Ido Schimmel
  2020-09-08  9:10 ` [RFC PATCH net-next 01/22] nexthop: Remove unused function declaration from header file Ido Schimmel
                   ` (21 more replies)
  0 siblings, 22 replies; 56+ messages in thread
From: Ido Schimmel @ 2020-09-08  9:10 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuba, dsahern, roopa, mlxsw, Ido Schimmel

From: Ido Schimmel <idosch@nvidia.com>

Note: I'm aware that 22 patches is a lot and I will split it for the
non-RFC submission. Sending all in one piece to see if there are general
comments regarding the interface. Also, most of the patches are very
small.

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 perform small cleanups and covert the existing nexthop
notification chain to a blocking one, so that device drivers could block
when programming nexthops to hardware. This is safe because all
notifications are emitted from a process context.

Patches #5-#8 introduce the aforementioned data structures and convert
existing listeners (i.e., the VXLAN driver) to use them.

Patches #9-#10 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 #11-#18 gradually add the new nexthop notifications.

Patches #19-#22 add a dummy implementation for nexthop offload over
netdevsim and a selftest to exercise both good and bad flows.

Ido Schimmel (22):
  nexthop: Remove unused function declaration from header file
  nexthop: Convert to blocking notification chain
  nexthop: Only emit a notification when nexthop is actually deleted
  selftests: fib_nexthops: Test cleanup of FDB entries following nexthop
    deletion
  nexthop: Add nexthop notification data structures
  nexthop: Pass extack to nexthop notifier
  nexthop: Prepare new notification info
  nexthop: vxlan: Convert to new notification info
  rtnetlink: Add RTNH_F_TRAP flag
  nexthop: Allow setting "offload" and "trap" indications on nexthops
  nexthop: Emit a notification when a nexthop is added
  nexthop: Emit a notification when a nexthop group is replaced
  nexthop: Emit a notification when a single nexthop is replaced
  nexthop: Emit a notification when a nexthop group is modified
  nexthop: Emit a notification when a nexthop group is reduced
  nexthop: Pass extack to register_nexthop_notifier()
  nexthop: Replay nexthops when registering a notifier
  nexthop: Remove in-kernel route notifications when nexthop changes
  netdevsim: Add devlink resource for nexthops
  netdevsim: Add dummy implementation for nexthop offload
  netdevsim: Allow programming routes with nexthop objects
  selftests: netdevsim: Add test for nexthop offload API

 .../networking/devlink/netdevsim.rst          |   3 +-
 drivers/net/netdevsim/dev.c                   |   6 +
 drivers/net/netdevsim/fib.c                   | 265 +++++++++++-
 drivers/net/netdevsim/netdevsim.h             |   1 +
 drivers/net/vxlan.c                           |  12 +-
 include/net/netns/nexthop.h                   |   2 +-
 include/net/nexthop.h                         |  45 +-
 include/uapi/linux/rtnetlink.h                |   6 +-
 net/ipv4/fib_semantics.c                      |   2 +
 net/ipv4/fib_trie.c                           |   9 -
 net/ipv4/nexthop.c                            | 262 ++++++++++-
 net/ipv6/route.c                              |   5 -
 .../drivers/net/netdevsim/nexthop.sh          | 408 ++++++++++++++++++
 tools/testing/selftests/net/fib_nexthops.sh   |  14 +
 14 files changed, 985 insertions(+), 55 deletions(-)
 create mode 100755 tools/testing/selftests/drivers/net/netdevsim/nexthop.sh

-- 
2.26.2


^ permalink raw reply	[flat|nested] 56+ messages in thread

end of thread, other threads:[~2020-09-11 17:08 UTC | newest]

Thread overview: 56+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-08  9:10 [RFC PATCH net-next 00/22] nexthop: Add support for nexthop objects offload Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 01/22] nexthop: Remove unused function declaration from header file Ido Schimmel
2020-09-08 14:29   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 02/22] nexthop: Convert to blocking notification chain Ido Schimmel
2020-09-08 14:34   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 03/22] nexthop: Only emit a notification when nexthop is actually deleted Ido Schimmel
2020-09-08 14:34   ` David Ahern
2020-09-08 14:39   ` Jiri Pirko
2020-09-08 14:42     ` David Ahern
2020-09-11 14:40     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 04/22] selftests: fib_nexthops: Test cleanup of FDB entries following nexthop deletion Ido Schimmel
2020-09-08 14:35   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 05/22] nexthop: Add nexthop notification data structures Ido Schimmel
2020-09-08 14:43   ` David Ahern
2020-09-11 14:50     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 06/22] nexthop: Pass extack to nexthop notifier Ido Schimmel
2020-09-08 14:44   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 07/22] nexthop: Prepare new notification info Ido Schimmel
2020-09-08 14:55   ` David Ahern
2020-09-11 15:01     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 08/22] nexthop: vxlan: Convert to " Ido Schimmel
2020-09-08 14:58   ` David Ahern
2020-09-11 15:05     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 09/22] rtnetlink: Add RTNH_F_TRAP flag Ido Schimmel
2020-09-08 15:02   ` David Ahern
2020-09-11 15:26     ` Ido Schimmel
2020-09-11 15:54       ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 10/22] nexthop: Allow setting "offload" and "trap" indications on nexthops Ido Schimmel
2020-09-08 15:14   ` David Ahern
2020-09-11 15:29     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 11/22] nexthop: Emit a notification when a nexthop is added Ido Schimmel
2020-09-08 15:21   ` David Ahern
2020-09-11 16:20     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 12/22] nexthop: Emit a notification when a nexthop group is replaced Ido Schimmel
2020-09-08 15:22   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 13/22] nexthop: Emit a notification when a single nexthop " Ido Schimmel
2020-09-08 15:25   ` David Ahern
2020-09-11 16:24     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 14/22] nexthop: Emit a notification when a nexthop group is modified Ido Schimmel
2020-09-08 15:29   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 15/22] nexthop: Emit a notification when a nexthop group is reduced Ido Schimmel
2020-09-08 15:33   ` David Ahern
2020-09-11 16:29     ` Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 16/22] nexthop: Pass extack to register_nexthop_notifier() Ido Schimmel
2020-09-08 15:34   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 17/22] nexthop: Replay nexthops when registering a notifier Ido Schimmel
2020-09-08 15:37   ` David Ahern
2020-09-11 16:40     ` Ido Schimmel
2020-09-11 16:47       ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 18/22] nexthop: Remove in-kernel route notifications when nexthop changes Ido Schimmel
2020-09-08 15:38   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 19/22] netdevsim: Add devlink resource for nexthops Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 20/22] netdevsim: Add dummy implementation for nexthop offload Ido Schimmel
2020-09-08  9:10 ` [RFC PATCH net-next 21/22] netdevsim: Allow programming routes with nexthop objects Ido Schimmel
2020-09-08 15:40   ` David Ahern
2020-09-08  9:10 ` [RFC PATCH net-next 22/22] selftests: netdevsim: Add test for nexthop offload API Ido Schimmel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).