netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next v4 0/7] net: ndo_fdb_add/del: Have drivers report whether they notified
@ 2024-11-14 14:09 Petr Machata
  2024-11-14 14:09 ` [PATCH net-next v4 1/7] ndo_fdb_add: Add a parameter to report whether notification was sent Petr Machata
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: Petr Machata @ 2024-11-14 14:09 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	netdev
  Cc: Simon Horman, Ido Schimmel, Petr Machata, Amit Cohen,
	Vladimir Oltean, Andy Roulin, mlxsw

Currently when FDB entries are added to or deleted from a VXLAN netdevice,
the VXLAN driver emits one notification, including the VXLAN-specific
attributes. The core however always sends a notification as well, a generic
one. Thus two notifications are unnecessarily sent for these operations. A
similar situation comes up with bridge driver, which also emits
notifications on its own.

 # ip link add name vx type vxlan id 1000 dstport 4789
 # bridge monitor fdb &
 [1] 1981693
 # bridge fdb add de:ad:be:ef:13:37 dev vx self dst 192.0.2.1
 de:ad:be:ef:13:37 dev vx dst 192.0.2.1 self permanent
 de:ad:be:ef:13:37 dev vx self permanent

In order to prevent this duplicity, add a parameter, bool *notified, to
ndo_fdb_add and ndo_fdb_del. The flag is primed to false, and if the callee
sends a notification on its own, it sets the flag to true, thus informing
the core that it should not generate another notification.

Patches #1 to #2 are concerned with the above.

In the remaining patches, #3 to #7, add a selftest. This takes place across
several patches. Many of the helpers we would like to use for the test are
in forwarding/lib.sh, whereas net/ is a more suitable place for the test,
so the libraries need to be massaged a bit first.

v4:
- Patch #7:
    - Adjust the sleep around the FDB op

v3:
- v1 and v2 differed from this version mainly because they outright shifted
  the responsibility for notifying to the callee.
- Both substance patches were reworked, patch #1 was dropped.
  Selftest patches stayed intact.

v2:
- Patches #2, #3:
    - Fix qlcnic build

Petr Machata (7):
  ndo_fdb_add: Add a parameter to report whether notification was sent
  ndo_fdb_del: Add a parameter to report whether notification was sent
  selftests: net: lib: Move logging from forwarding/lib.sh here
  selftests: net: lib: Move tests_run from forwarding/lib.sh here
  selftests: net: lib: Move checks from forwarding/lib.sh here
  selftests: net: lib: Add kill_process
  selftests: net: fdb_notify: Add a test for FDB notifications

 drivers/net/ethernet/intel/i40e/i40e_main.c   |   3 +-
 drivers/net/ethernet/intel/ice/ice_main.c     |   8 +-
 drivers/net/ethernet/intel/igb/igb_main.c     |   2 +-
 drivers/net/ethernet/intel/ixgbe/ixgbe_main.c |   2 +-
 drivers/net/ethernet/mscc/ocelot_net.c        |   4 +-
 .../net/ethernet/qlogic/qlcnic/qlcnic_main.c  |   4 +-
 drivers/net/macvlan.c                         |   4 +-
 drivers/net/vxlan/vxlan_core.c                |  10 +-
 include/linux/netdevice.h                     |  14 +-
 net/bridge/br_fdb.c                           |  27 ++-
 net/bridge/br_private.h                       |   4 +-
 net/core/rtnetlink.c                          |  20 +-
 .../drivers/net/mlxsw/devlink_trap.sh         |   2 +-
 .../net/mlxsw/devlink_trap_l3_drops.sh        |   4 +-
 .../net/mlxsw/devlink_trap_l3_exceptions.sh   |  12 +-
 .../net/mlxsw/devlink_trap_tunnel_ipip.sh     |   4 +-
 .../net/mlxsw/devlink_trap_tunnel_ipip6.sh    |   4 +-
 .../net/mlxsw/devlink_trap_tunnel_vxlan.sh    |   4 +-
 .../mlxsw/devlink_trap_tunnel_vxlan_ipv6.sh   |   4 +-
 .../selftests/drivers/net/mlxsw/tc_sample.sh  |   4 +-
 .../net/netdevsim/fib_notifications.sh        |   6 +-
 tools/testing/selftests/net/Makefile          |   2 +-
 .../selftests/net/drop_monitor_tests.sh       |   2 +-
 tools/testing/selftests/net/fdb_notify.sh     |  96 ++++++++
 tools/testing/selftests/net/fib_tests.sh      |   8 +-
 .../selftests/net/forwarding/devlink_lib.sh   |   2 +-
 tools/testing/selftests/net/forwarding/lib.sh | 199 +---------------
 .../selftests/net/forwarding/tc_police.sh     |   8 +-
 tools/testing/selftests/net/lib.sh            | 223 ++++++++++++++++++
 29 files changed, 419 insertions(+), 267 deletions(-)
 create mode 100755 tools/testing/selftests/net/fdb_notify.sh

-- 
2.45.0


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

end of thread, other threads:[~2024-11-16  2:00 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-11-14 14:09 [PATCH net-next v4 0/7] net: ndo_fdb_add/del: Have drivers report whether they notified Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 1/7] ndo_fdb_add: Add a parameter to report whether notification was sent Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 2/7] ndo_fdb_del: " Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 3/7] selftests: net: lib: Move logging from forwarding/lib.sh here Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 4/7] selftests: net: lib: Move tests_run " Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 5/7] selftests: net: lib: Move checks " Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 6/7] selftests: net: lib: Add kill_process Petr Machata
2024-11-14 14:09 ` [PATCH net-next v4 7/7] selftests: net: fdb_notify: Add a test for FDB notifications Petr Machata
2024-11-16  2:00 ` [PATCH net-next v4 0/7] net: ndo_fdb_add/del: Have drivers report whether they notified patchwork-bot+netdevbpf

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).