Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp9972192rwb; Thu, 24 Nov 2022 22:37:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf6flMOXAyOtK8KRbsWflIsy8+rmDpWgvWmCSBfFg39zuS3QRPi56dJuMm/esmylKdZaZYIV X-Received: by 2002:a17:907:80cd:b0:7bb:35b4:777d with SMTP id io13-20020a17090780cd00b007bb35b4777dmr5165518ejc.302.1669358236845; Thu, 24 Nov 2022 22:37:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669358236; cv=none; d=google.com; s=arc-20160816; b=JjJlBmc/IRb7jaLEhrzgC/dMTIdkgbzNKb+qR7nBtGggYv0WYm57+HNehbpz+qAFZz Yw7ufaKulaW8xNdkKzfgo8patijS+FRZNotAEkXV8HCgyh8Ba2tn1ZbelVoOLnCKY8lF VqI0lphgWkfCmV4VZVbfzvN1tFsOmkosrkqvlARrM8juH2dKC6CTjyO4bRVMw6dbXTzU ZSeRs21CMl61WvGWyGHJsk6LdGyIz3RAU9hrJhoqOjxZ+SjyK7/rNS3zktvEB+brZWIC ashLn2q+6ZMj8Yure+sAFWhPYuSZMKsp9B34nlzH32/O+YlGRhB288oaK/Y7DL1R1sMG XHSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=Kpj/XjZI0uy0s7/o4I+slELEGZzfFmEwKykfs5Xn/Tc=; b=og6JNR8am/Lo/Chn3NSCA7PFvisLU37cdYrgzMtXwKX37nfrDJh2l+Ja1JLT1D2zcI HYzoFCdQ3/IyGTd3G4xzLKNxG2jpjnv0O+WevYnZ9hqk1BN/93TbB6nUiyVhIj6/FcQL 3GL46K5APt7KlN4ZjOcWXfTG+1gCbF2YyamTvMxLkoN5II3zy2lQEgZZ94eNqOsFGOKj gvMZAmBp6nz86iaSuJ8PvAtMZ9iYn25kaZrmcheDTQlekrXs+WoVE2hjjm7c9FpQyfzc tx6EGo9CHqIrR3Y/mSX8ltgeq4sOpn9+kCP4Fv2xYOsl5/p8AcwJxh/Yr68ooXnkMScj pBFA== 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 v22-20020a056402349600b00462e5235356si3145251edc.619.2022.11.24.22.36.56; Thu, 24 Nov 2022 22:37:16 -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 S229570AbiKYFxF (ORCPT + 87 others); Fri, 25 Nov 2022 00:53:05 -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 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 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 |