Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753437AbbFBNLW (ORCPT ); Tue, 2 Jun 2015 09:11:22 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:49977 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752607AbbFBNLO (ORCPT ); Tue, 2 Jun 2015 09:11:14 -0400 Date: Tue, 2 Jun 2015 15:05:45 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, "David S. Miller" , Guenter Roeck , Florian Fainelli , Scott Feldman , Jiri Pirko , Jerome Oufella , linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, Chris Healy Subject: Re: [RFC 3/9] net: dsa: mv88e6xxx: add support for VTU ops Message-ID: <20150602130545.GS22739@lunn.ch> References: <1433208470-25338-1-git-send-email-vivien.didelot@savoirfairelinux.com> <1433208470-25338-4-git-send-email-vivien.didelot@savoirfairelinux.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1433208470-25338-4-git-send-email-vivien.didelot@savoirfairelinux.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: 1094 Lines: 30 > +int mv88e6xxx_port_vlan_add(struct dsa_switch *ds, int port, u16 vid, > + u16 bridge_flags) > +{ > + struct mv88e6xxx_priv_state *ps = ds_to_priv(ds); > + struct mv88e6xxx_vtu_entry entry = { 0 }; > + int prev_vid = vid ? vid - 1 : 4095; > + int i, ret; > + > + /* Bringing an interface up adds it to the VLAN 0. Ignore this. */ > + if (!vid) > + return 0; > + > + /* The DSA port-based VLAN setup reserves FID 0 to DSA_MAX_PORTS; > + * we will use the next FIDs for 802.1q; > + * thus, forbid the last DSA_MAX_PORTS VLANs. > + */ > + if (vid > 4095 - DSA_MAX_PORTS) > + return -EINVAL; I'm not sure about this. I've setup systems where i've used VLANs from the top down to differentiate them from other VLANs going from the bottom up. We might want to dynamically assign FIDs to VLANs rather than have a static mapping. 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/