aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/tag_trailer.c
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2017-06-13 13:27:22 -0700
committerDavid S. Miller <davem@davemloft.net>2017-06-13 16:35:03 -0400
commit3cc9f2573cdcbc6991aa2d1c8e04a4b9190487f8 (patch)
tree1f4d13a47187b7662ea5369ffe163deee2c79550 /net/dsa/tag_trailer.c
parentnet: dsa: Associate slave network device with CPU port (diff)
downloadlinux-dev-3cc9f2573cdcbc6991aa2d1c8e04a4b9190487f8.tar.xz
linux-dev-3cc9f2573cdcbc6991aa2d1c8e04a4b9190487f8.zip
net: dsa: Introduce dsa_get_cpu_port()
Introduce a helper function which will return a reference to the CPU port used in a dsa_switch_tree. Right now this is a singleton, but this will change once we introduce multi-CPU port support, so ease the transition by converting the affected code paths. Reviewed-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/tag_trailer.c')
-rw-r--r--net/dsa/tag_trailer.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/net/dsa/tag_trailer.c b/net/dsa/tag_trailer.c
index b4f6db094409..172f13167896 100644
--- a/net/dsa/tag_trailer.c
+++ b/net/dsa/tag_trailer.c
@@ -61,12 +61,11 @@ static struct sk_buff *trailer_rcv(struct sk_buff *skb, struct net_device *dev,
struct net_device *orig_dev)
{
struct dsa_switch_tree *dst = dev->dsa_ptr;
- struct dsa_switch *ds;
+ struct dsa_port *cpu_dp = dsa_get_cpu_port(dst);
+ struct dsa_switch *ds = cpu_dp->ds;
u8 *trailer;
int source_port;
- ds = dst->cpu_dp->ds;
-
if (skb_linearize(skb))
return NULL;