[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YVrxLvHqkyvdYIfb@lunn.ch>
Date: Mon, 4 Oct 2021 14:18:54 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Vladimir Oltean <vladimir.oltean@....com>
Cc: netdev <netdev@...r.kernel.org>,
Tobias Waldekranz <tobias@...dekranz.com>,
Florian Fainelli <f.fainelli@...il.com>
Subject: Re: [PATCH net] dsa: tag_dsa: Handle !CONFIG_BRIDGE_VLAN_FILTERING
case
On Sun, Oct 03, 2021 at 09:03:55PM +0000, Vladimir Oltean wrote:
> On Sun, Oct 03, 2021 at 05:51:41PM +0200, Andrew Lunn wrote:
> > If CONFIG_BRIDGE_VLAN_FILTERING is disabled, br_vlan_enabled() is
> > replaced with a stub which returns -EINVAL.
>
> br_vlan_enabled() returns bool, so it cannot hold -EINVAL. The stub for
> that returns false. We negate that false, make it true, and then call
> br_vlan_get_pvid_rcu() which returns -EINVAL because of _its_ stub
> implementation.
Yeh, i got the names of the functions wrong. I will fix that.
> In fact it is actually wrong to inject into the switch using the
> bridge's pvid, if VLAN awareness is turned off. We should be able to
> send and receive packets in that mode regardless of whether a pvid
> exists for the bridge device or not. That is also what we document in
> Documentation/networking/switchdev.rst.
>
> So if VLAN 0 does that trick, perfect, we should just delete the entire
> "if (!br_vlan_enabled(br))" block.
I will rework the patch and test it without the if.
Thanks
Andrew
Powered by blists - more mailing lists