Re: [PATCH net-next 3/9] net: dsa: allow the DSA master to be seen and changed through rtnetlink

Jakub Kicinski
2022-09-01T03:50:31Z

On Tue, 30 Aug 2022 22:59:26 +0300 Vladimir Oltean wrote:
> 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.

net/dsa/port.c: In function ‘dsa_port_change_master’:
net/dsa/port.c:1414:13: warning: unused variable ‘port’ [-Wunused-variable]
1414 | int port = dp->index;
| ^~~~

I presume you had a look around what side effects setting rtnl_link_ops
will have? Should .netns_refund be true?