]> git.baikalelectronics.ru Git - kernel.git/commitdiff
net/mlx5: Fix some error handling paths in 'mlx5e_tc_add_fdb_flow()'
authorChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Sat, 6 Nov 2021 17:08:11 +0000 (18:08 +0100)
committerSaeed Mahameed <saeedm@nvidia.com>
Thu, 23 Dec 2021 04:38:49 +0000 (20:38 -0800)
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: dc7f6661d5d5 ("net/mlx5e: Add indirect tc offload of ovs internal port")
Fixes: e94cae3b4c31 ("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 31108d142f3632970f6f3e0224bd1c6781c9f87d)

drivers/net/ethernet/mellanox/mlx5/core/en_tc.c

index f633448c3cc7ed9f2aaa8896a319bae9310c9440..a60c7680fd2b7365f76fd1d45302c3a8d0bac7c1 100644 (file)
@@ -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;
                }
        }
 
@@ -1456,13 +1456,15 @@ 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),
@@ -1470,8 +1472,10 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv,
                                                 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;
        }