mlxsw: spectrum_switchdev: Only query FDB notifications when necessary
authorIdo Schimmel <idosch@nvidia.com>
Wed, 4 May 2022 06:29:08 +0000 (09:29 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 4 May 2022 10:21:33 +0000 (11:21 +0100)
commitb8950003849de2a78f7aed9e348233e2b678b755
tree315e2a32006d97bca6f0e0b4b81c9d708b5629ca
parentd1314096fbe9601ea6606b925ec4563c027936d9
mlxsw: spectrum_switchdev: Only query FDB notifications when necessary

The driver periodically queries the device for FDB notifications (e.g.,
learned, aged-out) in order to update the bridge driver. These
notifications can only be generated when bridges are offloaded to the
device.

Avoid unnecessary queries by starting to query upon installation of the
first bridge and stop querying upon removal of the last bridge.

Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c