Skip to content

Accomodate DSA front-end into Ocelot

Vladimir Oltean netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest15 patches 17 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15net: mscc: ocelot: break apart ocelot_vlan_port_applydrivers/net/ethernet/mscc/ocelot.c+100 -680 replies
2/15net: mscc: ocelot: break apart vlan operations into ocelot_vlan_{add,del}drivers/net/ethernet/mscc/ocelot.c+42 -180 replies
3/15net: mscc: ocelot: break out fdb operations into abstract implementationsdrivers/net/ethernet/mscc/ocelot.c+78 -460 replies
4/15net: mscc: ocelot: change prototypes of hwtstamping ioctlsdrivers/net/ethernet/mscc/ocelot.c+13 -120 replies
5/15net: mscc: ocelot: change prototypes of switchdev port attribute handlersdrivers/net/ethernet/mscc/ocelot.c+45 -430 replies
6/15net: mscc: ocelot: refactor struct ocelot_port out of function prototypesdrivers/net/ethernet/mscc/ocelot.c drivers/net/ethernet/mscc/ocelot_police.c drivers/net/ethernet/mscc/ocelot_police.h +1 more+59 -650 replies
7/15net: mscc: ocelot: separate net_device related items out of ocelot_portdrivers/net/ethernet/mscc/ocelot.c drivers/net/ethernet/mscc/ocelot.h drivers/net/ethernet/mscc/ocelot_ace.h +3 more+233 -1900 replies
8/15net: mscc: ocelot: refactor ethtool callbacksdrivers/net/ethernet/mscc/ocelot.c+47 -170 replies
9/15net: mscc: ocelot: limit vlan ingress filtering to actual number of portsdrivers/net/ethernet/mscc/ocelot.c+2 -12 replies
10/15net: mscc: ocelot: move port initialization into separate functiondrivers/net/ethernet/mscc/ocelot.c+24 -210 replies
11/15net: mscc: ocelot: separate the common implementation of ndo_open and ndo_stopdrivers/net/ethernet/mscc/ocelot.c+26 -100 replies
12/15net: mscc: ocelot: initialize list of multicast addresses in common codedrivers/net/ethernet/mscc/ocelot.c drivers/net/ethernet/mscc/ocelot_board.c+1 -10 replies
13/15net: mscc: ocelot: refactor adjust_link into a netdev-independent functiondrivers/net/ethernet/mscc/ocelot.c+17 -100 replies
14/15net: mscc: ocelot: split assignment of the cpu port into a separate functiondrivers/net/ethernet/mscc/ocelot.c drivers/net/ethernet/mscc/ocelot.h drivers/net/ethernet/mscc/ocelot_board.c+57 -223 replies
15/15net: mscc: ocelot: don't hardcode the number of the CPU portdrivers/net/ethernet/mscc/ocelot.c+7 -47 replies

Reviews trailers per patch

None of the 15 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAndrew LunnHoratiu Vultur
SeriesR-b A-b
1/15
2/15
3/15
4/15
5/15
6/15
7/15
8/15
9/15
10/15
11/15
12/15
13/15
14/15
15/15

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/15] Accomodate DSA front-end into Ocelot

After the nice "change-my-mind" discussion about Ocelot, Felix and LS1028A (which can be read here: https://lkml.org/lkml/2019/6/21/630),
we have decided to take the route of reworking the Ocelot implementation in a way that is DSA-compatible.

This is a large series, but hopefully is easy enough to digest, since it contains mostly code refactoring. What needs to be changed:
- The struct net_device, phy_device needs to be isolated from Ocelot private structures (struct ocelot, struct ocelot_port). These will live as 1-to-1 equivalents to struct dsa_switch and struct dsa_port.
- The function prototypes need to be compatible with DSA (of course, struct dsa_switch will become struct ocelot).
- The CPU port needs to be assigned via a higher-level API, not hardcoded in the driver.

What is going to be interesting is that the new DSA front-end of Ocelot will need to have features in lockstep with the DSA core itself. At the moment, some more advanced tc offloading features of Ocelot (tc-flower, etc) are not available in the DSA front-end due to lack of API in the DSA core. It also means that Ocelot practically re-implements large parts of DSA (although it is not a DSA switch per se) - see the FDB API for example.

The code has been only compile-tested on Ocelot, since I don't have access to any VSC7514 hardware. It was proven to work on NXP LS1028A, which instantiates a DSA derivative of Ocelot. So I would like to ask Alex Belloni if you could confirm this series causes no regression on the Ocelot MIPS SoC.

The goal is to get this rework upstream as quickly as possible, precisely because it is a large volume of code that risks gaining merge conflicts if we keep it for too long.

This is but the first chunk of the LS1028A Felix DSA driver upstreaming. For those who are interested, the concept can be seen on my private Github repo, the user of this reworked Ocelot driver living under drivers/net/dsa/vitesse/:
https://github.com/vladimiroltean/ls1028ardb-linux

Claudiu Manoil (1):
net: mscc: ocelot: initialize list of multicast addresses in common
code

Vladimir Oltean (14):
net: mscc: ocelot: break apart ocelot_vlan_port_apply
net: mscc: ocelot: break apart vlan operations into

    ocelot_vlan_{add,del}

net: mscc: ocelot: break out fdb operations into abstract
implementations
net: mscc: ocelot: change prototypes of hwtstamping ioctls
net: mscc: ocelot: change prototypes of switchdev port attribute
handlers
net: mscc: ocelot: refactor struct ocelot_port out of function
prototypes
net: mscc: ocelot: separate net_device related items out of
ocelot_port
net: mscc: ocelot: refactor ethtool callbacks
net: mscc: ocelot: limit vlan ingress filtering to actual number of
ports
net: mscc: ocelot: move port initialization into separate function
net: mscc: ocelot: separate the common implementation of ndo_open and
ndo_stop
net: mscc: ocelot: refactor adjust_link into a netdev-independent
function
net: mscc: ocelot: split assignment of the cpu port into a separate
function
net: mscc: ocelot: don't hardcode the number of the CPU port

 drivers/net/ethernet/mscc/ocelot.c        | 948 +++++++++++++---------
 drivers/net/ethernet/mscc/ocelot.h        |  33 +-
 drivers/net/ethernet/mscc/ocelot_ace.h    |   4 +-
 drivers/net/ethernet/mscc/ocelot_board.c  |  24 +-
 drivers/net/ethernet/mscc/ocelot_flower.c |  32 +-
 drivers/net/ethernet/mscc/ocelot_police.c |  36 +-
 drivers/net/ethernet/mscc/ocelot_police.h |   4 +-
 drivers/net/ethernet/mscc/ocelot_tc.c     |  56 +-
 8 files changed, 680 insertions(+), 457 deletions(-)
Signature · 1 line
2.17.1