Skip to content

Commit bed59a8

Browse files
vladimirolteankuba-moo
authored andcommitted
net: dsa: avoid calling ds->ops->port_hsr_leave() when unoffloaded
This mirrors what we do in dsa_port_lag_leave() and dsa_port_bridge_leave(): when ds->ops->port_hsr_join() returns -EOPNOTSUPP, we fall back to a software implementation where dp->hsr_dev is NULL, and the unoffloaded port is no longer bothered with calls from the HSR layer. This helps, for example, with interlink ports which current DSA drivers don't know how to offload. We have to check only in port_hsr_join() for the port type, then in port_hsr_leave() we are sure we're dealing only with known port types. Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com> Link: https://patch.msgid.link/20251130131657.65080-4-vladimir.oltean@nxp.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
1 parent a0244e7 commit bed59a8

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

net/dsa/port.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1909,6 +1909,9 @@ void dsa_port_hsr_leave(struct dsa_port *dp, struct net_device *hsr)
19091909
struct dsa_switch *ds = dp->ds;
19101910
int err;
19111911

1912+
if (!dp->hsr_dev)
1913+
return;
1914+
19121915
dp->hsr_dev = NULL;
19131916

19141917
if (ds->ops->port_hsr_leave) {

0 commit comments

Comments
 (0)