Message ID | 20230625115343.1603330-7-paweldembicki@gmail.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:994d:0:b0:3d9:f83d:47d9 with SMTP id k13csp6883189vqr; Sun, 25 Jun 2023 05:17:47 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5c1o8uZBJzK/SG4dOGprb6mbxcfaou8ZSb4L3uvN2hPe1BtO99L6wL036nk6EXIMoVSYDw X-Received: by 2002:a05:6a20:7295:b0:115:a2f4:6284 with SMTP id o21-20020a056a20729500b00115a2f46284mr13093791pzk.16.1687695466991; Sun, 25 Jun 2023 05:17:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687695466; cv=none; d=google.com; s=arc-20160816; b=l7Wuk+eRO1hqRX0Gvc3bKnM9zEMFg8N1JOJTvX7e/aTWuRoHPaFks0LM5TEuyVaeJ2 5f84K+tsoVqtei1XJPrYsN65xkzvp39Ie+pQAsBcWi4mq14rT5ZhSSZht/kUKrNsfe39 L09uWWHfrtxz9ZvaaE4Fb43Yz95iFwrgdFJX4MaXtt0Bn6BQjh8vicoflFmaqiTXT3e7 MdfeAFPogyZdHXFreMtE70T7qM88btALxGtyi1V7hNYE+pz2MSJyzAW61vAZOLgHdJo8 NQ8PgY668EGRDuBfv6RgDz/EuTNcy0CX6PQhU0N0oqCFH9ijhwSIg+brLw3Y/4S/Kst4 D7VA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=P92bWlxvLPvIdpok+J0oz+l7hsQ5ESNWmNXsRKJJM8U=; fh=TDhZVPIxuB3SapFJ2cfry8UMhra0pONp3eDlzRMzdM4=; b=SRzC2FlDu7SY2xyCvp4d5MYpMOqRnP/EolzaH98eJUu2LeWFgVu67s6XT6ZgADC6zO xXIjs+kQy7AOlUgG9is3lx/dy8uxiSpaUDNlPIGDOoRJ5csYpwAucLJgDlV7EG64nlhC az6ooEweY454GCyIhZ36tqtwLz8Wx+Nmgn9MQWP2bzw/YgCxDscx3ucqAnoFEIQ25NrX 52jFBZZ3deHRyih21SrfWj543fvjyDkZ8BIqyWNV6fAaDRM75xaKWkxyy6qJP4Xg/rz/ Y1yuNnLuXyb74HYp23WcBBuSgbXqNqaVcxN/2oIw1oZ2PTkvtafQJcj3rja+78ZRpb2P H04A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="STvo+L/c"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cd10-20020a056a00420a00b00668724d0816si957165pfb.38.2023.06.25.05.17.34; Sun, 25 Jun 2023 05:17:46 -0700 (PDT) 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=pass header.i=@gmail.com header.s=20221208 header.b="STvo+L/c"; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231976AbjFYLz0 (ORCPT <rfc822;duw91626@gmail.com> + 99 others); Sun, 25 Jun 2023 07:55:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231779AbjFYLzB (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Sun, 25 Jun 2023 07:55:01 -0400 Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 516FBE48; Sun, 25 Jun 2023 04:54:57 -0700 (PDT) Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2b5c231c23aso12764271fa.0; Sun, 25 Jun 2023 04:54:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687694095; x=1690286095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=P92bWlxvLPvIdpok+J0oz+l7hsQ5ESNWmNXsRKJJM8U=; b=STvo+L/c9+EnsmIy2Q9jnhy6YYDwi6zoMcibgrPcSEQZ/aBQ8/zDHtHOha+wENbtyh 5UpKnBR+3SU5/3C3AfNimfM4PjctTRUeMKhsY6+o+VPMFX/Wow3w/FfG3FgfuZY8fUnf 8qLHgPd63fcyTfFWl0UHFqTCvrdkPGN4vTBC+4nFnkuhH2wCmYVjnPeZwazkiYoIvY4K ftlkFAcKW+gE9f924mujEyhGrhKJmrCVLpmwoNUhhZAsxnt0VMrixuQY8q3yCQlxk8LQ 5mkatJ1fn3XdXK631rt4y7CdQ4hX3dm0xBrbIZiILOcE4YweosO7CmV2O8xtQcphr/DF vXeQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687694095; x=1690286095; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=P92bWlxvLPvIdpok+J0oz+l7hsQ5ESNWmNXsRKJJM8U=; b=PZkzB5xnLjWSLIf0FOc25jXkOFRHEqIlNg3eyFrcYlDLBUngn9ifBxWcPk+u7pSpbc aG6HaUUtrpW2f4ZT/UQFpmpYKRwYdi7MPRT7AnvoL7kqgUzJoSUdhqmO3yxLtRV6IwKt c/5Hw1bA+jUIgisUuF6vQEjC9CUA/FNNAbx+j69JGNBHikb/5+N1abSgjIF+wvyOHun8 JwEBh3bZoIMYTdDOlM4iDlhx/OcpKlBGUhRnuqK5+pRauEKOhN1MH4nemrzbFV2mN7tO 7pKm3uKaC05JHYK0I3I51y5QTCfrlGXpZDO459UVsWJWK9q7PvkA2nFegQO7ec2I6PDq s6ig== X-Gm-Message-State: AC+VfDwnZk0YgQ/Gbs4d+31zDrVRyJSnSVQCSIX+UT9fJEiCJnV3IMnj 8H2WEaKLsK4yGRDWilbganmjCSHZitJ6oA== X-Received: by 2002:a2e:9d59:0:b0:2b4:6e21:637d with SMTP id y25-20020a2e9d59000000b002b46e21637dmr12426985ljj.35.1687694095170; Sun, 25 Jun 2023 04:54:55 -0700 (PDT) Received: from WBEC325.dom.local ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id w21-20020a2e9595000000b002b6993b9665sm416043ljh.65.2023.06.25.04.54.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Jun 2023 04:54:54 -0700 (PDT) From: Pawel Dembicki <paweldembicki@gmail.com> To: netdev@vger.kernel.org Cc: Pawel Dembicki <paweldembicki@gmail.com>, Linus Walleij <linus.walleij@linaro.org>, Andrew Lunn <andrew@lunn.ch>, Florian Fainelli <f.fainelli@gmail.com>, Vladimir Oltean <olteanv@gmail.com>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@google.com>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, linux-kernel@vger.kernel.org Subject: [PATCH net-next v2 7/7] net: dsa: vsc73xx: fix MTU configuration Date: Sun, 25 Jun 2023 13:53:42 +0200 Message-Id: <20230625115343.1603330-7-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230625115343.1603330-1-paweldembicki@gmail.com> References: <20230625115343.1603330-1-paweldembicki@gmail.com> 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,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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?1769676961588503020?= X-GMAIL-MSGID: =?utf-8?q?1769676961588503020?= |
Series |
[net-next,v2,1/7] net: dsa: vsc73xx: use read_poll_timeout instead delay loop
|
|
Commit Message
Pawel Dembicki
June 25, 2023, 11:53 a.m. UTC
Switch in MAXLEN register store maximum size of data frame. MTU size is 18 bytes smaller than frame size. Current settings causes problems with packet forwarding. This patch fix MTU settings to proper values. Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable") Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> --- v2: - fix commit message style issue drivers/net/dsa/vitesse-vsc73xx-core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
Comments
On Sun, Jun 25, 2023 at 01:53:42PM +0200, Pawel Dembicki wrote: > Switch in MAXLEN register store maximum size of data frame. > MTU size is 18 bytes smaller than frame size. > > Current settings causes problems with packet forwarding. > This patch fix MTU settings to proper values. > > Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable") > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> > --- Please split this patch from the rest of the series and re-target it towards net.git. > v2: > - fix commit message style issue > > drivers/net/dsa/vitesse-vsc73xx-core.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c > index c946464489ab..59bb3dbe780a 100644 > --- a/drivers/net/dsa/vitesse-vsc73xx-core.c > +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c > @@ -979,17 +979,18 @@ static int vsc73xx_change_mtu(struct dsa_switch *ds, int port, int new_mtu) > struct vsc73xx *vsc = ds->priv; > > return vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, > - VSC73XX_MAXLEN, new_mtu); > + VSC73XX_MAXLEN, new_mtu + ETH_HLEN + ETH_FCS_LEN); > } > > /* According to application not "VSC7398 Jumbo Frames" setting > - * up the MTU to 9.6 KB does not affect the performance on standard > + * up the frame size to 9.6 KB does not affect the performance on standard > * frames. It is clear from the application note that > * "9.6 kilobytes" == 9600 bytes. > */ > static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port) > { > - return 9600; > + /* max mtu = 9600 - ETH_HLEN - ETH_FCS_LEN */ > + return 9582; This can also be: return 9600 - ETH_HLEN - ETH_FCS_LEN; since the arithmetic is on constants, it can be evaluated at compile time and it results in the same generated code, but the comment is no longer necessary. > } > > static void vsc73xx_port_stp_state_set(struct dsa_switch *ds, int port, > -- > 2.34.1 >
niedz., 25 cze 2023 o 16:54 Vladimir Oltean <olteanv@gmail.com> napisaĆ(a): > > On Sun, Jun 25, 2023 at 01:53:42PM +0200, Pawel Dembicki wrote: > > Switch in MAXLEN register store maximum size of data frame. > > MTU size is 18 bytes smaller than frame size. > > > > Current settings causes problems with packet forwarding. > > This patch fix MTU settings to proper values. > > > > Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable") > > Reviewed-by: Linus Walleij <linus.walleij@linaro.org> > > Signed-off-by: Pawel Dembicki <paweldembicki@gmail.com> > > --- > > Please split this patch from the rest of the series and re-target it > towards net.git. > I resend it. https://lore.kernel.org/netdev/20230628194327.1765644-1-paweldembicki@gmail.com/ -- Pawel Dembicki > > v2: > > - fix commit message style issue > > > > drivers/net/dsa/vitesse-vsc73xx-core.c | 7 ++++--- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c > > index c946464489ab..59bb3dbe780a 100644 > > --- a/drivers/net/dsa/vitesse-vsc73xx-core.c > > +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c > > @@ -979,17 +979,18 @@ static int vsc73xx_change_mtu(struct dsa_switch *ds, int port, int new_mtu) > > struct vsc73xx *vsc = ds->priv; > > > > return vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, > > - VSC73XX_MAXLEN, new_mtu); > > + VSC73XX_MAXLEN, new_mtu + ETH_HLEN + ETH_FCS_LEN); > > } > > > > /* According to application not "VSC7398 Jumbo Frames" setting > > - * up the MTU to 9.6 KB does not affect the performance on standard > > + * up the frame size to 9.6 KB does not affect the performance on standard > > * frames. It is clear from the application note that > > * "9.6 kilobytes" == 9600 bytes. > > */ > > static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port) > > { > > - return 9600; > > + /* max mtu = 9600 - ETH_HLEN - ETH_FCS_LEN */ > > + return 9582; > > This can also be: > > return 9600 - ETH_HLEN - ETH_FCS_LEN; > > since the arithmetic is on constants, it can be evaluated at compile > time and it results in the same generated code, but the comment is no > longer necessary. > > > } > > > > static void vsc73xx_port_stp_state_set(struct dsa_switch *ds, int port, > > -- > > 2.34.1 > > >
diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index c946464489ab..59bb3dbe780a 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -979,17 +979,18 @@ static int vsc73xx_change_mtu(struct dsa_switch *ds, int port, int new_mtu) struct vsc73xx *vsc = ds->priv; return vsc73xx_write(vsc, VSC73XX_BLOCK_MAC, port, - VSC73XX_MAXLEN, new_mtu); + VSC73XX_MAXLEN, new_mtu + ETH_HLEN + ETH_FCS_LEN); } /* According to application not "VSC7398 Jumbo Frames" setting - * up the MTU to 9.6 KB does not affect the performance on standard + * up the frame size to 9.6 KB does not affect the performance on standard * frames. It is clear from the application note that * "9.6 kilobytes" == 9600 bytes. */ static int vsc73xx_get_max_mtu(struct dsa_switch *ds, int port) { - return 9600; + /* max mtu = 9600 - ETH_HLEN - ETH_FCS_LEN */ + return 9582; } static void vsc73xx_port_stp_state_set(struct dsa_switch *ds, int port,