From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ilias Apalodimas Subject: Re: [PATCH RFT] net: dsa: Allow configuring CPU port VLANs Date: Mon, 25 Jun 2018 12:17:13 +0300 Message-ID: <20180625091713.GA13442@apalos> References: <20180624153339.13572-1-f.fainelli@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Florian Fainelli , netdev@vger.kernel.org, jiri@mellanox.com, Andrew Lunn , Vivien Didelot , "David S. Miller" , open list To: Petr Machata Return-path: Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org On Mon, Jun 25, 2018 at 12:13:10PM +0300, Petr Machata wrote: > Florian Fainelli writes: > > > if (netif_is_bridge_master(vlan->obj.orig_dev)) > > - return -EOPNOTSUPP; > > + info.port = dp->cpu_dp->index; > > The condition above will trigger also when a VLAN is added on a member > port, and there's no other port with that VLAN. In that case the VLAN > comes without the BRIDGE_VLAN_INFO_BRENTRY flag. In mlxsw we have this > to get the bridge VLANs: > > if (netif_is_bridge_master(orig_dev)) { > [...] > if ((vlan->flags & BRIDGE_VLAN_INFO_BRENTRY) && > [...] > > This doesn't appear to be done in DSA unless I'm missing something. Petr's right. This will trigger for VLANs added on 'not cpu ports' if the VLAN is not already a member. This command has BRIDGE_VLAN_INFO_BRENTRY set: bridge vlan add dev br0 vid 100 pvid untagged self I had the same issue on my CPSW RFC and solved it exactly the same was as Petr suggested. > > Thanks, > Petr Regards Ilias