Skip to content

Commit

Permalink
net: dsa: xrs700x: check if partner is same as port in hsr join
Browse files Browse the repository at this point in the history
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: bd62e6f ("net: dsa: xrs700x: add HSR offloading support")
Signed-off-by: George McCollister <[email protected]>
Reviewed-by: Vladimir Oltean <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
gmccollister authored and davem330 committed Mar 10, 2021
1 parent f7d9d48 commit 286a862
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions drivers/net/dsa/xrs700x/xrs700x.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 286a862

Please sign in to comment.