Received: by 10.223.164.202 with SMTP id h10csp137202wrb; Fri, 10 Nov 2017 03:59:53 -0800 (PST) X-Google-Smtp-Source: AGs4zMb/pDlKjEbifXwo1xmeU+UMO431iztR39DxyP1EFK7t2k4WNd1ZmRU/muUFL+mO+35FnA0Q X-Received: by 10.99.55.30 with SMTP id e30mr112057pga.156.1510315193506; Fri, 10 Nov 2017 03:59:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510315193; cv=none; d=google.com; s=arc-20160816; b=OlSOMcNonEsQ1l1uZF1XLQnwNn4GfMx1374Jk3r0Uu29yH/iCG7sV5RgvihCUI6bhX vyjtj8gSfG4BaN1JJXImMRKOjPoJI98IedEo5koGYJykOokAPZk+1x3jONLA+qJBuk32 oWk0zPNBE9AZ6nX8x4v0kTVGQKfDQRMe5mi4iqNLxSLiHNK2bzUD6ot6ngFK8vaHHfi4 tgWtY1T8LSfEGb8WCfYqSIgPuAncCZyPn9viT3U+yUizoYUQw/D6EXJP6iNTic94z4fc Jp145J0zPRlw8Xp/zZTXjk80FcbbaFKGv/NJHnLF2G6ePT/aHfapwQlHyx9EDLNqNSaL sujQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=ZuxXpkD0k/GSOoAeraCqxfKagYVi9tbtg+GG/dDdkws=; b=QMnrfaKwoGb4Xrf9jSK3Epp2DUI6JjcS7kNzmeJmn6GPSfYru3kVcrKQlnKs2m5se2 XLLbVxTSuyOxmJWZmHzXVEdTSkwiCJPFKzpQplGrLKo6j6MP33HVx48K+tPsVRJ8o7E0 Z9uNSecKRiHBUNq7X1Iv/3kB4/8wJZhLtZe3cXhTtphnRo4Vas1uCsQmmeUxhuXcYs4+ g0dRmJ0jrHToiDmS8AUeXl7ryGYzrpf0ac+IGqtZizuOEs04WZf8fW7V6v8Gc/T0Zh4w u4sThB2sS0kjDShd+lXmH8TzlWZBq6kyolWm9BjYxKyJcw3iIutG8oso0C/hgecb+afS x/Xw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h13si8461129pgq.28.2017.11.10.03.59.42; Fri, 10 Nov 2017 03:59:53 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752710AbdKJL6C (ORCPT + 82 others); Fri, 10 Nov 2017 06:58:02 -0500 Received: from aibo.runbox.com ([91.220.196.211]:36940 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751133AbdKJL6B (ORCPT ); Fri, 10 Nov 2017 06:58:01 -0500 Received: from [10.9.9.210] (helo=mailfront10.runbox.com) by mailtransmit03.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eD7wZ-0003X3-NC; Fri, 10 Nov 2017 12:57:55 +0100 Received: from 93.89.113.32.ip.vitnett.no ([93.89.113.32] helo=localhost.localdomain) by mailfront10.runbox.com with esmtpsa (uid:646232 ) (TLS1.2:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.82) id 1eD7wI-0006Wo-If; Fri, 10 Nov 2017 12:57:38 +0100 From: Egil Hjelmeland To: andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Egil Hjelmeland Subject: [PATCH net-next 2/2] net: dsa: lan9303: Clear offload_fwd_mark for IGMP Date: Fri, 10 Nov 2017 12:54:35 +0100 Message-Id: <20171110115435.4261-3-privat@egil-hjelmeland.no> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171110115435.4261-1-privat@egil-hjelmeland.no> References: <20171110115435.4261-1-privat@egil-hjelmeland.no> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- net/dsa/tag_lan9303.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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, { u16 *lan9303_tag; unsigned int source_port; + u16 ether_type_nw; + u8 ip_protocol; if (unlikely(!pskb_may_pull(skb, LAN9303_TAG_LEN))) { dev_warn_ratelimited(&dev->dev, @@ -129,6 +131,17 @@ static struct sk_buff *lan9303_rcv(struct sk_buff *skb, struct net_device *dev, skb->offload_fwd_mark = !ether_addr_equal(skb->data - ETH_HLEN, eth_stp_addr); + /* We also need IGMP packets to have skb->offload_fwd_mark = 0. + * Solving this for all conceivable situations would add more cost to + * every packet. Instead we handle just the common case: + * No VLAN tag + Ethernet II framing. + * Test least probable term first. + */ + ether_type_nw = lan9303_tag[2]; + ip_protocol = *(skb->data + 9); + if (ip_protocol == IPPROTO_IGMP && ether_type_nw == htons(ETH_P_IP)) + skb->offload_fwd_mark = 0; + return skb; } -- 2.11.0 From 1583956155320008095@xxx Mon Nov 13 13:05:03 +0000 2017 X-GM-THRID: 1583956155320008095 X-Gmail-Labels: Inbox,Category Promotions,HistoricalUnread