Skip to content

Commit 412614b

Browse files
idoschdavem330
authored andcommitted
bridge: Add per-{Port, VLAN} neighbor suppression data path support
When the bridge is not VLAN-aware (i.e., VLAN ID is 0), determine if neighbor suppression is enabled on a given bridge port solely based on the existing 'BR_NEIGH_SUPPRESS' flag. Otherwise, if the bridge is VLAN-aware, first check if per-{Port, VLAN} neighbor suppression is enabled on the given bridge port using the 'BR_NEIGH_VLAN_SUPPRESS' flag. If so, look up the VLAN and check whether it has neighbor suppression enabled based on the per-VLAN 'BR_VLFLAG_NEIGH_SUPPRESS_ENABLED' flag. If the bridge is VLAN-aware, but the bridge port does not have per-{Port, VLAN} neighbor suppression enabled, then fallback to determine neighbor suppression based on the 'BR_NEIGH_SUPPRESS' flag. Signed-off-by: Ido Schimmel <idosch@nvidia.com> Acked-by: Nikolay Aleksandrov <razor@blackwall.org> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 3aca683 commit 412614b

1 file changed

Lines changed: 17 additions & 1 deletion

File tree

net/bridge/br_arp_nd_proxy.c

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,5 +486,21 @@ void br_do_suppress_nd(struct sk_buff *skb, struct net_bridge *br,
486486

487487
bool br_is_neigh_suppress_enabled(const struct net_bridge_port *p, u16 vid)
488488
{
489-
return p && (p->flags & BR_NEIGH_SUPPRESS);
489+
if (!p)
490+
return false;
491+
492+
if (!vid)
493+
return !!(p->flags & BR_NEIGH_SUPPRESS);
494+
495+
if (p->flags & BR_NEIGH_VLAN_SUPPRESS) {
496+
struct net_bridge_vlan_group *vg = nbp_vlan_group_rcu(p);
497+
struct net_bridge_vlan *v;
498+
499+
v = br_vlan_find(vg, vid);
500+
if (!v)
501+
return false;
502+
return !!(v->priv_flags & BR_VLFLAG_NEIGH_SUPPRESS_ENABLED);
503+
} else {
504+
return !!(p->flags & BR_NEIGH_SUPPRESS);
505+
}
490506
}

0 commit comments

Comments
 (0)