aboutsummaryrefslogtreecommitdiffstats
path: root/net/dsa/dsa.c
diff options
context:
space:
mode:
authorVivien Didelot <vivien.didelot@savoirfairelinux.com>2017-09-29 17:19:20 -0400
committerDavid S. Miller <davem@davemloft.net>2017-09-30 23:15:07 -0400
commit2f657a600409f1961d67642fe384a9d4be71d36a (patch)
treeff755adac80edd80aa72ab7323e15dd77ee03ebc /net/dsa/dsa.c
parent3e41f93b358a8800194b87995ad076fc50919719 (diff)
net: dsa: change dsa_ptr for a dsa_port
With DSA, a master net device (CPU facing interface) has a dsa_ptr pointer to which hangs a dsa_switch_tree. This is not correct because a master interface is wired to a dedicated switch port, and because we can theoretically have several master interfaces pointing to several CPU ports of the same switch fabric. Change the master interface's dsa_ptr for the CPU dsa_port pointer. This is a step towards supporting multiple CPU ports. Signed-off-by: Vivien Didelot <vivien.didelot@savoirfairelinux.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa/dsa.c')
-rw-r--r--net/dsa/dsa.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 81c852e32821..51ca2a524a27 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -160,12 +160,12 @@ EXPORT_SYMBOL_GPL(dsa_dev_to_net_device);
160static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev, 160static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
161 struct packet_type *pt, struct net_device *unused) 161 struct packet_type *pt, struct net_device *unused)
162{ 162{
163 struct dsa_switch_tree *dst = dev->dsa_ptr; 163 struct dsa_port *cpu_dp = dev->dsa_ptr;
164 struct sk_buff *nskb = NULL; 164 struct sk_buff *nskb = NULL;
165 struct pcpu_sw_netstats *s; 165 struct pcpu_sw_netstats *s;
166 struct dsa_slave_priv *p; 166 struct dsa_slave_priv *p;
167 167
168 if (unlikely(dst == NULL)) { 168 if (unlikely(!cpu_dp)) {
169 kfree_skb(skb); 169 kfree_skb(skb);
170 return 0; 170 return 0;
171 } 171 }
@@ -174,7 +174,7 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
174 if (!skb) 174 if (!skb)
175 return 0; 175 return 0;
176 176
177 nskb = dst->rcv(skb, dev, pt); 177 nskb = cpu_dp->rcv(skb, dev, pt);
178 if (!nskb) { 178 if (!nskb) {
179 kfree_skb(skb); 179 kfree_skb(skb);
180 return 0; 180 return 0;