netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: <Arun.Ramadoss@microchip.com>
To: <o.rempel@pengutronix.de>
Cc: <olteanv@gmail.com>, <UNGLinuxDriver@microchip.com>,
	<linux-kernel@vger.kernel.org>, <vivien.didelot@gmail.com>,
	<andrew@lunn.ch>, <f.fainelli@gmail.com>, <kuba@kernel.org>,
	<edumazet@google.com>, <pabeni@redhat.com>,
	<netdev@vger.kernel.org>, <Woojung.Huh@microchip.com>,
	<davem@davemloft.net>, <kernel@pengutronix.de>
Subject: Re: [PATCH net-next v6 6/6] net: dsa: microchip: ksz8: move all DSA configurations to one location
Date: Fri, 25 Nov 2022 07:14:32 +0000	[thread overview]
Message-ID: <439da76d5f0fb800f11cec66c06a444a7a4e591a.camel@microchip.com> (raw)
In-Reply-To: <20221125055240.GA22688@pengutronix.de>

Hi Oleksij,

On Fri, 2022-11-25 at 06:52 +0100, Oleksij Rempel wrote:
> EXTERNAL EMAIL: Do not click links or open attachments unless you
> know the content is safe
> 
> 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 <o.rempel@pengutronix.de>
> > > ---
> > >  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.

Agreed. 
I thought of cleaning up
ksz8_switch_init/ksz9477_switch_init/lan937x_switch_init, since these
functions are not performing any useful activity other than
initializing these variables. Similarly all the exit function are
performing same reset function. I thought these init and exit function
in the ksz_dev_ops structure is reduntant.

> 
> Regards,
> Oleksij
> --
> Pengutronix
> e.K.                           |                             |
> Steuerwalder Str. 21                       | 
> http://www.pengutronix.de/e/  |
> 31137 Hildesheim, Germany                  | Phone: +49-5121-206917-
> 0    |
> Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-
> 5555 |

  reply	other threads:[~2022-11-25  7:14 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-24 10:14 [PATCH net-next v6 0/6] net: dsa: microchip: add MTU support for KSZ8 series Oleksij Rempel
2022-11-24 10:14 ` [PATCH net-next v6 1/6] net: dsa: microchip: move max mtu to one location Oleksij Rempel
2022-11-24 10:14 ` [PATCH net-next v6 2/6] net: dsa: microchip: do not store max MTU for all ports Oleksij Rempel
2022-11-24 10:14 ` [PATCH net-next v6 3/6] net: dsa: microchip: add ksz_rmw8() function Oleksij Rempel
2022-11-24 10:14 ` [PATCH net-next v6 4/6] net: dsa: microchip: ksz8: add MTU configuration support Oleksij Rempel
2022-11-24 10:14 ` [PATCH net-next v6 5/6] net: dsa: microchip: enable MTU normalization for KSZ8795 and KSZ9477 compatible switches Oleksij Rempel
2022-11-24 15:08   ` Arun.Ramadoss
2022-11-25 21:32   ` Vladimir Oltean
2022-11-24 10:14 ` [PATCH net-next v6 6/6] net: dsa: microchip: ksz8: move all DSA configurations to one location Oleksij Rempel
2022-11-24 15:05   ` Arun.Ramadoss
2022-11-25  5:52     ` Oleksij Rempel
2022-11-25  7:14       ` Arun.Ramadoss [this message]
2022-11-25  7:49         ` Oleksij Rempel
2022-11-25 11:54         ` Oleksij Rempel
2022-11-25 13:46           ` Arun.Ramadoss
2022-11-25 21:33   ` Vladimir Oltean

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=439da76d5f0fb800f11cec66c06a444a7a4e591a.camel@microchip.com \
    --to=arun.ramadoss@microchip.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=Woojung.Huh@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=o.rempel@pengutronix.de \
    --cc=olteanv@gmail.com \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).