diff options
author | Vladimir Oltean <vladimir.oltean@nxp.com> | 2022-09-11 04:06:58 +0300 |
---|---|---|
committer | Paolo Abeni <pabeni@redhat.com> | 2022-09-20 11:32:35 +0300 |
commit | 8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62 (patch) | |
tree | aecbbc43186c32448a714c01d7965422ea7b529a /net/dsa/dsa_priv.h | |
parent | db01868bf2e919a10551066d54cf4bef5dd5a01e (diff) | |
download | linux-8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62.tar.xz |
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>
Diffstat (limited to 'net/dsa/dsa_priv.h')
-rw-r--r-- | net/dsa/dsa_priv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/dsa/dsa_priv.h b/net/dsa/dsa_priv.h index 614fbba8fe39..c48c5c8ba790 100644 --- a/net/dsa/dsa_priv.h +++ b/net/dsa/dsa_priv.h @@ -322,7 +322,7 @@ dsa_slave_to_master(const struct net_device *dev) { struct dsa_port *dp = dsa_slave_to_port(dev); - return dp->cpu_dp->master; + return dsa_port_to_master(dp); } /* If under a bridge with vlan_filtering=0, make sure to send pvid-tagged |