net/mlx5: fix drop action seg fault
PATCH 1/1 net/mlx5: fix drop action seg fault
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in rte_flow.
--- drivers/net/mlx5/mlx5_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_flow.c +5 -3
@@ -580,6 +580,8 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );
@@ -1011,9 +1013,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){
@@ -1023,6 +1022,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);
Signature · 1 line
1.8.3.1
Quoted 44 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/net/mlx5/mlx5_flow.c +5
-3@@ -580,6 +580,8 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );@@ -1011,9 +1013,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){@@ -1023,6 +1022,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);Signature · 1 line
1.8.3.1
Ferruh, this patch is fixing an issue of a patch only present in your master-net branch, the fixline sha1 will be wrong.
Thanks,
Signature · 2 lines
Nélio Laranjeiro 6WIND
Hi Nelio,
Quoted 6 lines · Nélio Laranjeiro
Quoted 5 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>
<...>
Quoted 7 lines
Quoted 2 lines
Signature · 1 line
1.8.3.1Acked-by Nelio Laranjeiro <[email protected]>Ferruh, this patch is fixing an issue of a patch only present in your master-net branch, the fixline sha1 will be wrong.
I can squash this into relevant patch (88c77dedfbb0).
But there is another patch [1] that cause conflict and seems fixing same commit (88c77dedfbb0) again.
What do you think squashing all three into one?
I can share latest patch if you want.
[1] net/mlx5: fix creation of drop flows
http://dpdk.org/browse/next/dpdk-next-net/commit/?id=e0e37c1f80a00a2acbb581649b3125a5d465f2c6
Quoted 3 lines
Thanks,
Quoted 14 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)drivers/net/mlx5/mlx5_flow.c +0
-0
drivers/net/mlx5/mlx5_flow.c struct mlx5_flow_action { · line 584
Quoted 5 lines
drivers/net/mlx5/mlx5_flow.c +2
-0@@ -580,6 +580,8 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );
Is using "struct ibv_exp_flow_spec_action_drop" here required HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP check?
Quoted 24 lines
drivers/net/mlx5/mlx5_flow.c +3
-3if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );@@ -1011,9 +1013,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){@@ -1023,6 +1022,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);
PATCH v2 1/1 fix drop action seg fault missing compilation flag
In reply to Shachar BeiserShachar Beiser (1):
net/mlx5: fix drop action seg fault
drivers/net/mlx5/mlx5_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/1 net/mlx5: fix drop action seg fault
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in rte_flow.
--- drivers/net/mlx5/mlx5_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_flow.c +7 -3
@@ -580,6 +580,10 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop ); +#endif if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );
@@ -1011,9 +1015,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){
@@ -1023,6 +1024,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);
Signature · 1 line
1.8.3.1
PATCH v2 1/1 Adding compilation flag for fix drop action seg fault
In reply to Shachar BeiserShachar Beiser (1):
net/mlx5: fix drop action seg fault
drivers/net/mlx5/mlx5_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
Signature · 1 line
1.8.3.1
PATCH v2 1/1 net/mlx5: fix drop action seg fault
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in rte_flow.
--- drivers/net/mlx5/mlx5_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/net/mlx5/mlx5_flow.c +7 -3
@@ -580,6 +580,10 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop ); +#endif if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );
@@ -1011,9 +1015,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){
@@ -1023,6 +1024,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);
Signature · 1 line
1.8.3.1
Quoted 46 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>--- drivers/net/mlx5/mlx5_flow.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)drivers/net/mlx5/mlx5_flow.c +7
-3@@ -580,6 +580,10 @@ struct mlx5_flow_action { }if (action->mark && !flow->ibv_attr && !action->drop) flow->offset +=sizeof (struct ibv_exp_flow_spec_action_tag ); +#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP +if (!flow->ibv_attr && action->drop) + flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop ); +#endif if (!action->queue && !action->drop) {rte_flow_error_set (error,ENOTSUP ,RTE_FLOW_ERROR_TYPE_HANDLE ,NULL ,"no valid action" );@@ -1011,9 +1015,6 @@ struct mlx5_flow_action {return NULL ; } rte_flow->drop =1 ; - rte_flow->ibv_attr = flow->ibv_attr; -if (!priv->started) -return rte_flow;#ifdef HAVE_VERBS_IBV_EXP_FLOW_SPEC_ACTION_DROP drop = (void *)((uintptr_t )flow->ibv_attr + flow->offset); *drop = (struct ibv_exp_flow_spec_action_drop){@@ -1023,6 +1024,9 @@ struct mlx5_flow_action { ++flow->ibv_attr->num_of_specs; flow->offset +=sizeof (struct ibv_exp_flow_spec_action_drop );#endif + rte_flow->ibv_attr = flow->ibv_attr; +if (!priv->started) +return rte_flow; rte_flow->qp = priv->flow_drop_queue->qp; rte_flow->ibv_flow =ibv_exp_create_flow (rte_flow->qp, rte_flow->ibv_attr);Signature · 1 line
1.8.3.1
Signature · 2 lines
Nélio Laranjeiro 6WIND
Quoted 8 lines · Nélio Laranjeiro
Quoted 5 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>Acked-by Nelio Laranjeiro <[email protected]>
Hi Nelio, Shachar,
What do you think squashing this and [1] into 88c77dedfbb0? Both this and [1] looks like fixing same commit.
[1]e0e37c1f80a0 ("net/mlx5: fix creation of drop flows")
Quoted 10 lines · Ferruh Yigit
Quoted 8 lines · Nélio Laranjeiro
Quoted 5 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>Acked-by Nelio Laranjeiro <[email protected]>
Quoted 7 lines
Hi Nelio, Shachar,
What do you think squashing this and [1] into
88c77dedfbb0? Both this and [1] looks like fixing same commit.[1]
e0e37c1f80a0("net/mlx5: fix creation of drop flows")
Hi Ferruh,
No it is not the same issue, one this new patch is fixing some code for the hardware drop flow support which will be available with next version of MLNX_OFED.
e0e37c1f80a0 ("net/mlx5: fix creation of drop flows") is fixing the current version of the software drop queue which is possible with the current MLNX_OFED GA.
Please keep them separate.
Thanks,
Signature · 2 lines
Nélio Laranjeiro 6WIND
Quoted 25 lines · Nélio Laranjeiro
Quoted 10 lines · Ferruh Yigit
Quoted 8 lines · Nélio Laranjeiro
Quoted 5 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>Acked-by Nelio Laranjeiro <[email protected]>Quoted 7 lines
Hi Nelio, Shachar,
What do you think squashing this and [1] into
88c77dedfbb0? Both this and [1] looks like fixing same commit.[1]
e0e37c1f80a0("net/mlx5: fix creation of drop flows")Hi Ferruh,
No it is not the same issue, one this new patch is fixing some code for the hardware drop flow support which will be available with next version of
MLNX_OFED.
Quoted 5 lines
e0e37c1f80a0("net/mlx5: fix creation of drop flows") is fixing the current version of the software drop queue which is possible with the currentMLNX_OFEDGA.Please keep them separate.
OK, thanks for clarification.
Quoted 3 lines
Thanks,
Quoted 7 lines · Nélio Laranjeiro
Quoted 5 lines · Shachar Beiser
Missing room in flow allocation to store the drop specification. Changing flow without storing the change in
rte_flow.Fixes 88c77dedfbb0 ("net/mlx5: implement drop action in hardware classifier")Signed-off-by Shachar Beiser <[email protected]>Acked-by Nelio Laranjeiro <[email protected]>
Squashed into relevant commit in next-net, thanks.