Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754702AbbHNBCi (ORCPT ); Thu, 13 Aug 2015 21:02:38 -0400 Received: from vps0.lunn.ch ([178.209.37.122]:59391 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbbHNBCh (ORCPT ); Thu, 13 Aug 2015 21:02:37 -0400 Date: Fri, 14 Aug 2015 02:55:23 +0200 From: Andrew Lunn To: Vivien Didelot Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kernel@savoirfairelinux.com, "David S. Miller" , Guenter Roeck , Florian Fainelli , Scott Feldman , Jiri Pirko , Chris Healy Subject: Re: [PATCH net-next 1/7] net: dsa: add support for switchdev VLAN objects Message-ID: <20150814005523.GA5596@lunn.ch> References: <1439484743-5126-1-git-send-email-vivien.didelot@savoirfairelinux.com> <1439484743-5126-2-git-send-email-vivien.didelot@savoirfairelinux.com> <20150813201608.GI32627@lunn.ch> <20150813210156.GA21039@ketchup.touchtunes.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150813210156.GA21039@ketchup.touchtunes.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: 2540 Lines: 61 On Thu, Aug 13, 2015 at 05:01:57PM -0400, Vivien Didelot wrote: > Hi Andrew, > > On 15-08-13 22:16:08, Andrew Lunn wrote: > > On Thu, Aug 13, 2015 at 12:52:17PM -0400, Vivien Didelot wrote: > > > Add new functions in DSA drivers to access hardware VLAN entries through > > > SWITCHDEV_OBJ_PORT_VLAN objects: > > > > > > - port_pvid_get() and vlan_getnext() to dump a VLAN > > > - port_vlan_del() to exclude a port from a VLAN > > > - port_pvid_set() and port_vlan_add() to join a port to a VLAN > > > > > > The DSA infrastructure will ensure that each VLAN of the given range > > > does not already belong to another bridge. If it does, it will fallback > > > to software VLAN and won't program the hardware. > > > > > > Signed-off-by: Vivien Didelot > > > --- > > > include/net/dsa.h | 11 ++++ > > > net/dsa/slave.c | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ > > > 2 files changed, 169 insertions(+) > > > > > > diff --git a/include/net/dsa.h b/include/net/dsa.h > > > index 6356f43..bd9b765 100644 > > > --- a/include/net/dsa.h > > > +++ b/include/net/dsa.h > > > @@ -298,6 +298,17 @@ struct dsa_switch_driver { > > > u8 state); > > > > > > /* > > > + * VLAN support > > > + */ > > > + int (*port_pvid_get)(struct dsa_switch *ds, int port, u16 *pvid); > > > + int (*port_pvid_set)(struct dsa_switch *ds, int port, u16 pvid); > > > + int (*port_vlan_add)(struct dsa_switch *ds, int port, u16 vid, > > > + bool untagged); > > > + int (*port_vlan_del)(struct dsa_switch *ds, int port, u16 vid); > > > @@ -794,6 +949,9 @@ static const struct net_device_ops dsa_slave_netdev_ops = { > > > .ndo_netpoll_cleanup = dsa_slave_netpoll_cleanup, > > > .ndo_poll_controller = dsa_slave_poll_controller, > > > #endif > > > + .ndo_bridge_getlink = switchdev_port_bridge_getlink, > > > + .ndo_bridge_setlink = switchdev_port_bridge_setlink, > > > + .ndo_bridge_dellink = switchdev_port_bridge_dellink, > > > }; > > > > Do these changes belong here? > > Yes, these are used by switchdev to access bridge requests and exchange > SWITCHDEV_OBJ_PORT_VLAN objects with DSA, through the its switchdev_ops. O.K, so if a v2 is needed, please mention this in the change log. It was not obvious to me. Thanks 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/