[dpdk-dev] net/mlx5: fix all multi verification code position

Message ID b49e5b4abb9f3f31925d3ab82f5c5f5fbdfe10c0.1515662674.git.nelio.laranjeiro@6wind.com (mailing list archive)
State Accepted, archived
Delegated to: Ferruh Yigit
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Nélio Laranjeiro Jan. 11, 2018, 9:25 a.m. UTC
  All multi code should not be handled in exit part of the code but in the
mainline of the function.

Fixes: 4241d84c0a32 ("net/mlx5: fix flow type for allmulti rules")
Cc: rasland@mellanox.com

Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
  

Comments

Yongseok Koh Jan. 17, 2018, 11:02 p.m. UTC | #1
> On Jan 11, 2018, at 1:25 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com> wrote:
> 
> All multi code should not be handled in exit part of the code but in the
> mainline of the function.
> 
> Fixes: 4241d84c0a32 ("net/mlx5: fix flow type for allmulti rules")
> Cc: rasland@mellanox.com
> 
> Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> ---
Acked-by: Yongseok Koh <yskoh@mellanox.com>
 
Thanks
  
Shahaf Shuler Jan. 22, 2018, 11:40 a.m. UTC | #2
Thursday, January 18, 2018 1:03 AM, Yongseok Koh:
> > On Jan 11, 2018, at 1:25 AM, Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> wrote:
> >
> > All multi code should not be handled in exit part of the code but in
> > the mainline of the function.
> >
> > Fixes: 4241d84c0a32 ("net/mlx5: fix flow type for allmulti rules")
> > Cc: rasland@mellanox.com
> >
> > Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
> > ---
> Acked-by: Yongseok Koh <yskoh@mellanox.com>

Applied to next-net-mlx, thanks. 

> 
> Thanks
  

Patch

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 334a4f4ba..f050ea713 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -1156,16 +1156,6 @@  priv_flow_convert(struct priv *priv,
 			attr->priority +
 			hash_rxq_init[parser->layer].flow_priority;
 	}
-exit_free:
-	/* Only verification is expected, all resources should be released. */
-	if (!parser->create) {
-		for (i = 0; i != hash_rxq_init_n; ++i) {
-			if (parser->queue[i].ibv_attr) {
-				rte_free(parser->queue[i].ibv_attr);
-				parser->queue[i].ibv_attr = NULL;
-			}
-		}
-	}
 	if (parser->allmulti &&
 	    parser->layer == HASH_RXQ_ETH) {
 		for (i = 0; i != hash_rxq_init_n; ++i) {
@@ -1177,6 +1167,16 @@  priv_flow_convert(struct priv *priv,
 						IBV_FLOW_ATTR_MC_DEFAULT;
 		}
 	}
+exit_free:
+	/* Only verification is expected, all resources should be released. */
+	if (!parser->create) {
+		for (i = 0; i != hash_rxq_init_n; ++i) {
+			if (parser->queue[i].ibv_attr) {
+				rte_free(parser->queue[i].ibv_attr);
+				parser->queue[i].ibv_attr = NULL;
+			}
+		}
+	}
 	return ret;
 exit_enomem:
 	for (i = 0; i != hash_rxq_init_n; ++i) {