Message ID | 20221124101458.3353902-7-o.rempel@pengutronix.de (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | net: dsa: microchip: add MTU support for KSZ8 series | expand |
Context | Check | Description |
---|---|---|
netdev/tree_selection | success | Clearly marked for net-next |
netdev/fixes_present | success | Fixes tag not required for -next series |
netdev/subject_prefix | success | Link |
netdev/cover_letter | success | Series has a cover letter |
netdev/patch_count | success | Link |
netdev/header_inline | success | No static functions without inline keyword in header files |
netdev/build_32bit | success | Errors and warnings before: 0 this patch: 0 |
netdev/cc_maintainers | success | CCed 10 of 10 maintainers |
netdev/build_clang | success | Errors and warnings before: 0 this patch: 0 |
netdev/module_param | success | Was 0 now: 0 |
netdev/verify_signedoff | success | Signed-off-by tag matches author and committer |
netdev/check_selftest | success | No net selftest shell script |
netdev/verify_fixes | success | No Fixes tag |
netdev/build_allmodconfig_warn | success | Errors and warnings before: 0 this patch: 0 |
netdev/checkpatch | success | total: 0 errors, 0 warnings, 0 checks, 32 lines checked |
netdev/kdoc | success | Errors and warnings before: 0 this patch: 0 |
netdev/source_inline | success | Was 0 now: 0 |
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 > > - /* We rely on software untagging on the CPU port, so that we > - * can support both tagged and untagged VLANs > - */ > - dev->ds->untag_bridge_pvid = true; > - > - /* VLAN filtering is partly controlled by the global VLAN > - * Enable flag > - */ > - dev->ds->vlan_filtering_is_global = true; > - > return 0; > } > > -- > 2.30.2 >
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. Regards, Oleksij
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 |
On Fri, Nov 25, 2022 at 07:14:32AM +0000, Arun.Ramadoss@microchip.com wrote: > 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. I'll try to add ore cleanups to my currently pending patch set. Currently I'm working on following ksz8 related tasks: - add MTU configuration support - add stats64 support - fix fdb_dump and add fdb_add/del support - fix PHY loopback support to make selftest work Regards, Oleksij
On Fri, Nov 25, 2022 at 07:14:32AM +0000, Arun.Ramadoss@microchip.com wrote: > 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. Can you please give your Acked-by? :)
On Fri, 2022-11-25 at 12:54 +0100, Oleksij Rempel wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > On Fri, Nov 25, 2022 at 07:14:32AM +0000, Arun.Ramadoss@microchip.com > wrote: > > 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. > > Can you please give your Acked-by? :) Acked-by: Arun Ramadoss <arun.ramadoss@microchip.com> > > -- > 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 |
On Thu, Nov 24, 2022 at 11:14:58AM +0100, Oleksij Rempel wrote: > 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> > --- Reviewed-by: Vladimir Oltean <olteanv@gmail.com>
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; - /* We rely on software untagging on the CPU port, so that we - * can support both tagged and untagged VLANs - */ - dev->ds->untag_bridge_pvid = true; - - /* VLAN filtering is partly controlled by the global VLAN - * Enable flag - */ - dev->ds->vlan_filtering_is_global = true; - return 0; }
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(-)