Skip to content

Improvements to DSA core VLAN manipulation

Vladimir Oltean netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13net: dsa: Fix pharse -> phase typonet/dsa/switch.c+1 -10 replies
2/13net: dsa: Store vlan_filtering as a property of dsa_portinclude/net/dsa.h net/dsa/port.c+9 -40 replies
3/13net: dsa: Be aware of switches where VLAN filtering is a global settinginclude/net/dsa.h net/dsa/port.c+50 -70 replies
4/13net: dsa: b53: Let DSA handle mismatched VLAN filtering settingsdrivers/net/dsa/b53/b53_common.c+7 -180 replies
5/13net: dsa: Unset vlan_filtering when ports leave the bridgenet/dsa/switch.c+29 -00 replies
6/13net: dsa: mt7530: Let DSA handle the unsetting of vlan_filteringdrivers/net/dsa/mt7530.c+2 -20 replies
7/13net: dsa: Keep the vlan_filtering setting in dsa_switch if it's globalinclude/net/dsa.h net/dsa/port.c+9 -10 replies
8/13net: dsa: Add helper function to retrieve VLAN awareness settinginclude/net/dsa.h+10 -01 reply
9/13net: dsa: mt7530: Use the DSA vlan_filtering helper functiondrivers/net/dsa/mt7530.c drivers/net/dsa/mt7530.h+5 -120 replies
10/13net: dsa: Skip calling .port_vlan_filtering on no changenet/dsa/port.c+3 -01 reply
11/13net: dsa: b53: Let DSA call .port_vlan_filtering only when necessarydrivers/net/dsa/b53/b53_common.c+2 -21 reply
12/13net: dsa: b53: Use vlan_filtering property from dsa_switchdrivers/net/dsa/b53/b53_common.c drivers/net/dsa/b53/b53_priv.h+2 -41 reply
13/13net: dsa: Add more convenient functions for installing port VLANsnet/dsa/dsa_priv.h net/dsa/port.c net/dsa/slave.c+36 -210 replies

Reviews trailers per patch

12 of 13 patches have a Reviewed-by or Acked-by.

PatchAndrew LunnFlorian Fainelli
1/13R-b R-b
2/13R-b
3/13R-b
4/13R-b
5/13R-b R-b
6/13R-b R-b
7/13
8/13R-b
9/13R-b R-b
10/13R-b
11/13R-b
12/13R-b
13/13R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH net-next 00/13] Improvements to DSA core VLAN manipulation

In preparation of submitting the NXP SJA1105 driver, the Broadcom b53 and Mediatek mt7530 drivers have been found to apply some VLAN workarounds that are needed in the new driver as well.

Therefore this patchset is mostly simply promoting the DSA driver workarounds for VLAN to the generic code.

The b53 driver was applying a few workarounds in order to convince DSA that its vlan_filtering setting is not really per-port. This is now simply set by the driver via a DSA variable at probe time. The sja1105 driver will be a second user of this.

The mt7530 was also keeping track of when the .port_vlan_filtering callback was being called. Remove the kept state from this driver and simplify dealing with vlan_filtering in the generic case.

TODO:

Find the best way to deal generically with the situation described below (discussion at https://lkml.org/lkml/2019/4/16/1355):

Quoted 5 lines
Quoted 5 lines
(quoted diff) +5 -0
+Segregating the switch ports in multiple bridges is supported (e.g. 2 + 2), but
+all bridges should have the same level of VLAN awareness (either both have
+``vlan_filtering`` 0, or both 1). Also an inevitable limitation of the fact
+that VLAN awareness is global at the switch level is that once a bridge with
+``vlan_filtering`` enslaves at least one switch port, the other un-bridged
Quoted 8 lines
Quoted 1 line

+ports are no longer available for standalone traffic termination.

That is quite a limitation that I don't think I had fully grasped until reading your different patches. Since enslaving ports into a bridge comes after the network device was already made available for use, maybe you should force the carrier down or something along those lines as soon as a port is enslaved into a bridge with vlan_filtering=1 to make this more predictable for the user?

Vladimir Oltean (13):
net: dsa: Fix pharse -> phase typo
net: dsa: Store vlan_filtering as a property of dsa_port
net: dsa: Be aware of switches where VLAN filtering is a global
setting
net: dsa: b53: Let DSA handle mismatched VLAN filtering settings
net: dsa: Unset vlan_filtering when ports leave the bridge
net: dsa: mt7530: Let DSA handle the unsetting of vlan_filtering
net: dsa: Keep the vlan_filtering setting in dsa_switch if it's global
net: dsa: Add helper function to retrieve VLAN awareness setting
net: dsa: mt7530: Use the DSA vlan_filtering helper function
net: dsa: Skip calling .port_vlan_filtering on no change
net: dsa: b53: Let DSA call .port_vlan_filtering only when necessary
net: dsa: b53: Use vlan_filtering property from dsa_switch
net: dsa: Add more convenient functions for installing port VLANs

 drivers/net/dsa/b53/b53_common.c | 34 +++++--------
 drivers/net/dsa/b53/b53_priv.h   |  1 -
 drivers/net/dsa/mt7530.c         | 20 +++-----
 drivers/net/dsa/mt7530.h         |  1 -
 include/net/dsa.h                | 21 ++++++++
 net/dsa/dsa_priv.h               |  2 +
 net/dsa/port.c                   | 85 ++++++++++++++++++++++++++++++--
 net/dsa/slave.c                  | 24 ++-------
 net/dsa/switch.c                 | 31 +++++++++++-
 9 files changed, 156 insertions(+), 63 deletions(-)
Signature · 1 line
2.17.1