aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorEgil Hjelmeland <privat@egil-hjelmeland.no>2017-11-10 06:54:35 -0500
committerDavid S. Miller <davem@davemloft.net>2017-11-11 07:50:14 -0500
commit4672cd36053e4a8480f7ca796758d56ef23ccb78 (patch)
tree7aae1b637fe1a69a312243476657dcd9917ec370 /net
parent2aee43078afc24fe8073829159292664c1eed424 (diff)
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>
Diffstat (limited to 'net')
-rw-r--r--net/dsa/tag_lan9303.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/net/dsa/tag_lan9303.c b/net/dsa/tag_lan9303.c
index 5ba01fc3c6ba..b8c5e52b2eff 100644
--- a/net/dsa/tag_lan9303.c
+++ b/net/dsa/tag_lan9303.c
@@ -92,6 +92,8 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
92{ 92{
93 u16 *lan9303_tag; 93 u16 *lan9303_tag;
94 unsigned int source_port; 94 unsigned int source_port;
95 u16 ether_type_nw;
96 u8 ip_protocol;
95 97
96 if (unlikely(!pskb_may_pull(skb, LAN9303_TAG_LEN))) { 98 if (unlikely(!pskb_may_pull(skb, LAN9303_TAG_LEN))) {
97 dev_warn_ratelimited(&dev->dev, 99 dev_warn_ratelimited(&dev->dev,
@@ -129,6 +131,17 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev,
129 skb->offload_fwd_mark = !ether_addr_equal(skb->data - ETH_HLEN, 131 skb->offload_fwd_mark = !ether_addr_equal(skb->data - ETH_HLEN,
130 eth_stp_addr); 132 eth_stp_addr);
131 133
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
132 return skb; 145 return skb;
133} 146}
134 147