patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH 1/9] net/mlx5: fix drop queue creation error
       [not found] ` <cover.1488364873.git.nelio.laranjeiro@6wind.com>
@ 2017-03-01 12:37   ` Nelio Laranjeiro
  2017-03-01 12:37   ` [dpdk-stable] [PATCH 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-03-01 12:37 UTC (permalink / raw)
  Cc: Adrien Mazarguil, stable

Creating a drop queue in mlx5 ends by creating a non polled queue, but if
the associated work queue could not be created the error was not handled
ending in a undefined situation.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 23c1b5e..6765a77 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -902,6 +902,12 @@ priv_flow_create_action_queue(struct priv *priv,
 						 .pd = priv->pd,
 						 .cq = rte_flow->cq,
 						 });
+		if (!rte_flow->wq) {
+			rte_flow_error_set(error, ENOMEM,
+					   RTE_FLOW_ERROR_TYPE_HANDLE,
+					   NULL, "cannot allocate WQ");
+			goto error;
+		}
 	} else {
 		rxq = container_of((*priv->rxqs)[action->queue_id],
 				   struct rxq_ctrl, rxq);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH 2/9] net/mlx5: fix resources free in the right function
       [not found] ` <cover.1488364873.git.nelio.laranjeiro@6wind.com>
  2017-03-01 12:37   ` [dpdk-stable] [PATCH 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
@ 2017-03-01 12:37   ` Nelio Laranjeiro
  2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
  2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
  3 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-03-01 12:37 UTC (permalink / raw)
  Cc: Adrien Mazarguil, stable

ibv_attr should be freed in the function which allocates the memory.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

CC: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 6765a77..0712926 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -974,7 +974,6 @@ priv_flow_create_action_queue(struct priv *priv,
 		ibv_exp_destroy_wq(rte_flow->wq);
 	if (!rte_flow->rxq && rte_flow->cq)
 		ibv_destroy_cq(rte_flow->cq);
-	rte_free(rte_flow->ibv_attr);
 	rte_free(rte_flow);
 	return NULL;
 }
@@ -1068,6 +1067,8 @@ priv_flow_create(struct priv *priv,
 	}
 	rte_flow = priv_flow_create_action_queue(priv, flow.ibv_attr,
 						 &action, error);
+	if (!rte_flow)
+		goto exit;
 	return rte_flow;
 exit:
 	rte_free(flow.ibv_attr);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v2 1/9] net/mlx5: fix drop queue creation error
       [not found] ` <cover.1488364873.git.nelio.laranjeiro@6wind.com>
  2017-03-01 12:37   ` [dpdk-stable] [PATCH 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
  2017-03-01 12:37   ` [dpdk-stable] [PATCH 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
@ 2017-03-01 12:49   ` Nelio Laranjeiro
  2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
  3 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-03-01 12:49 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, stable

Creating a drop queue in mlx5 ends by creating a non polled queue, but if
the associated work queue could not be created the error was not handled
ending in a undefined situation.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

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

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 23c1b5e..6765a77 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -902,6 +902,12 @@ priv_flow_create_action_queue(struct priv *priv,
 						 .pd = priv->pd,
 						 .cq = rte_flow->cq,
 						 });
+		if (!rte_flow->wq) {
+			rte_flow_error_set(error, ENOMEM,
+					   RTE_FLOW_ERROR_TYPE_HANDLE,
+					   NULL, "cannot allocate WQ");
+			goto error;
+		}
 	} else {
 		rxq = container_of((*priv->rxqs)[action->queue_id],
 				   struct rxq_ctrl, rxq);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [dpdk-stable] [PATCH v2 2/9] net/mlx5: fix resources free in the right function
       [not found] ` <cover.1488364873.git.nelio.laranjeiro@6wind.com>
                     ` (2 preceding siblings ...)
  2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
@ 2017-03-01 12:49   ` Nelio Laranjeiro
  3 siblings, 0 replies; 4+ messages in thread
From: Nelio Laranjeiro @ 2017-03-01 12:49 UTC (permalink / raw)
  To: dev; +Cc: Adrien Mazarguil, stable

ibv_attr should be freed in the function which allocates the memory.

Fixes: 2097d0d1e2cc ("net/mlx5: support basic flow items and actions")

CC: stable@dpdk.org
Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com>
---
 drivers/net/mlx5/mlx5_flow.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index 6765a77..0712926 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -974,7 +974,6 @@ priv_flow_create_action_queue(struct priv *priv,
 		ibv_exp_destroy_wq(rte_flow->wq);
 	if (!rte_flow->rxq && rte_flow->cq)
 		ibv_destroy_cq(rte_flow->cq);
-	rte_free(rte_flow->ibv_attr);
 	rte_free(rte_flow);
 	return NULL;
 }
@@ -1068,6 +1067,8 @@ priv_flow_create(struct priv *priv,
 	}
 	rte_flow = priv_flow_create_action_queue(priv, flow.ibv_attr,
 						 &action, error);
+	if (!rte_flow)
+		goto exit;
 	return rte_flow;
 exit:
 	rte_free(flow.ibv_attr);
-- 
2.1.4

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-03-01 12:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <cover.1488372438.git.nelio.laranjeiro@6wind.com>
     [not found] ` <cover.1488364873.git.nelio.laranjeiro@6wind.com>
2017-03-01 12:37   ` [dpdk-stable] [PATCH 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
2017-03-01 12:37   ` [dpdk-stable] [PATCH 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro
2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 1/9] net/mlx5: fix drop queue creation error Nelio Laranjeiro
2017-03-01 12:49   ` [dpdk-stable] [PATCH v2 2/9] net/mlx5: fix resources free in the right function Nelio Laranjeiro

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).