Skip to content

Commit c832962

Browse files
Cahbkuba-moo
authored andcommitted
net: bridge: multicast: notify switchdev driver whenever MC processing gets disabled
Whenever bridge driver hits the max capacity of MDBs, it disables the MC processing (by setting corresponding bridge option), but never notifies switchdev about such change (the notifiers are called only upon explicit setting of this option, through the registered netlink interface). This could lead to situation when Software MDB processing gets disabled, but this event never gets offloaded to the underlying Hardware. Fix this by adding a notify message in such case. Fixes: 147c1e9 ("switchdev: bridge: Offload multicast disabled") Signed-off-by: Oleksandr Mazur <oleksandr.mazur@plvision.eu> Acked-by: Nikolay Aleksandrov <nikolay@nvidia.com> Link: https://lore.kernel.org/r/20220215165303.31908-1-oleksandr.mazur@plvision.eu Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent 8d2b1a1 commit c832962

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/bridge/br_multicast.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@ static void br_multicast_find_del_pg(struct net_bridge *br,
8282
struct net_bridge_port_group *pg);
8383
static void __br_multicast_stop(struct net_bridge_mcast *brmctx);
8484

85+
static int br_mc_disabled_update(struct net_device *dev, bool value,
86+
struct netlink_ext_ack *extack);
87+
8588
static struct net_bridge_port_group *
8689
br_sg_port_find(struct net_bridge *br,
8790
struct net_bridge_port_group_sg_key *sg_p)
@@ -1156,6 +1159,7 @@ struct net_bridge_mdb_entry *br_multicast_new_group(struct net_bridge *br,
11561159
return mp;
11571160

11581161
if (atomic_read(&br->mdb_hash_tbl.nelems) >= br->hash_max) {
1162+
br_mc_disabled_update(br->dev, false, NULL);
11591163
br_opt_toggle(br, BROPT_MULTICAST_ENABLED, false);
11601164
return ERR_PTR(-E2BIG);
11611165
}

0 commit comments

Comments
 (0)