Skip to content

Commit 4672cd3

Browse files
hjelmelanddavem330
authored andcommitted
net: dsa: lan9303: Clear offload_fwd_mark for IGMP
Now that IGMP packets no longer is flooded in HW, we want the SW bridge to forward packets based on bridge configuration. To make that happen, IGMP packets must have skb->offload_fwd_mark = 0. Signed-off-by: Egil Hjelmeland <privat@egil-hjelmeland.no> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 2aee430 commit 4672cd3

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

net/dsa/tag_lan9303.c

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
9292
{
9393
u16 *lan9303_tag;
9494
unsigned int source_port;
95+
u16 ether_type_nw;
96+
u8 ip_protocol;
9597

9698
if (unlikely(!pskb_may_pull(skb, LAN9303_TAG_LEN))) {
9799
dev_warn_ratelimited(&dev->dev,
@@ -129,6 +131,17 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
129131
skb->offload_fwd_mark = !ether_addr_equal(skb->data - ETH_HLEN,
130132
eth_stp_addr);
131133

134+
/* We also need IGMP packets to have skb->offload_fwd_mark = 0.
135+
* Solving this for all conceivable situations would add more cost to
136+
* every packet. Instead we handle just the common case:
137+
* No VLAN tag + Ethernet II framing.
138+
* Test least probable term first.
139+
*/
140+
ether_type_nw = lan9303_tag[2];
141+
ip_protocol = *(skb->data + 9);
142+
if (ip_protocol == IPPROTO_IGMP && ether_type_nw == htons(ETH_P_IP))
143+
skb->offload_fwd_mark = 0;
144+
132145
return skb;
133146
}
134147

0 commit comments

Comments
 (0)