netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vivien Didelot <vivien.didelot@savoirfairelinux.com>
To: Scott Feldman <sfeldma@gmail.com>,
	"David S . Miller" <davem@davemloft.net>
Cc: netdev <netdev@vger.kernel.org>,
	"Guenter Roeck" <linux@roeck-us.net>,
	"Florian Fainelli" <f.fainelli@gmail.com>,
	"Andrew Lunn" <andrew@lunn.ch>,
	"Jérome Oufella" <jerome.oufella@savoirfairelinux.com>,
	"Chris Healy" <cphealy@gmail.com>,
	"Jiri Pirko" <jiri@resnulli.us>
Subject: Re: [RFC 0/3] DSA and Marvell 88E6352 802.1q support
Date: Mon, 1 Jun 2015 20:18:43 -0400 (EDT)	[thread overview]
Message-ID: <429136619.719334.1433204323286.JavaMail.zimbra@savoirfairelinux.com> (raw)
In-Reply-To: <CAE4R7bA43Jg5e+DSySvG4X2ka0CXEk9K6eVv5fdN37EcLBoF_A@mail.gmail.com>


On May 29, 2015, at 1:02 AM, Scott Feldman sfeldma@gmail.com wrote:
> On Thu, May 28, 2015 at 2:37 PM, Vivien Didelot <vivien.didelot@savoirfairelinux.com> 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.

Scott,

In fact I have to define these ndo, otherwise I get the "Buggy VLAN
acceleration in driver!" warning from net/core/dev.c and the switch
ports won't register.

I'm actually defining a noop function for them in dsa_slave_netdev_ops.

Is it correct to set NETIF_F_HW_VLAN_CTAG_FILTER in slave_dev->features?

> The setlink/dellink callbacks will give the same info (and more, e.g.
> pvid, untagged flags) and you'll automatically get support for stacked
> drivers, for example if you bonded swp2/3 and then included that bond
> in your vlan bridge.  Your commands will be slightly modified: when
> adding the vid to the port, specify master and self:
> 
> bridge vlan add vid 400 dev swp4 master self

Thanks it works! Now the switch VLAN database is consistent with the
bridge commands, I'm sending a complete RFC very soon.

Scott, David,

I use this mail to expose a potential problem between iproute2 and the
kernel, found with my previous code. When issuing "ip link set dev swp0
master br0", ndo_vlan_rx_add_vid is called, but not ndo_bridge_setlink,
which results in an inconsistency between my switch VLAN database (and
port settings) and "bridge vlan", which shows "swp0   1 PVID Egress
Untagged".

Seems like there is a call to ndo_bridge_setlink to add somewhere, but I
have no clue where.

In the meantime, I call "bridge vlan add vid 1 dev swp0 pvid untagged
[master self]" at boot, to be consistent with the bridge output.

Thanks,
-v

  parent reply	other threads:[~2015-06-02  0:18 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-26 22:29 DSA and underlying 802.1Q encapsulation Vivien Didelot
2015-05-26 22:51 ` Guenter Roeck
2015-05-27 20:48   ` Vivien Didelot
2015-05-27 21:02     ` Guenter Roeck
2015-05-27 21:05       ` Andrew Lunn
2015-05-27 22:51         ` Guenter Roeck
2015-05-28  1:46           ` Andrew Lunn
2015-05-28  5:01             ` Guenter Roeck
2015-05-28 13:44       ` Vivien Didelot
2015-05-28 14:19         ` Guenter Roeck
2015-05-28 21:37           ` [RFC 0/3] DSA and Marvell 88E6352 802.1q support Vivien Didelot
2015-05-28 21:37             ` [RFC 1/3] net: dsa: add basic support for VLAN ndo Vivien Didelot
2015-05-29  4:46               ` Scott Feldman
2015-05-29 15:24               ` Or Gerlitz
2015-05-29 15:38                 ` Vivien Didelot
2015-05-29 15:51                   ` Or Gerlitz
2015-05-29 22:15                     ` Guenter Roeck
2015-05-29 22:57                       ` Vivien Didelot
2015-05-31 16:14                         ` Scott Feldman
2015-05-28 21:37             ` [RFC 2/3] net: dsa: mv88e6xxx: add support for VTU operations Vivien Didelot
2015-05-29 22:38               ` Guenter Roeck
2015-05-28 21:37             ` [RFC 3/3] net: dsa: mv88e6352: add support for VLAN Vivien Didelot
2015-05-29  5:02             ` [RFC 0/3] DSA and Marvell 88E6352 802.1q support Scott Feldman
2015-05-29 15:40               ` Vivien Didelot
2015-05-29 22:42               ` Guenter Roeck
2015-05-31 16:48                 ` Scott Feldman
2015-05-31 17:06                   ` Guenter Roeck
2015-05-31 21:21                     ` Scott Feldman
2015-06-02  0:14                       ` Florian Fainelli
2015-06-02  0:18               ` Vivien Didelot [this message]
2015-06-02  6:18                 ` Scott Feldman
2015-06-02 23:23                   ` Vivien Didelot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=429136619.719334.1433204323286.JavaMail.zimbra@savoirfairelinux.com \
    --to=vivien.didelot@savoirfairelinux.com \
    --cc=andrew@lunn.ch \
    --cc=cphealy@gmail.com \
    --cc=davem@davemloft.net \
    --cc=f.fainelli@gmail.com \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=jiri@resnulli.us \
    --cc=linux@roeck-us.net \
    --cc=netdev@vger.kernel.org \
    --cc=sfeldma@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).