From patchwork Thu Nov 24 10:14:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleksij Rempel X-Patchwork-Id: 25424 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp3304665wrr; Thu, 24 Nov 2022 02:21:03 -0800 (PST) X-Google-Smtp-Source: AA0mqf4FjuYQpRRXmbirFmSuP6fvSXf4ph9PWmNcd/U4H3GZ3V7a6IXbyZAv7j+llBg/glr7/qBE X-Received: by 2002:a17:902:ee89:b0:187:1a3f:d54b with SMTP id a9-20020a170902ee8900b001871a3fd54bmr26659233pld.9.1669285263299; Thu, 24 Nov 2022 02:21:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669285263; cv=none; d=google.com; s=arc-20160816; b=ewBAXJSLu0Pcu2nM0dcRv2MISvUdris6kAhaORrRaoJ/2vAMsPxIxIKolZHDNAJbmA 7pLrr1WT4GEcUWKEyWXYML36bGDs7Y3HWaqgby9pHurOXUwAoujzne9gdX8zIVLQ4s9H XI5b1vtJLGKID/x8N1ZCwLT+cHXHbeCpGjOxpDtVmcYIJa/LmkMfFNO9Dr/Vm8dbgfdP zy4qHUTK2aaWWf+jbiqB22ZAveoQMV/o8q+qWaYhezsC1ZuJBgyv0D7aHhQdEm/gpA9h WnNVpbpbG9i012iIUD9XUk1lJBQquBo6CdSd913ygYfHflTAjcEvoASdq/PI6bMvi7cV Avvw== 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=6PRo2cFSZkUjCyJ5Dg5p0MhfGKuubY2yf/QJdPhWjtM=; b=RE6LW20soMcdPnnCrimR8DYQRN+/VEXShAkVebSRRQ2hCKLhQsWysb6egnMfmWsCCc 9t1E2pVE93eCsWxZa5NNQVvwoXJRlhAniWm6ufewUlHiNjSzkFK67hZ76a0NGcHWZyzv U1YtYNNTz5X89mwEUGl4xwCsfXbQgOXWvoF4sIIxuEliKEjsJ+yEl/TJpFw48EiJhqTO F2FWKzdp5FwrkibTqS9fiQZ5irJnysnndGDeTLrzjx8qfHLdUMceoUyO9jfi0kYKYXYk 61bycijse9Qb/lIFAnZaI9BV9R0NAiWcjg33KkNGBZk4J5PJ1TCSm9lxs8Z1/c2cnpmV 0m2w== 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 k9-20020a170902ba8900b001853ad3944dsi555071pls.480.2022.11.24.02.20.50; Thu, 24 Nov 2022 02:21:03 -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 S229886AbiKXKPb (ORCPT + 99 others); Thu, 24 Nov 2022 05:15:31 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229649AbiKXKPO (ORCPT ); Thu, 24 Nov 2022 05:15:14 -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 50955C4940 for ; Thu, 24 Nov 2022 02:15:13 -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 1oy9G4-0004Ic-1x; Thu, 24 Nov 2022 11:15:04 +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 1oy9G0-0000jR-AR; Thu, 24 Nov 2022 11:15:01 +0100 Received: from ore by dude04.red.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from ) id 1oy9Fz-00E4Wy-N5; Thu, 24 Nov 2022 11:14:59 +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 v6 5/6] net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches Date: Thu, 24 Nov 2022 11:14:57 +0100 Message-Id: <20221124101458.3353902-6-o.rempel@pengutronix.de> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20221124101458.3353902-1-o.rempel@pengutronix.de> References: <20221124101458.3353902-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?1750372464007800609?= X-GMAIL-MSGID: =?utf-8?q?1750372464007800609?= 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 Acked-by: Arun Ramadoss Reviewed-by: Vladimir Oltean --- 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..060e41b9b6ef 100644 --- a/drivers/net/dsa/microchip/ksz8795.c +++ b/drivers/net/dsa/microchip/ksz8795.c @@ -1357,6 +1357,8 @@ int ksz8_setup(struct dsa_switch *ds) struct ksz_device *dev = ds->priv; int i; + ds->mtu_enforcement_ingress = true; + ksz_cfg(dev, S_REPLACE_VID_CTRL, SW_FLOW_CTRL, true); /* Enable automatic fast aging when link changed detected. */ diff --git a/drivers/net/dsa/microchip/ksz9477.c b/drivers/net/dsa/microchip/ksz9477.c index f6e7968ab105..47b54ecf2c6f 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; + ds->mtu_enforcement_ingress = true; + /* Required for port partitioning. */ ksz9477_cfg32(dev, REG_SW_QM_CTRL__4, UNICAST_VLAN_BOUNDARY, true);