Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp19704095rwd; Wed, 28 Jun 2023 13:02:43 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4uRimLWyUv2CW+fVLRyRfpxB6pPrlBHDMID6AA1DonE4wbDX5B2m/GQxhfQumubDrlol6L X-Received: by 2002:a05:6512:3714:b0:4f8:5886:1868 with SMTP id z20-20020a056512371400b004f858861868mr6679251lfr.24.1687982562903; Wed, 28 Jun 2023 13:02:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687982562; cv=none; d=google.com; s=arc-20160816; b=TJdtpHgk2CUmNdYYhs62ZZlQvQyfG1ZjoYH9+F7ldgyM8ExMs8FiqTNbgIZA1BDyKV 6vA0SFhEfBSQuwVvn3KTC8TITmLyYJOz5fLjeZHUli0WnnH7tSdiGNqK14yAJWYi0H8E 4InGdF45W1m/h3w7GDNxaNzfB+tmLJl1GGNYoHnjl//hyb+a0Ft7x4l5OL/D68EsgCA4 MS1lF+bVZ+k9suhdaOnq44MZbFO4uTJKDe5On1+h/ql57ZQpV9IVjJ4gY1NS7UThtQu9 wi+38/e0eukezSDhU0gxWkYkzZsYBSbZEMtsMQRyXOA34rROOqpVAOPE1ZUmtsQ6u7MQ 5gEg== 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=24xzpN7HM7t7BscRHE2SgUACQ+eIA8sq8IN33K3tmOQ=; fh=TDhZVPIxuB3SapFJ2cfry8UMhra0pONp3eDlzRMzdM4=; b=pvSfDekuspLFbhQPFsx6XosWuUsykK2/0Qb82nJ/PHn/Z+BxRzBKjp+KWKoeKyQgDj s+fKa8OeE1r0ckfF9yYkKeg3yj2OxyftQlzl8oYpZdcGsy6x/LdSXn0OBe5ng/NqEXHO GTGiGHKNWdN2nimnYi8Ir0ksAsRAlxVs6v8gTecYejxN5CUh2MsVnG9tLYPDOT+CW8Hx J3EYIQN8VsuP/2g3g6qZa616J10jM6/F0Yv01nksw3pw7zZy3C1UvHCTVS3BbbNDlKRC dC7y5dWPiLgErXWbngQsvcZKgaESj4ug0bDhOrj+KCggRMYh/OnIz/kOKug8uXTgrs8g uwXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="WODHj/yY"; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b2-20020aa7dc02000000b0051a595dc64bsi5277710edu.105.2023.06.28.13.02.18; Wed, 28 Jun 2023 13:02:42 -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="WODHj/yY"; 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 S230014AbjF1ToM (ORCPT + 99 others); Wed, 28 Jun 2023 15:44:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58440 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbjF1ToK (ORCPT ); Wed, 28 Jun 2023 15:44:10 -0400 Received: from mail-lf1-x131.google.com (mail-lf1-x131.google.com [IPv6:2a00:1450:4864:20::131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 680DD1BE6; Wed, 28 Jun 2023 12:44:09 -0700 (PDT) Received: by mail-lf1-x131.google.com with SMTP id 2adb3069b0e04-4f957a45b10so39308e87.0; Wed, 28 Jun 2023 12:44:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1687981447; x=1690573447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=24xzpN7HM7t7BscRHE2SgUACQ+eIA8sq8IN33K3tmOQ=; b=WODHj/yYpYvcJQVjjp07mXGyIyXIxAnE1y3kleyMU/+wK0u6GzGJ5IYJvZ49WjJJXG hMixzSrwu9JbRf9Ujwch7ub8/obzcnE5N33y8jjIuOdKdQFky22pQKevW2CC6blz/Ma+ bDIhm8XS56ISmfuFjV61BT/98AUOOJ0RQL1f8TWUrWdH+iYlmRdM31YeT0/jpX3IQ+V1 vAIL9wjb6JMLeZskH77MSHE6qBmeXbHjZAPW/BPpKqmLVZqbjaJJL6VVjd2xZywH5CuW BJU28FW4UJoU6vnIOYtJ7G7jJosBSdg41eFJtcoexLU5AiBMGLg/lKdUvW7vpwT5G1To wg/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687981447; x=1690573447; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=24xzpN7HM7t7BscRHE2SgUACQ+eIA8sq8IN33K3tmOQ=; b=EQxGEe643WO5b9lHbsOqIlplkJD9nWe3AjI38nntm4ahj8mogrHjKANXKRcSkl6jED 6X3suw6YY967TIO9ZOGkr28kJDjCGUEDKVsOSE+4rweXVkdyPNgbxnTAWPEyG3pakXgT hEC1ggsnehln6gMyZSn/nBfgpllmoW1UOFJbIsZ2WmxlUkaoPY1w5X0ontO082T/8Z4z ANYCPIHjB1TTs2HdhaHTWToSmprI8Mj3bNXaB1juwTg0dgYglpcTS4VKIK5qu6YhaKQq no/qK3+qTnIJnAnOULxoE5JKwHsY8DWOQg/B1YtE7lEacAbDT1ZOlM18svhmwCH1k8yH fkpg== X-Gm-Message-State: ABy/qLYQJ3IQbsRUBz0HUlUEmRC9GMJSHD62htFBP6XOLg2VUMgEqc+A 2xcnAmJzrABRp4DgGieIopzIvYIGMSXDiA== X-Received: by 2002:a05:6512:3194:b0:4fb:99c6:8533 with SMTP id i20-20020a056512319400b004fb99c68533mr85285lfe.33.1687981447038; Wed, 28 Jun 2023 12:44:07 -0700 (PDT) Received: from WBEC325.dom.local ([185.188.71.122]) by smtp.gmail.com with ESMTPSA id q6-20020ac246e6000000b004fb915e8b93sm355434lfo.201.2023.06.28.12.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jun 2023 12:44:02 -0700 (PDT) From: Pawel Dembicki To: netdev@vger.kernel.org Cc: Pawel Dembicki , Linus Walleij , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , linux-kernel@vger.kernel.org Subject: [PATCH] net: dsa: vsc73xx: fix MTU configuration Date: Wed, 28 Jun 2023 21:43:27 +0200 Message-Id: <20230628194327.1765644-1-paweldembicki@gmail.com> X-Mailer: git-send-email 2.34.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,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: X-Mailing-List: linux-kernel@vger.kernel.org Switch in MAXLEN register stores the maximum size of a data frame. The MTU size is 18 bytes smaller than the frame size. The current settings are causing problems with packet forwarding. This patch fixes the MTU settings to proper values. Fixes: fb77ffc6ec86 ("net: dsa: vsc73xx: make the MTU configurable") Reviewed-by: Linus Walleij Signed-off-by: Pawel Dembicki --- In my first attempt, I sent it to net-next [0], but I was asked to resend it to net. [0]https://lore.kernel.org/netdev/20230625115343.1603330-7-paweldembicki@gmail.com/ drivers/net/dsa/vitesse-vsc73xx-core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/net/dsa/vitesse-vsc73xx-core.c b/drivers/net/dsa/vitesse-vsc73xx-core.c index ae55167ce0a6..ef1a4a7c47b2 100644 --- a/drivers/net/dsa/vitesse-vsc73xx-core.c +++ b/drivers/net/dsa/vitesse-vsc73xx-core.c @@ -1025,17 +1025,17 @@ 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; + return 9600 - ETH_HLEN - ETH_FCS_LEN; } static const struct dsa_switch_ops vsc73xx_ds_ops = { -- 2.34.1