From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4ABFBC433FE for ; Fri, 11 Nov 2022 05:27:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231157AbiKKF1W (ORCPT ); Fri, 11 Nov 2022 00:27:22 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229461AbiKKF1U (ORCPT ); Fri, 11 Nov 2022 00:27:20 -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 9EF7249B7D for ; Thu, 10 Nov 2022 21:27:18 -0800 (PST) Received: from ptx.hi.pengutronix.de ([2001:67c:670:100:1d::c0]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1otMZ8-0004Zl-0V; Fri, 11 Nov 2022 06:26:58 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1otMZ6-0007bV-Eu; Fri, 11 Nov 2022 06:26:56 +0100 Date: Fri, 11 Nov 2022 06:26:56 +0100 From: Oleksij Rempel To: Florian Fainelli Cc: Woojung Huh , UNGLinuxDriver@microchip.com, Andrew Lunn , Vivien Didelot , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Arun Ramadoss , kernel@pengutronix.de, linux-kernel@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next v4 1/4] net: dsa: microchip: move max mtu to one location Message-ID: <20221111052656.GC27099@pengutronix.de> References: <20221110122225.1283326-1-o.rempel@pengutronix.de> <20221110122225.1283326-2-o.rempel@pengutronix.de> <53bd4c46-17f9-91c1-fda5-bd2d09ae2ff7@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <53bd4c46-17f9-91c1-fda5-bd2d09ae2ff7@gmail.com> X-Sent-From: Pengutronix Hildesheim X-URL: http://www.pengutronix.de/ X-Accept-Language: de,en X-Accept-Content-Type: text/plain User-Agent: Mutt/1.10.1 (2018-07-13) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c0 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Florian, On Thu, Nov 10, 2022 at 06:42:03AM -0800, Florian Fainelli wrote: > > > On 11/10/2022 4:22 AM, Oleksij Rempel wrote: > > There are no HW specific registers, so we can process all of them > > in one location. > > > > Signed-off-by: Oleksij Rempel > > Tested-by: Arun Ramadoss (KSZ9893 and LAN937x) > > This looks good to me, just one nit see below > > [snip] > > > @@ -2500,10 +2499,23 @@ static int ksz_max_mtu(struct dsa_switch *ds, int port) > > { > > struct ksz_device *dev = ds->priv; > > - if (!dev->dev_ops->max_mtu) > > - return -EOPNOTSUPP; > > + switch (dev->chip_id) { > > + case KSZ8563_CHIP_ID: > > + case KSZ9477_CHIP_ID: > > + case KSZ9563_CHIP_ID: > > + case KSZ9567_CHIP_ID: > > + case KSZ9893_CHIP_ID: > > + case KSZ9896_CHIP_ID: > > + case KSZ9897_CHIP_ID: > > + case LAN9370_CHIP_ID: > > + case LAN9371_CHIP_ID: > > + case LAN9372_CHIP_ID: > > + case LAN9373_CHIP_ID: > > + case LAN9374_CHIP_ID: > > + return KSZ9477_MAX_FRAME_SIZE - VLAN_ETH_HLEN - ETH_FCS_LEN; > > Rename to KSZ_MAX_FRAME_SIZE to denote this is a common constant? This is not so common. This list is extended by the patch 4, with two more types of switches with different max frame size. Regards, Oleksij -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |