Skip to content

Commit 7c762e7

Browse files
vladimirolteandavem330
authored andcommitted
net: dsa: flood multicast to CPU when slave has IFF_PROMISC
Certain DSA switches can eliminate flooding to the CPU when none of the ports have the IFF_ALLMULTI or IFF_PROMISC flags set. This is done by synthesizing a call to dsa_port_bridge_flags() for the CPU port, a call which normally comes from the bridge driver via switchdev. The bridge port flags and IFF_PROMISC|IFF_ALLMULTI have slightly different semantics, and due to inattention/lack of proper testing, the IFF_PROMISC flag allows unknown unicast to be flooded to the CPU, but not unknown multicast. This must be fixed by setting both BR_FLOOD (unicast) and BR_MCAST_FLOOD in the synthesized dsa_port_bridge_flags() call, since IFF_PROMISC means that packets should not be filtered regardless of their MAC DA. Fixes: 7569459 ("net: dsa: manage flooding on the CPU ports") Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 31c417c commit 7c762e7

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

net/dsa/slave.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,7 @@ static void dsa_port_manage_cpu_flood(struct dsa_port *dp)
285285
if (other_dp->slave->flags & IFF_ALLMULTI)
286286
flags.val |= BR_MCAST_FLOOD;
287287
if (other_dp->slave->flags & IFF_PROMISC)
288-
flags.val |= BR_FLOOD;
288+
flags.val |= BR_FLOOD | BR_MCAST_FLOOD;
289289
}
290290

291291
err = dsa_port_pre_bridge_flags(dp, flags, NULL);

0 commit comments

Comments
 (0)