Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp8646967rwb; Thu, 24 Nov 2022 02:21:39 -0800 (PST) X-Google-Smtp-Source: AA0mqf4dy6tQmDTocDFIhdNuGzPqmyVDdyJmqk72Lwz2Su8w4Zrdb5wkO39WOvxTkOy7zr6MKuSs X-Received: by 2002:a17:902:ecd2:b0:189:5f79:6ac2 with SMTP id a18-20020a170902ecd200b001895f796ac2mr258715plh.132.1669285299749; Thu, 24 Nov 2022 02:21:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669285299; cv=none; d=google.com; s=arc-20160816; b=XqliVGOV+DUFyknYdSiqvr4U6kTXyofxUkSvhoxwpCOEqoUYTyg/uQsllWkDxeN4Nm xMzU9dK6meP1+BLdAfTo00BsAluTCaorLJ9SrtcqmqWEYimZsPlWpw/CAhJ9SMVDooG5 FIK7jT5l6ivtQJFKBY8NJ0//uXVjcUJFdae8HZ20dP4FY3fIfBlJnDKTu87k7Ct+nHcJ FCRinNIjhVp5xWSeGCYdbMRayDZER8/74ZTzo/ic5AqBQIXKl7Vi2lI0oLlilMVuSS5j boXlCET11pQW0XFpNwRGByNlQIKoJ6f0CFtzR+fh/8L+wu1N5Y9FpnO4jOfrYXWF9cj1 tMrw== 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 Return-Path: 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.21.29; Thu, 24 Nov 2022 02:21:39 -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 + 87 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 Content-Transfer-Encoding: 8bit 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 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..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); -- 2.30.2