From mboxrd@z Thu Jan 1 00:00:00 1970 From: Guenter Roeck Subject: Re: [RFC 0/3] DSA and Marvell 88E6352 802.1q support Date: Sun, 31 May 2015 10:06:27 -0700 Message-ID: <556B3F93.5020701@roeck-us.net> References: <556723FF.7030606@roeck-us.net> <1432849035-8499-1-git-send-email-vivien.didelot@savoirfairelinux.com> <5568EB55.9090700@roeck-us.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Vivien Didelot , Netdev , Florian Fainelli , Andrew Lunn , Jerome Oufella , Chris Healy , Jiri Pirko To: Scott Feldman Return-path: Received: from bh-25.webhostbox.net ([208.91.199.152]:39564 "EHLO bh-25.webhostbox.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbbEaRGb (ORCPT ); Sun, 31 May 2015 13:06:31 -0400 In-Reply-To: Sender: netdev-owner@vger.kernel.org List-ID: On 05/31/2015 09:48 AM, Scott Feldman wrote: > On Fri, May 29, 2015 at 3:42 PM, Guenter Roeck wrote: >> Scott, >> >> >> On 05/28/2015 10:02 PM, Scott Feldman wrote: >>> >>> On Thu, May 28, 2015 at 2:37 PM, Vivien Didelot >>> wrote: >>>> >>>> This RFC is based on v4.1-rc3. >>>> >>>> It is meant to get a glance to the commits responsible to implement the >>>> necessary NDOs between DSA and the Marvell 88E6352 switch driver. >>>> >>>> With this support, I am able to create VLANs with (un)tagged ports, >>>> setting >>>> their default VID, from a bridge. >>>> >>>> To create a bridge containing all switch ports, with a VLAN ID 400, swp2 >>>> and >>>> swp3 untagged (pvid), and swp4 tagged, the userspace commands look like >>>> this: >>>> >>>> ip link add name br0 type bridge >>>> [...] >>>> ip link set dev swp2 up master br0 >>>> [...] >>>> bridge vlan add vid 400 pvid untagged dev swp2 >>>> bridge vlan add vid 400 pvid untagged dev swp3 >>>> bridge vlan add vid 400 dev swp4 >>>> [...] >>>> ip link add link br0 name br0.400 type vlan id 400 >>>> [...] >>>> bridge vlan add dev br0 vid 400 self >>>> >>>> The code is currently being rebased to the latest net-next/master. >>>> >>>> Seems like the way to go now is through switchdev attr getter/setter... >>> >>> >>> Indeed, for dsa_slave you should be able to port this to switchdev and >>> set your ndo_bridge_setlink/dellink handlers to >>> switchdev_port_bridge_setlink/dellink. (And also implement the >>> switchdev ops for vlans). >>> >>> If you use switchdev_port_bridge_setlink/dellink, you shouldn't need >>> to implement ndo_vlan_rx_add_vid/ndo_vlan_rx_kill_vid at all. The >> >> >> Those functions are called from net/8021q/vlan_core.c if a vlan is >> configured on or removed from an interface. Does that result in a call to >> setlink/dellink as well, even if a switch port is not a member of a bridge group ? > > No, not if you're using 8021q module for vlan setup on non-bridged > ports. If using 8021q module, you'll need to retain the ndo ops. > > The alternative to the ndo ops for non-bridged ports is to use the > bridge_setlink/dellink interface on self: > > bridge vlan add vid VID dev DEV self > > The would call into DEV port's bridge_setlink to add VID to port. The > driver would setup HW to ingress VID tagged frames and egress VID > tagged frames on DEV port. > Hi Scott, If I understand you correctly, that means we would expect users to use bridge commands even on non-bridged dsa ports. I don't think we can make this kind of assumption. Users will expect configure VLANs on non-bridge ports as they would normally configure VLANs, using the 8021q module. So I guess we'll have to support the ndo ops for dsa. Thanks, Guenter