public inbox for netdev@vger.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Oltean <olteanv@gmail.com>
To: Arun Ramadoss <arun.ramadoss@microchip.com>
Cc: linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	Woojung Huh <woojung.huh@microchip.com>,
	UNGLinuxDriver@microchip.com, Andrew Lunn <andrew@lunn.ch>,
	Vivien Didelot <vivien.didelot@gmail.com>,
	Florian Fainelli <f.fainelli@gmail.com>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Russell King <linux@armlinux.org.uk>
Subject: Re: [Patch RFC net-next 2/4] net: dsa: microchip: lan937x: remove vlan_filtering_is_global flag
Date: Tue, 2 Aug 2022 13:40:32 +0300	[thread overview]
Message-ID: <20220802104032.7g7jgn6t3xq6tcu5@skbuf> (raw)
In-Reply-To: <20220729151733.6032-3-arun.ramadoss@microchip.com> <20220729151733.6032-3-arun.ramadoss@microchip.com>

On Fri, Jul 29, 2022 at 08:47:31PM +0530, Arun Ramadoss wrote:
> To have the similar implementation among the ksz switches, removed the
> vlan_filtering_is_global flag which is only present in the lan937x.
> 
> Signed-off-by: Arun Ramadoss <arun.ramadoss@microchip.com>
> ---
>  drivers/net/dsa/microchip/lan937x_main.c | 5 -----
>  1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/net/dsa/microchip/lan937x_main.c b/drivers/net/dsa/microchip/lan937x_main.c
> index daedd2bf20c1..9c1fe38efd1a 100644
> --- a/drivers/net/dsa/microchip/lan937x_main.c
> +++ b/drivers/net/dsa/microchip/lan937x_main.c
> @@ -401,11 +401,6 @@ int lan937x_setup(struct dsa_switch *ds)
>  		return ret;
>  	}
>  
> -	/* The VLAN aware is a global setting. Mixed vlan
> -	 * filterings are not supported.
> -	 */
> -	ds->vlan_filtering_is_global = true;
> -

You understand what this flag does, right? It ensures that if you have
lan0 and lan1 under VLAN-aware br0, then lan2 which is standalone will
declare NETIF_F_HW_VLAN_CTAG_FILTER. In turn, this makes the network
stack know that lan2 won't accept VLAN-tagged packets unless there is an
8021q interface with the given VID on top of it. This 8021q interface
calls vlan_vid_add() to populate the driver's VLAN RX filter with its
VID, and this gets translated into dsa_slave_vlan_rx_add_vid() which
ultimately reaches the driver's ->port_vlan_add() function.

If VLAN filtering *is* a global setting, and looking at this call from
ksz9477_port_vlan_filtering() which is not per port, I'd say it is:

		ksz_cfg(dev, REG_SW_LUE_CTRL_0, SW_VLAN_ENABLE, true);

then what would happen is that all VLAN tagged traffic would be dropped
on the standalone lan2.

I'd say that the ksz9477 is buggy for not declaring vlan_filtering_is_global,
rather than encouraging you to delete it from lan937x. In turn, fixing
ksz9477 would make setting this flag from a common location possible,
because ksz8 needs it too.

  reply	other threads:[~2022-08-02 10:40 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 15:17 [Patch RFC net-next 0/4] net: dsa: microchip: vlan configuration for bridge_vlan_unaware ports Arun Ramadoss
2022-07-29 15:17 ` [Patch RFC net-next 1/4] net: dsa: microchip: modify vlan_add function prototype Arun Ramadoss
2022-08-02 10:32   ` Vladimir Oltean
2022-08-02 13:58     ` Arun.Ramadoss
2022-07-29 15:17 ` [Patch RFC net-next 2/4] net: dsa: microchip: lan937x: remove vlan_filtering_is_global flag Arun Ramadoss
2022-08-02 10:40   ` Vladimir Oltean [this message]
2022-08-02 16:09     ` Arun.Ramadoss
2022-08-03 11:07       ` Vladimir Oltean
2022-07-29 15:17 ` [Patch RFC net-next 3/4] net: dsa: microchip: common ksz pvid get and set function Arun Ramadoss
2022-08-02 10:45   ` Vladimir Oltean
2022-08-04  2:05   ` Florian Fainelli
2022-07-29 15:17 ` [Patch RFC net-next 4/4] net: dsa: microchip: use private pvid for bridge_vlan_unwaware Arun Ramadoss
2022-08-02 10:59   ` Vladimir Oltean
2022-08-02 14:40     ` Arun.Ramadoss
2022-08-03 14:49       ` 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=20220802104032.7g7jgn6t3xq6tcu5@skbuf \
    --to=olteanv@gmail.com \
    --cc=UNGLinuxDriver@microchip.com \
    --cc=andrew@lunn.ch \
    --cc=arun.ramadoss@microchip.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=f.fainelli@gmail.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@armlinux.org.uk \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=vivien.didelot@gmail.com \
    --cc=woojung.huh@microchip.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