net: dsa: add ports list in the switch fabric
authorVivien Didelot <vivien.didelot@gmail.com>
Mon, 21 Oct 2019 20:51:16 +0000 (16:51 -0400)
committerJakub Kicinski <jakub.kicinski@netronome.com>
Tue, 22 Oct 2019 19:37:06 +0000 (12:37 -0700)
commitab8ccae122a41530a89bc899ace0e46defb156a8
tree97b5fd19733e1a432bb31e0fbb37603783b86813
parent68bb8ea8ad0d497c28ed47423246b1ab20f26976
net: dsa: add ports list in the switch fabric

Add a list of switch ports within the switch fabric. This will help the
lookup of a port inside the whole fabric, and it is the first step
towards supporting multiple CPU ports, before deprecating the usage of
the unique dst->cpu_dp pointer.

In preparation for a future allocation of the dsa_port structures,
return -ENOMEM in case no structure is returned, even though this
error cannot be reached yet.

Signed-off-by: Vivien Didelot <vivien.didelot@gmail.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
include/net/dsa.h
net/dsa/dsa2.c