From patchwork Wed Nov 23 11:26:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 24924 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp2732306wrr; Wed, 23 Nov 2022 03:34:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7N76KpD0pyb+Ne2dOjRebTAPVNGKfhZ5TJ/DkHR71PYIMgw4XxWuIMhTkDk8Hqm3Ky6dKJ X-Received: by 2002:a17:906:7848:b0:7ad:b286:72da with SMTP id p8-20020a170906784800b007adb28672damr23631077ejm.152.1669203257175; Wed, 23 Nov 2022 03:34:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669203257; cv=none; d=google.com; s=arc-20160816; b=fVx59OfWIdB+cfz+4Ep2M6C85IjT3dwzL3YNR462/x9qRXUXfzZNttrE48YwJUTbHz LDCMsgHGbSVR3gy0JXyAc9vTxb09sbULnJPDrriolawFZ5xKqsgOUFz5KRGM3kKhEfxl VEKlAe7bPnQtHBVQSJA0ax4n2dIVIJIxR4s+tCoJhhZ6zpqIuiKufhKC0FBBUUpFIl2k N8S6aycCAfhFRDmO6P20S1E/h4tLaoB/EQVsGzgznjKJ/a/SfOQBOV4RVz4YGRLat0NS jjTzMAjzgWd5coDTLqfMq7uo0FbvSMMb6zW5Xii2ppAwsWC1kM/yZvIpOdFKAdtw99zo Y/Dg== 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; bh=bVPUjL+8Tj5i+GmnriF02stCg9CUsBvq2n3MOAxG4Ck=; b=bqxh+I5nfG1svldcFQXOSIZWM/dsdB+Mkp79hyL5sc0FmuQ2FJw9m7VaeC8gjzIwXN 1XixOGNBhsDCvWWqIfP7E/lpUCMeWcQKCRbp++vyRMzveKs9nlAYqkLVZ6ICLE4juDOd 0hU9Ov7SRlGF3Y+Ba1TWhUIRdeT/HKdBlMbNr0nUJm2ymLuZ7+z46guv1Z/8FNaFoTzm cxos1tkJw66fud6S4YsCzIhie2N8aV4tZ6wM/XnU4SQQH7y84RSFaAr2QQ95PbPheVc/ On64Znw/FcwYLnue4MYx9650AdLacLbhgUOmtAdFUAwZ+wwpYXJpBsdB//mMXGRQPXGN iAQw== ARC-Authentication-Results: i=1; mx.google.com; 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g40-20020a056402322800b004591f959c3bsi7400597eda.427.2022.11.23.03.33.53; Wed, 23 Nov 2022 03:34:17 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237123AbiKWL1T (ORCPT + 99 others); Wed, 23 Nov 2022 06:27:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236323AbiKWL0k (ORCPT ); Wed, 23 Nov 2022 06:26:40 -0500 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58F06ED5FD for ; Wed, 23 Nov 2022 03:26:39 -0800 (PST) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oxntd-0003vq-Hc; Wed, 23 Nov 2022 12:26:29 +0100 Received: from [2a0a:edc0:0:1101:1d::ac] (helo=dude04.red.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from ) id 1oxntb-0062RP-J7; Wed, 23 Nov 2022 12:26:28 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oxntb-008jrB-ET; Wed, 23 Nov 2022 12:26:27 +0100 From: Oleksij Rempel To: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: Oleksij Rempel , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, Arun.Ramadoss@microchip.com Subject: [PATCH net-next v5 5/5] net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches Date: Wed, 23 Nov 2022 12:26:25 +0100 Message-Id: <20221123112625.2082797-6-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221123112625.2082797-1-o.rempel@pengutronix.de> References: <20221123112625.2082797-1-o.rempel@pengutronix.de> MIME-Version: 1.0 X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 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-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750286474463566665?= X-GMAIL-MSGID: =?utf-8?q?1750286474463566665?= KSZ8795 and KSZ9477 compatible series of switches use global max frame size configuration register. So, enable MTU normalization for this reason. Signed-off-by: Oleksij Rempel --- drivers/net/dsa/microchip/ksz8795.c | 2 ++ drivers/net/dsa/microchip/ksz9477.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/net/dsa/microchip/ksz8795.c b/drivers/net/dsa/microchip/ksz8795.c index d01bfd609130..d88d0b989e1a 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1426,6 +1426,8 @@ int ksz8_switch_init(struct ksz_device *dev) */ dev->ds->vlan_filtering_is_global = true; + dev->ds->mtu_enforcement_ingress = true; + return 0; } diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index f6e7968ab105..4fb07fbdf565 100644 --- a/drivers/net/dsa/microchip/ksz9477.c +++ b/drivers/net/dsa/microchip/ksz9477.c @@ -1134,6 +1134,8 @@ int ksz9477_setup(struct dsa_switch *ds) struct ksz_device *dev = ds->priv; int ret = 0; + dev->ds->mtu_enforcement_ingress = true; + /* Required for port partitioning. */ ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY, true);