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 846D5C4332F for ; Fri, 25 Nov 2022 05:53:07 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229623AbiKYFxG (ORCPT ); Fri, 25 Nov 2022 00:53:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36468 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229630AbiKYFxD (ORCPT ); Fri, 25 Nov 2022 00:53:03 -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 33B271AD87 for ; Thu, 24 Nov 2022 21:53:02 -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 1oyRdi-0006Av-T3; Fri, 25 Nov 2022 06:52:42 +0100 Received: from ore by ptx.hi.pengutronix.de with local (Exim 4.92) (envelope-from ) id 1oyRdg-00081L-EZ; Fri, 25 Nov 2022 06:52:40 +0100 Date: Fri, 25 Nov 2022 06:52:40 +0100 From: Oleksij Rempel To: Arun.Ramadoss@microchip.com Cc: olteanv@gmail.com, UNGLinuxDriver@microchip.com, vivien.didelot@gmail.com, andrew@lunn.ch, f.fainelli@gmail.com, kuba@kernel.org, edumazet@google.com, pabeni@redhat.com, Woojung.Huh@microchip.com, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@pengutronix.de Subject: Re: [PATCH net-next v6 6/6] net: dsa: microchip: ksz8: move all DSA configurations to one location Message-ID: <20221125055240.GA22688@pengutronix.de> References: <20221124101458.3353902-1-o.rempel@pengutronix.de> <20221124101458.3353902-7-o.rempel@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: 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 Arun, On Thu, Nov 24, 2022 at 03:05:27PM +0000, Arun.Ramadoss@microchip.com wrote: > Hi Oleksij, > On Thu, 2022-11-24 at 11:14 +0100, Oleksij Rempel wrote: > > EXTERNAL EMAIL: Do not click links or open attachments unless you > > know the content is safe > > > > To make the code more comparable to KSZ9477 code, move DSA > > configurations to the same location. > > > > Signed-off-by: Oleksij Rempel > > --- > > drivers/net/dsa/microchip/ksz8795.c | 20 ++++++++++---------- > > 1 file changed, 10 insertions(+), 10 deletions(-) > > > > diff --git a/drivers/net/dsa/microchip/ksz8795.c > > b/drivers/net/dsa/microchip/ksz8795.c > > index 060e41b9b6ef..003b0ac2854c 100644 > > --- a/drivers/net/dsa/microchip/ksz8795.c > > +++ b/drivers/net/dsa/microchip/ksz8795.c > > @@ -1359,6 +1359,16 @@ int ksz8_setup(struct dsa_switch *ds) > > > > ds->mtu_enforcement_ingress = true; > > > > + /* We rely on software untagging on the CPU port, so that we > > + * can support both tagged and untagged VLANs > > + */ > > + ds->untag_bridge_pvid = true; > > + > > + /* VLAN filtering is partly controlled by the global VLAN > > + * Enable flag > > + */ > > + ds->vlan_filtering_is_global = true; > > + > > ksz_cfg(dev, S_REPLACE_VID_CTRL, SW_FLOW_CTRL, true); > > > > /* Enable automatic fast aging when link changed detected. */ > > @@ -1418,16 +1428,6 @@ int ksz8_switch_init(struct ksz_device *dev) > > dev->phy_port_cnt = dev->info->port_cnt - 1; > > dev->port_mask = (BIT(dev->phy_port_cnt) - 1) | dev->info- > > >cpu_ports; > > Since you moved dsa related items to ksz8_setup, remaining items in > ksz8_switch_init are > - dev->cpu_port - Used in ksz_setup but called after the individual > switch setup function. We can move it ksz8_setup. > - dev->phy_port_cnt - Used in ksz8_vlan_filtering and > ksz8_config_cpuport. We can move. > - dev->port_mask - used in ksz_switch_register. So we cannot move. > > To make the ksz8_switch_init and ksz9477_switch_init function similar, > we can move dev->cpu_port and dev->phy_port_cnt from ksz8_switch_init > to ksz8_setup It make no sense to move this variables. Every place where they are used, can be replaced with dsa functions like: dsa_switch_for_each_user_port() or dsa_cpu_ports()/dsa_is_cpu_port() Making this changes within this patch set make no sense to. 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 |