Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756277AbbKDXZS (ORCPT ); Wed, 4 Nov 2015 18:25:18 -0500 Received: from vps0.lunn.ch ([178.209.37.122]:44307 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750727AbbKDXZQ (ORCPT ); Wed, 4 Nov 2015 18:25:16 -0500 Date: Thu, 5 Nov 2015 00:25:13 +0100 From: Andrew Lunn To: Florian Fainelli Cc: Vivien Didelot , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" Subject: Re: [PATCH net] net: dsa: mv88e6xxx: isolate unbridged ports Message-ID: <20151104232513.GA8263@lunn.ch> References: <1446675820-25608-1-git-send-email-vivien.didelot@savoirfairelinux.com> <563A8A05.6020401@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <563A8A05.6020401@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1370 Lines: 37 > > +int mv88e6xxx_port_bridge_join(struct dsa_switch *ds, int port, u32 members) > > +{ > > + struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); > > + const u16 pvid = 4000 + ds->index * DSA_MAX_PORTS + port; > > + int err; > > + > > + /* The port joined a bridge, so leave its reserved VLAN */ > > + mutex_lock(&ps->smi_mutex); > > + err = _mv88e6xxx_port_vlan_del(ds, port, pvid); > > + if (!err) > > + err = _mv88e6xxx_port_pvid_set(ds, port, 0); > > Does that mean that the following happens: > > - bridge is created and port joins it > - port is configured to be in pvid 0 while joining > - port is then configured again by the bridge layer to be in whatever > pvid the user has decided > > The other question is, does that break isolation between multiple > bridges on the same switch? Should we use the bridge ifindex here > somehow as a pvid indication? Hi Florian The old code which got changed when VLAN support was added used some property from the bridge to handle multiple bridges. But that is probably a different bug to the one being fixed here. This is all about using ports individually. Andrew -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/