ndo_fdb_add: Add a parameter to report whether notification was sent
authorPetr Machata <petrm@nvidia.com>
Thu, 14 Nov 2024 14:09:53 +0000 (15:09 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 16 Nov 2024 00:39:18 +0000 (16:39 -0800)
commit4b42fbc6bd8f73d9ded535d8c61ccaa837ff3bd4
tree5e8a0d38fd88d9af0bcdaf603bebb001dd5ba7d0
parent2a8ce470c59e6a0822291ec6cf5fd5fde5561fdf
ndo_fdb_add: Add a parameter to report whether notification was sent

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 paremeter to ndo_fdb_add,
bool *notified. The flag is primed to false, and if the callee sends a
notification on its own, it sets it to true, thus informing the core that
it should not generate another notification.

Signed-off-by: Petr Machata <petrm@nvidia.com>
Reviewed-by: Amit Cohen <amcohen@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Link: https://patch.msgid.link/cbf6ae8195e85cbf922f8058ce4eba770f3b71ed.1731589511.git.petrm@nvidia.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
12 files changed:
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/ice/ice_main.c
drivers/net/ethernet/intel/igb/igb_main.c
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
drivers/net/ethernet/mscc/ocelot_net.c
drivers/net/ethernet/qlogic/qlcnic/qlcnic_main.c
drivers/net/macvlan.c
drivers/net/vxlan/vxlan_core.c
include/linux/netdevice.h
net/bridge/br_fdb.c
net/bridge/br_private.h
net/core/rtnetlink.c