From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4E1C3CA9EB7 for ; Mon, 21 Oct 2019 18:36:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2EDC32084C for ; Mon, 21 Oct 2019 18:36:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726672AbfJUSgk (ORCPT ); Mon, 21 Oct 2019 14:36:40 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:58805 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729703AbfJUSgj (ORCPT ); Mon, 21 Oct 2019 14:36:39 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iMcXb-0004yt-Pa; Mon, 21 Oct 2019 20:36:27 +0200 Received: from ore by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iMcXZ-000580-DT; Mon, 21 Oct 2019 20:36:25 +0200 Date: Mon, 21 Oct 2019 20:36:25 +0200 From: Oleksij Rempel To: Andrew Lunn Cc: Chris Snook , Florian Fainelli , James Hogan , Jay Cliburn , Mark Rutland , Paul Burton , Ralf Baechle , Rob Herring , Vivien Didelot , Pengutronix Kernel Team , "David S. Miller" , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linux-mips@vger.kernel.org, Russell King Subject: Re: [PATCH v3 4/5] net: dsa: add support for Atheros AR9331 TAG format Message-ID: <20191021183625.bmapf4bliaisluad@pengutronix.de> References: <20191021053811.19818-1-o.rempel@pengutronix.de> <20191021053811.19818-5-o.rempel@pengutronix.de> <20191021154900.GF17002@lunn.ch> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20191021154900.GF17002@lunn.ch> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-IRC: #ptxdist @freenode X-Accept-Language: de,en X-Accept-Content-Type: text/plain X-Uptime: 20:14:24 up 157 days, 32 min, 97 users, load average: 0.00, 0.02, 0.00 User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ore@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-mips@vger.kernel.org Sender: linux-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@vger.kernel.org On Mon, Oct 21, 2019 at 05:49:00PM +0200, Andrew Lunn wrote: > > +static struct sk_buff *ar9331_tag_rcv(struct sk_buff *skb, > > + struct net_device *ndev, > > + struct packet_type *pt) > > +{ > > + u8 ver, port; > > + u16 hdr; > > + > > + if (unlikely(!pskb_may_pull(skb, AR9331_HDR_LEN))) > > + return NULL; > > + > > + hdr = le16_to_cpu(*(__le16 *)skb_mac_header(skb)); > > + > > + ver = FIELD_GET(AR9331_HDR_VERSION_MASK, hdr); > > + if (unlikely(ver != AR9331_HDR_VERSION)) { > > + netdev_warn_once(ndev, "%s:%i wrong header version 0x%2x\n", > > + __func__, __LINE__, hdr); > > + return NULL; > > + } > > + > > + if (unlikely(hdr & AR9331_HDR_FROM_CPU)) { > > + netdev_warn_once(ndev, "%s:%i packet should not be from cpu 0x%2x\n", > > + __func__, __LINE__, hdr); > > + return NULL; > > + } > > + > > + skb_pull(skb, AR9331_HDR_LEN); > > + skb_set_mac_header(skb, -ETH_HLEN); > > No other tag driver calls skb_set_mac_header(). Also, the -ETH_HLEN > looks odd, give you have just pulled off AR9331_HDR_LEN? Hm.. is it corrected somewhere else? Any way, B.T.M.A.N need a proper value ant it seems to work correctly. So I remove it. > What other tag drivers use is skb_pull_rcsum(). It is build in switch and internal Ethernet controller do not set csum. There is nothing to recalculate... on other hand, it adds no overhead. So, I have nothing against it. Are there other arguments? Regards, Oleksij -- Pengutronix e.K. | | Industrial Linux Solutions | http://www.pengutronix.de/ | Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |