Skip to contentSkip to conversation

net: dsa: xrs700x: check if partner is same as port in hsr join

PATCH Applied George McCollister 3 participants 3 messages Mar 8, 2021 – Mar 10, 2021

Subsystems (4)
lore
Share & tools
lore

George McCollister

author maintainer
#0 lore raw

PATCH 1/1 net: dsa: xrs700x: check if partner is same as port in hsr join

Don't assign dp to partner if it's the same port that xrs700x_hsr_join was called with. The partner port is supposed to be the other port in the HSR/PRP redundant pair not the same port. This fixes an issue observed in testing where forwarding between redundant HSR ports on this switch didn't work depending on the order the ports were added to the hsr device.

Fixes bd62e6f5e6a9 ("net: dsa: xrs700x: add HSR offloading support")
---
 drivers/net/dsa/xrs700x/xrs700x.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/net/dsa/xrs700x/xrs700x.c +8 -2
index f025f968f96d..fde6e99274b6 100644
@@ -528,7 +528,10 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port,
 		return -EOPNOTSUPP;
 
 	dsa_hsr_foreach_port(dp, ds, hsr) {
-		partner = dp;
+		if (dp->index != port) {
+			partner = dp;
+			break;
+		}
 	}
 
 	/* We can't enable redundancy on the switch until both
@@ -582,7 +585,10 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port,
 	unsigned int val;
 
 	dsa_hsr_foreach_port(dp, ds, hsr) {
-		partner = dp;
+		if (dp->index != port) {
+			partner = dp;
+			break;
+		}
 	}
 
 	if (!partner)
Signature · 1 line
2.11.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 10 lines · George McCollister

Don't assign dp to partner if it's the same port that xrs700x_hsr_join was called with. The partner port is supposed to be the other port in the HSR/PRP redundant pair not the same port. This fixes an issue observed in testing where forwarding between redundant HSR ports on this switch didn't work depending on the order the ports were added to the hsr device.

Fixes bd62e6f5e6a9 ("net: dsa: xrs700x: add HSR offloading support")

---

#2 lore raw
In reply to George McCollister
This patch was applied to netdev/net.git (refs/heads/master):

Hello:

This patch was applied to netdev/net.git (refs/heads/master):

Quoted 8 lines · On Mon, 8 Mar 2021 17:38:22 -0600 you wrote:

Don't assign dp to partner if it's the same port that xrs700x_hsr_join was called with. The partner port is supposed to be the other port in the HSR/PRP redundant pair not the same port. This fixes an issue observed in testing where forwarding between redundant HSR ports on this switch didn't work depending on the order the ports were added to the hsr device.

[...]

Here is the summary with links:
- [net] net: dsa: xrs700x: check if partner is same as port in hsr join

    https://git.kernel.org/netdev/net/c/286a8624d7f9

You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html