提交 286a8624 编写于 作者: G George McCollister 提交者: David S. Miller

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: bd62e6f5 ("net: dsa: xrs700x: add HSR offloading support")
Signed-off-by: NGeorge McCollister <george.mccollister@gmail.com>
Reviewed-by: NVladimir Oltean <olteanv@gmail.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 f7d9d485
...@@ -528,7 +528,10 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port, ...@@ -528,7 +528,10 @@ static int xrs700x_hsr_join(struct dsa_switch *ds, int port,
return -EOPNOTSUPP; return -EOPNOTSUPP;
dsa_hsr_foreach_port(dp, ds, hsr) { 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 /* 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, ...@@ -582,7 +585,10 @@ static int xrs700x_hsr_leave(struct dsa_switch *ds, int port,
unsigned int val; unsigned int val;
dsa_hsr_foreach_port(dp, ds, hsr) { dsa_hsr_foreach_port(dp, ds, hsr) {
partner = dp; if (dp->index != port) {
partner = dp;
break;
}
} }
if (!partner) if (!partner)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册