Received: by 10.223.164.202 with SMTP id h10csp77963wrb; Mon, 13 Nov 2017 03:01:50 -0800 (PST) X-Google-Smtp-Source: AGs4zMa5PJfPJpd3R0HtaRge+LmN9jdlYwBc/WmHRAkX20ZHM5FGsgbzmUv6gwfJd4CIuQiiRlfp X-Received: by 10.159.218.72 with SMTP id x8mr8697695plv.257.1510570910583; Mon, 13 Nov 2017 03:01:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510570910; cv=none; d=google.com; s=arc-20160816; b=JlBsiBxGKy6JgNSol8Df7afHGH0YFzBk3EQ32qwGAlK6Tuku8QMoMykFsNFQ3KMOQ6 rBNm1TsJXViACULrC3lvqvOViEQ2bNj/oTl112p8nvWv0RlehZR8vIvnvGfblb+/7+R/ 5ia35mjqJD0sudu7f1W6GVzAPzEuT9cpj+RoDDjfrdmr4Bmd5jCJW1vX1Z052lBYdLxc BsMZd1eMZSs8oAMA6ODoph/TAqtfHqtP3rPYsi0/vi7Rk9t9GlCnhTwehHSffyj4tChc ECAQOfsh2rTDaWSmZV+gdhP9p/eqUIcJN232m9IsZz2w4hxb48TvtFOC8FruhIq1hlR8 MpgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:to:subject:arc-authentication-results; bh=tLgZmXnZqd6ZJUJhDJBQeVJV/Eg4+c7ndFpT5dCzIZs=; b=fUCP4ERniNzzkkQSGAOBBDBsAo6ZzZ+3pWQ1lqhNnlDWTZSM4YmHaraM9rgiwjUAvI Z/9gK7eA3g/HGOsqyWzCObEz4PecsuzqVYxYauM7iF6PraLfMF7jqT5PIixaDB3cM+du 5bwpij1JqzPIeSzXEBd40sv9Gu9z7Q+LqmkgUBjkDxZp9Qe2RaTi+dCv90EaFsQnDBEP jURmT38mgp+UbnA7ZCk4imHa5/ROaysgfcRnNjoiGrE4d0EXfQp0oxcoQ/Nnw8xtYYpY TED+9xu6qocQC2eB7EJBxfe8QpqdBG0yD1mBfof2FpT1bM6+8Niwt8KHkS7WdAt3UNbr 8Z7Q== 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 o5si15151465pfh.412.2017.11.13.03.01.37; Mon, 13 Nov 2017 03:01:50 -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 S1752510AbdKMLAy (ORCPT + 95 others); Mon, 13 Nov 2017 06:00:54 -0500 Received: from aibo.runbox.com ([91.220.196.211]:49812 "EHLO aibo.runbox.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752402AbdKMLAw (ORCPT ); Mon, 13 Nov 2017 06:00:52 -0500 Received: from [10.9.9.211] (helo=mailfront11.runbox.com) by mailtransmit02.runbox with esmtp (Exim 4.86_2) (envelope-from ) id 1eECTx-0008NW-Cj; Mon, 13 Nov 2017 12:00:49 +0100 Received: from 93.89.113.32.ip.vitnett.no ([93.89.113.32] helo=[10.5.202.90]) by mailfront11.runbox.com with esmtpsa (uid:646232 ) (TLS1.2:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) id 1eECTS-00056o-11; Mon, 13 Nov 2017 12:00:18 +0100 Subject: Re: [PATCH net-next 2/2] net: dsa: lan9303: Clear offload_fwd_mark for IGMP To: andrew@lunn.ch, vivien.didelot@savoirfairelinux.com, f.fainelli@gmail.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20171110115435.4261-1-privat@egil-hjelmeland.no> <20171110115435.4261-3-privat@egil-hjelmeland.no> From: Egil Hjelmeland Message-ID: <2e0d170e-08f6-4009-e422-6faea463a0c2@egil-hjelmeland.no> Date: Mon, 13 Nov 2017 12:00:17 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <20171110115435.4261-3-privat@egil-hjelmeland.no> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10. nov. 2017 12:54, Egil Hjelmeland wrote: > 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; > } > > RTFM, my bad. The lan9303 has both STP and IGMP bits in the receive tag. It is as simple as: u16 lan9303_tag1 = ntohs(lan9303_tag[1]); skb->offload_fwd_mark = !(lan9303_tag1 & 0x18); Egil From 1583680264397303225@xxx Fri Nov 10 11:59:53 +0000 2017 X-GM-THRID: 1583680264397303225 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread