mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()
authorAmit Cohen <amcohen@nvidia.com>
Tue, 21 Jun 2022 08:33:36 +0000 (11:33 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Jun 2022 11:56:57 +0000 (12:56 +0100)
commita6f43b1dad800d816d62dc478e68eb5230a9465c
tree0f654751f035949ed9b1c07d01e37350f39f1ce8
parent6e66d2e4b3a20655262569ec394f79a2eee87028
mlxsw: spectrum_switchdev: Simplify mlxsw_sp_port_mc_disabled_set()

The above mentioned function is called for each port in bridge when the
multicast behavior is changed. Currently, it updates all the relevant
MID entries only for the first call, but the update of flooding per port
is done only for the port that it was called for it.

To simplify this behavior, it is possible to handle flooding for all the
ports in the first call, then, the other calls will do nothing. For
that, new functions are required to set flooding for all ports, no
'struct mlxsw_sp_port' is required.

This issue was found while extending this function for unified bridge
model, the above mentioned change will ease the extending later.

Signed-off-by: Amit Cohen <amcohen@nvidia.com>
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/mellanox/mlxsw/spectrum_switchdev.c