net: dsa: tag_brcm: do not mark link local traffic as offloaded
Jonas Gorski
maintainerPATCH 1/1 net: dsa: tag_brcm: do not mark link local traffic as offloaded
Broadcom switches locally terminate link local traffic and do not forward it, so we should not mark it as offloaded.
In some situations we still want/need to flood this traffic, e.g. if STP is disabled, or it is explicitly enabled via the group_fwd_mask. But if the skb is marked as offloaded, the kernel will assume this was already done in hardware, and the packets never reach other bridge ports.
So ensure that link local traffic is never marked as offloaded, so that the kernel can forward/flood these packets in software if needed.
Since the local termination in not configurable, check the destination MAC, and never mark packets as offloaded if it is a link local ether address.
While modern switches set the tag reason code to BRCM_EG_RC_PROT_TERM for trapped link local traffic, they also set it for link local traffic that is flooded (01:80:c2:00:00:10 to 01:80:c2:00:00:2f), so we cannot use it and need to look at the destination address for them as well.
---
I shortly considered changing dsa_default_offload_fwd_mark(), but decided against it because other switches may have a working trap bit, and would then do a needless destination mac check.
I used likely() because br_input.c uses unlikely(is_link_local_ether_addr()), and that seemed reasonable.
net/dsa/tag_brcm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
net/dsa/tag_brcm.c +4 -2
@@ -176,7 +176,8 @@ static struct sk_buff *brcm_tag_rcv_ll(struct sk_buff *skb,/* Remove Broadcom tag and update checksum */ skb_pull_rcsum (skb,BRCM_TAG_LEN ); -dsa_default_offload_fwd_mark (skb); +if (likely (!is_link_local_ether_addr (eth_hdr (skb)->h_dest))) +dsa_default_offload_fwd_mark (skb);return skb; }
@@ -250,7 +251,8 @@ static struct sk_buff *brcm_leg_tag_rcv(struct sk_buff *skb,/* Remove Broadcom tag and update checksum */ skb_pull_rcsum (skb, len); -dsa_default_offload_fwd_mark (skb); +if (likely (!is_link_local_ether_addr (eth_hdr (skb)->h_dest))) +dsa_default_offload_fwd_mark (skb);dsa_strip_etype_header (skb, len);
base-commit: 96a9178a29a6b84bb632ebeb4e84cf61191c73d5
Signature · 1 line
2.43.0
Quoted 20 lines · Jonas Gorski
Broadcom switches locally terminate link local traffic and do not forward it, so we should not mark it as offloaded.
In some situations we still want/need to flood this traffic, e.g. if STP is disabled, or it is explicitly enabled via the
group_fwd_mask. But if the skb is marked as offloaded, the kernel will assume this was already done in hardware, and the packets never reach other bridge ports.So ensure that link local traffic is never marked as offloaded, so that the kernel can forward/flood these packets in software if needed.
Since the local termination in not configurable, check the destination MAC, and never mark packets as offloaded if it is a link local ether address.
While modern switches set the tag reason code to
BRCM_EG_RC_PROT_TERMfor trapped link local traffic, they also set it for link local traffic that is flooded (01:80:c2:00:00:10 to 01:80:c2:00:00:2f), so we cannot use it and need to look at the destination address for them as well.
Quoted 7 lines
Fixes 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")Fixes 0e62f543bed0 ("net: dsa: Fix duplicate frames flooded by learning")Signed-off-by Jonas Gorski <[email protected]>---
I shortly considered changingdsa_default_offload_fwd_mark(), but decided against it because other switches may have a working trap bit, and would then do a needless destination mac check.
Yes, exactly. Or they simply don't receive link-local traffic via packet traps.
Quoted 15 lines · Jonas Gorski
Broadcom switches locally terminate link local traffic and do not forward it, so we should not mark it as offloaded.
In some situations we still want/need to flood this traffic, e.g. if STP is disabled, or it is explicitly enabled via the
group_fwd_mask. But if the skb is marked as offloaded, the kernel will assume this was already done in hardware, and the packets never reach other bridge ports.So ensure that link local traffic is never marked as offloaded, so that the kernel can forward/flood these packets in software if needed.
Since the local termination in not configurable, check the destination MAC, and never mark packets as offloaded if it is a link local ether address.
Quoted 8 lines
While modern switches set the tag reason code to
BRCM_EG_RC_PROT_TERMfor trapped link local traffic, they also set it for link local traffic that is flooded (01:80:c2:00:00:10 to 01:80:c2:00:00:2f), so we cannot use it and need to look at the destination address for them as well.Fixes 964dbf186eaa ("net: dsa: tag_brcm: add support for legacy tags")Fixes 0e62f543bed0 ("net: dsa: Fix duplicate frames flooded by learning")Signed-off-by Jonas Gorski <[email protected]>
Florian
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:
Quoted 9 lines · On Sun, 9 Nov 2025 14:46:35 +0100 you wrote:
Broadcom switches locally terminate link local traffic and do not forward it, so we should not mark it as offloaded.
In some situations we still want/need to flood this traffic, e.g. if STP is disabled, or it is explicitly enabled via the
group_fwd_mask. But if the skb is marked as offloaded, the kernel will assume this was already done in hardware, and the packets never reach other bridge ports.[...]
Here is the summary with links:
- [net] net: dsa: tag_brcm: do not mark link local traffic as offloaded
https://git.kernel.org/netdev/net/c/762e7e174da9
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html