Skip to content

Commit

Permalink
net/mlx5: Fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'
Browse files Browse the repository at this point in the history
All the error handling paths of 'mlx5e_tc_add_fdb_flow()' end to 'err_out'
where 'flow_flag_set(flow, FAILED);' is called.

All but the new error handling paths added by the commits given in the
Fixes tag below.

Fix these error handling paths and branch to 'err_out'.

Fixes: 166f431 ("net/mlx5e: Add indirect tc offload of ovs internal port")
Fixes: b16eb3c ("net/mlx5: Support internal port as decap route device")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Roi Dayan <roid@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
(cherry picked from commit 31108d1)
  • Loading branch information
Christophe JAILLET authored and Saeed Mahameed committed Dec 23, 2021
1 parent 2820110 commit 4390c6e
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions drivers/net/ethernet/mellanox/mlx5/core/en_tc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
MLX5_FLOW_NAMESPACE_FDB, VPORT_TO_REG,
metadata);
if (err)
return err;
goto err_out;
}
}

Expand All @@ -1456,22 +1456,26 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
if (attr->chain) {
NL_SET_ERR_MSG_MOD(extack,
"Internal port rule is only supported on chain 0");
return -EOPNOTSUPP;
err = -EOPNOTSUPP;
goto err_out;
}

if (attr->dest_chain) {
NL_SET_ERR_MSG_MOD(extack,
"Internal port rule offload doesn't support goto action");
return -EOPNOTSUPP;
err = -EOPNOTSUPP;
goto err_out;
}

int_port = mlx5e_tc_int_port_get(mlx5e_get_int_port_priv(priv),
parse_attr->filter_dev->ifindex,
flow_flag_test(flow, EGRESS) ?
MLX5E_TC_INT_PORT_EGRESS :
MLX5E_TC_INT_PORT_INGRESS);
if (IS_ERR(int_port))
return PTR_ERR(int_port);
if (IS_ERR(int_port)) {
err = PTR_ERR(int_port);
goto err_out;
}

esw_attr->int_port = int_port;
}
Expand Down

0 comments on commit 4390c6e

Please sign in to comment.