Skip to content

net: dsa: mv88e6xxx: avoid some redundant VTU operations

Vivien Didelot lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5net: dsa: mv88e6xxx: lock mutex in vlan_preparedrivers/net/dsa/mv88e6xxx/chip.c+6 -120 replies
2/5net: dsa: mv88e6xxx: explicit entry passed to vtu_getnextdrivers/net/dsa/mv88e6xxx/chip.c+12 -90 replies
3/5net: dsa: mv88e6xxx: call vtu_getnext directly in db load/purgedrivers/net/dsa/mv88e6xxx/chip.c+22 -90 replies
4/5net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_deldrivers/net/dsa/mv88e6xxx/chip.c+15 -60 replies
5/5net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_adddrivers/net/dsa/mv88e6xxx/chip.c+44 -490 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH net-next 0/5] net: dsa: mv88e6xxx: avoid some redundant VTU operations

The mv88e6xxx driver currently uses a mv88e6xxx_vtu_get wrapper to get a single entry and uses a boolean to eventually initialize a fresh one.

However the fresh entry is only needed in one place and mv88e6xxx_vtu_getnext is simple enough to call it directly. Doing so makes the code easier to read, especially for the return code expected by switchdev to honor software VLANs.

In addition to not loading the VTU again when an entry is already correctly programmed, this also allows to avoid programming the broadcast entries again when updating a port's membership, from e.g. tagged to untagged.

This patch series removes the mv88e6xxx_vtu_get wrapper in favor of direct calls to mv88e6xxx_vtu_getnext, and also renames the _mv88e6xxx_port_vlan_add and _mv88e6xxx_port_vlan_del helpers using an old underscore prefix convention.

In case the port's membership is already correctly programmed in hardware, the following debug message may be printed:

    [  745.989884] mv88e6085 2188000.ethernet-1:00: p4: already a member of VLAN 42

Vivien Didelot (5):
net: dsa: mv88e6xxx: lock mutex in vlan_prepare
net: dsa: mv88e6xxx: explicit entry passed to vtu_getnext
net: dsa: mv88e6xxx: call vtu_getnext directly in db load/purge
net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_del
net: dsa: mv88e6xxx: call vtu_getnext directly in vlan_add

 drivers/net/dsa/mv88e6xxx/chip.c | 182 +++++++++++++++++--------------
 1 file changed, 98 insertions(+), 84 deletions(-)
Signature · 1 line
2.22.0