From: Ido Schimmel Date: Wed, 19 Apr 2023 15:34:52 +0000 (+0300) Subject: bridge: Reorder neighbor suppression check when flooding X-Git-Tag: v6.6.7~2736^2~77^2~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=013a7ce81dd8a5bba31f802053829d91f9a43a8f;p=platform%2Fkernel%2Flinux-starfive.git bridge: Reorder neighbor suppression check when flooding The bridge does not flood ARP / NS packets for which a reply was sent to bridge ports that have neighbor suppression enabled. Subsequent patches are going to add per-{Port, VLAN} neighbor suppression, which is going to make it more expensive to check whether neighbor suppression is enabled since a VLAN lookup will be required. Therefore, instead of unnecessarily performing this lookup for every packet, only perform it for ARP / NS packets for which a reply was sent. Signed-off-by: Ido Schimmel Acked-by: Nikolay Aleksandrov Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_forward.c b/net/bridge/br_forward.c index 02bb620..0fe133f 100644 --- a/net/bridge/br_forward.c +++ b/net/bridge/br_forward.c @@ -224,8 +224,8 @@ void br_flood(struct net_bridge *br, struct sk_buff *skb, /* Do not flood to ports that enable proxy ARP */ if (p->flags & BR_PROXYARP) continue; - if ((p->flags & (BR_PROXYARP_WIFI | BR_NEIGH_SUPPRESS)) && - BR_INPUT_SKB_CB(skb)->proxyarp_replied) + if (BR_INPUT_SKB_CB(skb)->proxyarp_replied && + (p->flags & (BR_PROXYARP_WIFI | BR_NEIGH_SUPPRESS))) continue; prev = maybe_deliver(prev, p, skb, local_orig);