lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <e270aedb761cad689ee969285ac07578848e2ae5.camel@microchip.com>
Date:   Thu, 24 Nov 2022 15:05:27 +0000
From:   <Arun.Ramadoss@...rochip.com>
To:     <olteanv@...il.com>, <UNGLinuxDriver@...rochip.com>,
        <vivien.didelot@...il.com>, <andrew@...n.ch>,
        <f.fainelli@...il.com>, <kuba@...nel.org>, <edumazet@...gle.com>,
        <pabeni@...hat.com>, <o.rempel@...gutronix.de>,
        <Woojung.Huh@...rochip.com>, <davem@...emloft.net>
CC:     <linux-kernel@...r.kernel.org>, <netdev@...r.kernel.org>,
        <kernel@...gutronix.de>
Subject: Re: [PATCH net-next v6 6/6] net: dsa: microchip: ksz8: move all DSA
 configurations to one location

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@...gutronix.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ