]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net: dsa: tag_ocelot_8021q: fix broken reception
authorRobert Hodaszi <robert.hodaszi@digi.com>
Wed, 11 Dec 2024 14:47:41 +0000 (15:47 +0100)
committerJakub Kicinski <kuba@kernel.org>
Thu, 12 Dec 2024 15:10:27 +0000 (07:10 -0800)
The blamed commit changed the dsa_8021q_rcv() calling convention to
accept pre-populated source_port and switch_id arguments. If those are
not available, as in the case of tag_ocelot_8021q, the arguments must be
pre-initialized with -1.

Due to the bug of passing uninitialized arguments in tag_ocelot_8021q,
dsa_8021q_rcv() does not detect that it needs to populate the
source_port and switch_id, and this makes dsa_conduit_find_user() fail,
which leads to packet loss on reception.

Fixes: dcfe7673787b ("net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv()")
Signed-off-by: Robert Hodaszi <robert.hodaszi@digi.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20241211144741.1415758-1-robert.hodaszi@digi.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/dsa/tag_ocelot_8021q.c

index 8e8b1bef6af69d726cdf63f71dc7dfaaef238b30..11ea8cfd62661c13a2ebd4cab146924e89373a6f 100644 (file)
@@ -79,7 +79,7 @@ static struct sk_buff *ocelot_xmit(struct sk_buff *skb,
 static struct sk_buff *ocelot_rcv(struct sk_buff *skb,
                                  struct net_device *netdev)
 {
-       int src_port, switch_id;
+       int src_port = -1, switch_id = -1;
 
        dsa_8021q_rcv(skb, &src_port, &switch_id, NULL, NULL);