]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commit556d3e0e5e2ba6753fac5164d64814ad0ef7f269
tree83df40a0b45f905a61e582d0ca7bbbcb62035705
parentf50c0baf58bfa7a7c96e09686206a0e70959116a
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