Skip to content

net: dsa: explicit programmation of VLAN on CPU ports

Vivien Didelot netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest6 patches 2 repliesIn review
  2. v16 patches 11 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6net: dsa: remove bitmap operationsinclude/net/dsa.h net/dsa/dsa2.c net/dsa/switch.c+59 -900 replies
2/6net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_addnet/dsa/port.c net/dsa/slave.c+7 -40 replies
3/6net: dsa: add slave VLAN helpersnet/dsa/slave.c+33 -70 replies
4/6net: dsa: check bridge VLAN in slave operationsnet/dsa/port.c net/dsa/slave.c+14 -80 replies
5/6net: dsa: program VLAN on CPU port from slavenet/dsa/slave.c net/dsa/switch.c+18 -10 replies
6/6net: dsa: clear VLAN PVID flag for CPU portnet/dsa/slave.c+6 -00 replies

Reviews trailers per patch

None of the 6 patches has a Reviewed-by or Acked-by.

PatchVladimir Oltean
SeriesT-b
1/6
2/6
3/6
4/6
5/6
6/6

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

Read the v2 thread

Cover letter [PATCH net-next v2 0/6] net: dsa: explicit programmation of VLAN on CPU ports

When a VLAN is programmed on a user port, every switch of the fabric also program the CPU ports and the DSA links as part of the VLAN. To do that, DSA makes use of bitmaps to prepare all members of a VLAN.

While this is expected for DSA links which are used as conduit between interconnected switches, only the dedicated CPU port of the slave must be programmed, not all CPU ports of the fabric. This may also cause problems in other corners of DSA such as the tag_8021q.c driver, which needs to program its ports manually, CPU port included.

We need the dsa_port_vlan_{add,del} functions and its dsa_port_vid_{add,del} variants to simply trigger the VLAN programmation without any logic in them, but they may currently skip the operation based on the bridge device state.

This patchset gets rid of the bitmap operations, and moves the bridge device check as well as the explicit programmation of CPU ports where they belong, in the slave code.

While at it, clear the VLAN flags before programming a CPU port, as it doesn't make sense to forward the PVID flag for example for such ports.

Changes in v2: only clear the PVID flag.

Vivien Didelot (6):
net: dsa: remove bitmap operations
net: dsa: do not skip -EOPNOTSUPP in dsa_port_vid_add
net: dsa: add slave VLAN helpers
net: dsa: check bridge VLAN in slave operations
net: dsa: program VLAN on CPU port from slave
net: dsa: clear VLAN PVID flag for CPU port

 include/net/dsa.h |   3 --
 net/dsa/dsa2.c    |  14 -----
 net/dsa/port.c    |  14 ++---
 net/dsa/slave.c   |  79 +++++++++++++++++++++++----
 net/dsa/switch.c  | 135 +++++++++++++++++++++-------------------------
 5 files changed, 136 insertions(+), 109 deletions(-)
Signature · 1 line
2.23.0