net: dsa: allow the DSA master to be seen and changed through rtnetlink
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 11 Sep 2022 01:06:59 +0000 (04:06 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 20 Sep 2022 08:32:35 +0000 (10:32 +0200)
commit95f510d0b792f308d3d748242fe960c35bdc2c62
tree83df40a0b45f905a61e582d0ca7bbbcb62035705
parent8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62
net: dsa: allow the DSA master to be seen and changed through rtnetlink

Some DSA switches have multiple CPU ports, which can be used to improve
CPU termination throughput, but DSA, through dsa_tree_setup_cpu_ports(),
sets up only the first one, leading to suboptimal use of hardware.

The desire is to not change the default configuration but to permit the
user to create a dynamic mapping between individual user ports and the
CPU port that they are served by, configurable through rtnetlink. It is
also intended to permit load balancing between CPU ports, and in that
case, the foreseen model is for the DSA master to be a bonding interface
whose lowers are the physical DSA masters.

To that end, we create a struct rtnl_link_ops for DSA user ports with
the "dsa" kind. We expose the IFLA_DSA_MASTER link attribute that
contains the ifindex of the newly desired DSA master.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
include/net/dsa.h
include/uapi/linux/if_link.h
net/dsa/Makefile
net/dsa/dsa.c
net/dsa/dsa2.c
net/dsa/dsa_priv.h
net/dsa/netlink.c [new file with mode: 0644]
net/dsa/port.c
net/dsa/slave.c