Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: dsa: Rename IFLA_DSA_MASTER to IFLA_DSA_CONDUIT

This preserves the existing IFLA_DSA_MASTER which is part of the uAPI
and creates an alias named IFLA_DSA_CONDUIT.

Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://lore.kernel.org/r/20231023181729.1191071-3-florian.fainelli@broadcom.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Florian Fainelli and committed by
Jakub Kicinski
87cd8371 6ca80638

+10 -8
+2 -2
Documentation/networking/dsa/configuration.rst
··· 393 393 configure the system for the switch to use other conduits. 394 394 395 395 DSA uses the ``rtnl_link_ops`` mechanism (with a "dsa" ``kind``) to allow 396 - changing the DSA conduit of a user port. The ``IFLA_DSA_MASTER`` u32 netlink 396 + changing the DSA conduit of a user port. The ``IFLA_DSA_CONDUIT`` u32 netlink 397 397 attribute contains the ifindex of the conduit device that handles each user 398 398 device. The DSA conduit must be a valid candidate based on firmware node 399 399 information, or a LAG interface which contains only slaves which are valid ··· 435 435 dsa master bond0 436 436 437 437 Notice that in the case of CPU ports under a LAG, the use of the 438 - ``IFLA_DSA_MASTER`` netlink attribute is not strictly needed, but rather, DSA 438 + ``IFLA_DSA_CONDUIT`` netlink attribute is not strictly needed, but rather, DSA 439 439 reacts to the ``IFLA_MASTER`` attribute change of its present conduit (``eth0``) 440 440 and migrates all user ports to the new upper of ``eth0``, ``bond0``. Similarly, 441 441 when ``bond0`` is destroyed using ``RTM_DELLINK``, DSA migrates the user ports
+3 -1
include/uapi/linux/if_link.h
··· 1394 1394 1395 1395 enum { 1396 1396 IFLA_DSA_UNSPEC, 1397 - IFLA_DSA_MASTER, 1397 + IFLA_DSA_CONDUIT, 1398 + /* Deprecated, use IFLA_DSA_CONDUIT instead */ 1399 + IFLA_DSA_MASTER = IFLA_DSA_CONDUIT, 1398 1400 __IFLA_DSA_MAX, 1399 1401 }; 1400 1402
+5 -5
net/dsa/netlink.c
··· 8 8 #include "user.h" 9 9 10 10 static const struct nla_policy dsa_policy[IFLA_DSA_MAX + 1] = { 11 - [IFLA_DSA_MASTER] = { .type = NLA_U32 }, 11 + [IFLA_DSA_CONDUIT] = { .type = NLA_U32 }, 12 12 }; 13 13 14 14 static int dsa_changelink(struct net_device *dev, struct nlattr *tb[], ··· 20 20 if (!data) 21 21 return 0; 22 22 23 - if (data[IFLA_DSA_MASTER]) { 24 - u32 ifindex = nla_get_u32(data[IFLA_DSA_MASTER]); 23 + if (data[IFLA_DSA_CONDUIT]) { 24 + u32 ifindex = nla_get_u32(data[IFLA_DSA_CONDUIT]); 25 25 struct net_device *conduit; 26 26 27 27 conduit = __dev_get_by_index(dev_net(dev), ifindex); ··· 38 38 39 39 static size_t dsa_get_size(const struct net_device *dev) 40 40 { 41 - return nla_total_size(sizeof(u32)) + /* IFLA_DSA_MASTER */ 41 + return nla_total_size(sizeof(u32)) + /* IFLA_DSA_CONDUIT */ 42 42 0; 43 43 } 44 44 ··· 46 46 { 47 47 struct net_device *conduit = dsa_user_to_conduit(dev); 48 48 49 - if (nla_put_u32(skb, IFLA_DSA_MASTER, conduit->ifindex)) 49 + if (nla_put_u32(skb, IFLA_DSA_CONDUIT, conduit->ifindex)) 50 50 return -EMSGSIZE; 51 51 52 52 return 0;