summaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_8021q.c
diff options
context:
space:
mode:
authorVladimir Oltean <vladimir.oltean@nxp.com>2022-09-11 04:06:58 +0300
committerPaolo Abeni <pabeni@redhat.com>2022-09-20 10:32:35 +0200
commit8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62 (patch)
treeaecbbc43186c32448a714c01d7965422ea7b529a /net/dsa/tag_8021q.c
parentdb01868bf2e919a10551066d54cf4bef5dd5a01e (diff)
downloadlinux-8f6a19c0316deb48cdfdc5335de9a6d7db5b7b62.tar.bz2
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/tag_8021q.c')
-rw-r--r--net/dsa/tag_8021q.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/dsa/tag_8021q.c b/net/dsa/tag_8021q.c
index b5f80bc45ceb..34e5ec5d3e23 100644
--- a/net/dsa/tag_8021q.c
+++ b/net/dsa/tag_8021q.c
@@ -330,7 +330,7 @@ static int dsa_tag_8021q_port_setup(struct dsa_switch *ds, int port)
if (!dsa_port_is_user(dp))
return 0;
- master = dp->cpu_dp->master;
+ master = dsa_port_to_master(dp);
err = dsa_port_tag_8021q_vlan_add(dp, vid, false);
if (err) {
@@ -359,7 +359,7 @@ static void dsa_tag_8021q_port_teardown(struct dsa_switch *ds, int port)
if (!dsa_port_is_user(dp))
return;
- master = dp->cpu_dp->master;
+ master = dsa_port_to_master(dp);
dsa_port_tag_8021q_vlan_del(dp, vid, false);