Message ID | 20221107185452.90711-1-nbd@nbd.name |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp2234384wru; Mon, 7 Nov 2022 11:02:48 -0800 (PST) X-Google-Smtp-Source: AMsMyM6Kr4ch0rmMJMxVEIulg0oeJPZQ1P719elHMbPU4JYSNyKMbcnlhDNtCBo9Ek1QoMO1qrHT X-Received: by 2002:a17:90b:4d87:b0:212:d62a:8612 with SMTP id oj7-20020a17090b4d8700b00212d62a8612mr71373120pjb.35.1667847768182; Mon, 07 Nov 2022 11:02:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667847768; cv=none; d=google.com; s=arc-20160816; b=c8dgsgEhi2PBk5aXAu3Y30oAciNE6WXaJ9TE88YDV1f3P4zJHQWrSFord8QEaZBbhT A7SGCJ6wZyppp7ILOPiv2Jrr2v/ujjitHH+VxgO4dPvccTF5BStYDKrPTVEDjKPz5Lrp /zhUB/IS/sJZYGgbnZH1kKBYKr50JgLDgi4soPJBDxOOvAmzi55OHAD3tAoDCyo/iAUi F8thXq+YtKc042h3faKvdyeLLDbYBk/BwBMqRf8wxiejACSlTvaMrStvT9iUj8hjMQIs vXBibBzqgw0no9X683nA+TpxmIkbHOFcZDUWxRqrgzmW/mMGoE87Rt9tNBMIosXtSdaI g/Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=YLg5pPiZ4SgYBGCUeq6yCCCPL/wr+lr6XSx1WcECfek=; b=pz3Q0kJDmTXL8qNdIjpSeXEwJIEWqoZR7NUWWI9Vuc5q4ldCCvpxTX0frfllWgtCA5 R3hPO7tJ3G6aCB4hDO+HtXftj36044dVjHQP7ilX45wF3DoAv7oe1CEKCnjQlLTYcO0m WxFC9nJG1hmJNBW/Mup1wPui04GtuyDwBYupIzZz8gIPWJui4P/EBjRh2jEbcXFAXtRN Koq3uXCW76czd1QjAS5tOwvncD2jYGDMaFKOajafiOBxawLzfj/xjPIg/pCDrTvWYmmB L1ThrhCkdo7P87PLse3N90lAt7tc5HZ7OHal9YzlzLmFW8GnQ7jOceKGOknLTUuec9MP cmsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=WvQqD0JZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id mu10-20020a17090b388a00b00203246e4383si11583494pjb.145.2022.11.07.11.02.33; Mon, 07 Nov 2022 11:02:48 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@nbd.name header.s=20160729 header.b=WvQqD0JZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=nbd.name Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233075AbiKGSzi (ORCPT <rfc822;hjfbswb@gmail.com> + 99 others); Mon, 7 Nov 2022 13:55:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35488 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233009AbiKGSzf (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 7 Nov 2022 13:55:35 -0500 Received: from nbd.name (nbd.name [46.4.11.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2BE31139; Mon, 7 Nov 2022 10:55:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=nbd.name; s=20160729; h=Content-Transfer-Encoding:MIME-Version:Message-Id:Date:Subject: Cc:To:From:Sender:Reply-To:Content-Type:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=YLg5pPiZ4SgYBGCUeq6yCCCPL/wr+lr6XSx1WcECfek=; b=WvQqD0JZD+cMdUTfMcVWB+LWE1 ZWQnp0lAdw3j1H4rZxowkxQDZLm3kjQOSPCFhPuNjFYi5DtCBfXlU2P3X/FZxGiJkQH58cgLJEUmW 8rnGn2i110PtwhvyiByPWYQuvKPyVse2oAq9MrCU3n1u+B0O2VO8UBx7Qq9RKDwogaCE=; Received: from p200300daa72ee1007849d74f78949f6c.dip0.t-ipconnect.de ([2003:da:a72e:e100:7849:d74f:7894:9f6c] helo=Maecks.lan) by ds12 with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (Exim 4.94.2) (envelope-from <nbd@nbd.name>) id 1os7H8-000LCc-LA; Mon, 07 Nov 2022 19:55:14 +0100 From: Felix Fietkau <nbd@nbd.name> To: netdev@vger.kernel.org, John Crispin <john@phrozen.org>, Sean Wang <sean.wang@mediatek.com>, Mark Lee <Mark-MC.Lee@mediatek.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, Matthias Brugger <matthias.bgg@gmail.com> Cc: linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length Date: Mon, 7 Nov 2022 19:54:39 +0100 Message-Id: <20221107185452.90711-1-nbd@nbd.name> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1748865141382137426?= X-GMAIL-MSGID: =?utf-8?q?1748865141382137426?= |
Series |
[01/14] net: ethernet: mtk_eth_soc: account for vlan in rx header length
|
|
Commit Message
Felix Fietkau
Nov. 7, 2022, 6:54 p.m. UTC
This may be needed for correct MTU settings on devices using DSA
Signed-off-by: Felix Fietkau <nbd@nbd.name>
---
drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Mon, Nov 07, 2022 at 07:54:39PM +0100, Felix Fietkau wrote: > This may be needed for correct MTU settings on devices using DSA > > Signed-off-by: Felix Fietkau <nbd@nbd.name> > --- > drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h > index 589f27ddc401..dcf2a0d5da33 100644 > --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h > +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h > @@ -29,7 +29,7 @@ > #define MTK_TX_DMA_BUF_LEN_V2 0xffff > #define MTK_DMA_SIZE 512 > #define MTK_MAC_COUNT 2 > -#define MTK_RX_ETH_HLEN (ETH_HLEN + ETH_FCS_LEN) > +#define MTK_RX_ETH_HLEN (VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN) Commit title says account for VLAN (VLAN_HLEN, 4 bytes), code says add VLAN_ETH_HLEN (18) more bytes. Also, why is DSA mentioned in the commit message? Is accounting for VLAN hlen not needed if DSA is not used? Why? > #define MTK_RX_HLEN (NET_SKB_PAD + MTK_RX_ETH_HLEN + NET_IP_ALIGN) > #define MTK_DMA_DUMMY_DESC 0xffffffff > #define MTK_DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | \ > -- > 2.38.1 >
On 07.11.22 21:55, Vladimir Oltean wrote: > On Mon, Nov 07, 2022 at 07:54:39PM +0100, Felix Fietkau wrote: >> This may be needed for correct MTU settings on devices using DSA >> >> Signed-off-by: Felix Fietkau <nbd@nbd.name> >> --- >> drivers/net/ethernet/mediatek/mtk_eth_soc.h | 2 +- >> 1 file changed, 1 insertion(+), 1 deletion(-) >> >> diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h >> index 589f27ddc401..dcf2a0d5da33 100644 >> --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h >> +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h >> @@ -29,7 +29,7 @@ >> #define MTK_TX_DMA_BUF_LEN_V2 0xffff >> #define MTK_DMA_SIZE 512 >> #define MTK_MAC_COUNT 2 >> -#define MTK_RX_ETH_HLEN (ETH_HLEN + ETH_FCS_LEN) >> +#define MTK_RX_ETH_HLEN (VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN) > > Commit title says account for VLAN (VLAN_HLEN, 4 bytes), code says add > VLAN_ETH_HLEN (18) more bytes. > > Also, why is DSA mentioned in the commit message? Is accounting for VLAN > hlen not needed if DSA is not used? Why? Will fix the code and improve the comments in v2. - Felix
diff --git a/drivers/net/ethernet/mediatek/mtk_eth_soc.h b/drivers/net/ethernet/mediatek/mtk_eth_soc.h index 589f27ddc401..dcf2a0d5da33 100644 --- a/drivers/net/ethernet/mediatek/mtk_eth_soc.h +++ b/drivers/net/ethernet/mediatek/mtk_eth_soc.h @@ -29,7 +29,7 @@ #define MTK_TX_DMA_BUF_LEN_V2 0xffff #define MTK_DMA_SIZE 512 #define MTK_MAC_COUNT 2 -#define MTK_RX_ETH_HLEN (ETH_HLEN + ETH_FCS_LEN) +#define MTK_RX_ETH_HLEN (VLAN_ETH_HLEN + ETH_HLEN + ETH_FCS_LEN) #define MTK_RX_HLEN (NET_SKB_PAD + MTK_RX_ETH_HLEN + NET_IP_ALIGN) #define MTK_DMA_DUMMY_DESC 0xffffffff #define MTK_DEFAULT_MSG_ENABLE (NETIF_MSG_DRV | \