summaryrefslogtreecommitdiffstats
path: root/net/dsa
diff options
context:
space:
mode:
authorFlorian Fainelli <f.fainelli@gmail.com>2020-10-01 19:42:12 -0700
committerDavid S. Miller <davem@davemloft.net>2020-10-02 13:36:07 -0700
commit1dc0408cdf3caf3a8b8ad97c831ae52d2ab5b953 (patch)
treee643ac1120c682b4b27a44741146735b78a1fe4b /net/dsa
parentc16bcd70a11b52d20877aa4e0b59285690a1b268 (diff)
downloadlinux-stable-1dc0408cdf3caf3a8b8ad97c831ae52d2ab5b953.tar.gz
linux-stable-1dc0408cdf3caf3a8b8ad97c831ae52d2ab5b953.tar.bz2
linux-stable-1dc0408cdf3caf3a8b8ad97c831ae52d2ab5b953.zip
net: dsa: Call dsa_untag_bridge_pvid() from dsa_switch_rcv()
When a DSA switch driver needs to call dsa_untag_bridge_pvid(), it can set dsa_switch::untag_brige_pvid to indicate this is necessary. This is a pre-requisite to making sure that we are always calling dsa_untag_bridge_pvid() after eth_type_trans() has been called. Signed-off-by: Florian Fainelli <f.fainelli@gmail.com> Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/dsa')
-rw-r--r--net/dsa/dsa.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/net/dsa/dsa.c b/net/dsa/dsa.c
index 5c18c0214aac..dec4ab59b7c4 100644
--- a/net/dsa/dsa.c
+++ b/net/dsa/dsa.c
@@ -225,6 +225,15 @@ static int dsa_switch_rcv(struct sk_buff *skb, struct net_device *dev,
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, skb->dev);
+ if (unlikely(cpu_dp->ds->untag_bridge_pvid)) {
+ nskb = dsa_untag_bridge_pvid(skb);
+ if (!nskb) {
+ kfree_skb(skb);
+ return 0;
+ }
+ skb = nskb;
+ }
+
s = this_cpu_ptr(p->stats64);
u64_stats_update_begin(&s->syncp);
s->rx_packets++;