Skip to contentSkip to conversation

net: dsa: tag_ocelot_8021q: fix broken reception

PATCH In review Robert Hodaszi 1 participant 2 messages Dec 11, 2024

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: dsa: tag_ocelot_8021q: fix broken reception

Commit dcfe7673787b4bfea2c213df443d312aa754757b ("net: dsa: tag_sja1105:
absorb logic for not overwriting precise info into dsa_8021q_rcv()") added support to let the DSA switch driver set source_port and switch_id. tag_8021q's logic overrides the previously set source_port and switch_id only if they are marked as "invalid" (-1). sja1105 and vsc73xx drivers are doing that properly, but ocelot_8021q driver doesn't initialize those variables. That causes dsa_8021q_rcv() doesn't set them, and they remain unassigned.

Initialize them as invalid to so dsa_8021q_rcv() can return with the proper values.

Fixes dcfe7673787b ("net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv()")

---
Cc: [email protected]

---
 net/dsa/tag_ocelot_8021q.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/tag_ocelot_8021q.c +1 -1
index 8e8b1bef6af6..11ea8cfd6266 100644
@@ -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);
 
Signature · 1 line
2.43.0
#1 lore raw

2024. 12. 11. 15:28 keltezéssel, Robert Hodaszi írta:

Quoted 25 lines

Commit dcfe7673787b4bfea2c213df443d312aa754757b ("net: dsa: tag_sja1105:
absorb logic for not overwriting precise info into dsa_8021q_rcv()") added support to let the DSA switch driver set source_port and switch_id. tag_8021q's logic overrides the previously set source_port and switch_id only if they are marked as "invalid" (-1). sja1105 and vsc73xx drivers are doing that properly, but ocelot_8021q driver doesn't initialize those variables. That causes dsa_8021q_rcv() doesn't set them, and they remain unassigned.

Initialize them as invalid to so dsa_8021q_rcv() can return with the proper values.

Fixes dcfe7673787b ("net: dsa: tag_sja1105: absorb logic for not overwriting precise info into dsa_8021q_rcv()")

---
Cc: [email protected]

---
 net/dsa/tag_ocelot_8021q.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/dsa/tag_ocelot_8021q.c +0 -0
index 8e8b1bef6af6..11ea8cfd6266 100644

net/dsa/tag_ocelot_8021q.c static struct sk_buff *ocelot_xmit(struct sk_buff *skb, · line 85

Quoted 8 lines
net/dsa/tag_ocelot_8021q.c +1 -1
@@ -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);
 

Ahh, sorry, for spamming the stable list! This supposed to be a test mail only, but accidentally left the CC there... :( I'm just sending out the real one.

Robert