OSDN Git Service

vxlan: mdb: Add an internal flag to indicate MDB usage
authorIdo Schimmel <idosch@nvidia.com>
Wed, 15 Mar 2023 13:11:52 +0000 (15:11 +0200)
committerDavid S. Miller <davem@davemloft.net>
Fri, 17 Mar 2023 08:05:49 +0000 (08:05 +0000)
commitbc6c6b013ffee36eb555cc0a68aa3d9608e1fad2
tree2d3c4ff98f0ddae36e7b55a46271103ec80ea682
parenta3a48de5eade770e911d35291217bdd69ce04ef1
vxlan: mdb: Add an internal flag to indicate MDB usage

Add an internal flag to indicate whether MDB entries are configured or
not. Set the flag after installing the first MDB entry and clear it
before deleting the last one.

The flag will be consulted by the data path which will only perform an
MDB lookup if the flag is set, thereby keeping the MDB overhead to a
minimum when the MDB is not used.

Another option would have been to use a static key, but it is global and
not per-device, unlike the current approach.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Nikolay Aleksandrov <razor@blackwall.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan/vxlan_mdb.c
include/net/vxlan.h