]> git.baikalelectronics.ru Git - kernel.git/commit
net: dsa: introduce dsa_port_get_master()
authorVladimir Oltean <vladimir.oltean@nxp.com>
Sun, 11 Sep 2022 01:06:58 +0000 (04:06 +0300)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 20 Sep 2022 08:32:35 +0000 (10:32 +0200)
commit76c82f94876a2414d755f2a5904610c7e00f40f6
treeaecbbc43186c32448a714c01d7965422ea7b529a
parentc78666e78d2848ff28e24f26e2faeb5b41409a43
net: dsa: introduce dsa_port_get_master()

There is a desire to support for DSA masters in a LAG.

That configuration is intended to work by simply enslaving the master to
a bonding/team device. But the physical DSA master (the LAG slave) still
has a dev->dsa_ptr, and that cpu_dp still corresponds to the physical
CPU port.

However, we would like to be able to retrieve the LAG that's the upper
of the physical DSA master. In preparation for that, introduce a helper
called dsa_port_get_master() that replaces all occurrences of the
dp->cpu_dp->master pattern. The distinction between LAG and non-LAG will
be made later within the helper itself.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/dsa/bcm_sf2.c
drivers/net/dsa/bcm_sf2_cfp.c
drivers/net/dsa/lan9303-core.c
drivers/net/ethernet/mediatek/mtk_ppe_offload.c
include/net/dsa.h
net/dsa/dsa2.c
net/dsa/dsa_priv.h
net/dsa/port.c
net/dsa/slave.c
net/dsa/tag_8021q.c