[dpdk-stable] patch 'net/mlx5: fix Rx/Tx queue checks' has been queued to stable release 19.11.10

christian.ehrhardt at canonical.com christian.ehrhardt at canonical.com
Tue Aug 10 17:39:56 CEST 2021


Hi,

FYI, your patch has been queued to stable release 19.11.10

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/12/21. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/cpaelzer/dpdk-stable-queue

This queued commit can be viewed at:
https://github.com/cpaelzer/dpdk-stable-queue/commit/a1b444b122c2784e383cd9df6880087a1e038095

Thanks.

Christian Ehrhardt <christian.ehrhardt at canonical.com>

---
>From a1b444b122c2784e383cd9df6880087a1e038095 Mon Sep 17 00:00:00 2001
From: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Date: Tue, 20 Jul 2021 10:53:35 +0300
Subject: [PATCH] net/mlx5: fix Rx/Tx queue checks

[ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ]

When device configuration was interrupted by a signal,
mlx5_rxq/txq_release() could access yet unitinialized array
and crash the application. Add checks whether queue array
is initialized.

Fixes: a1366b1a2be3 ("net/mlx5: add reference counter on DPDK Rx queues")
Fixes: 6e78005a9b30 ("net/mlx5: add reference counter on DPDK Tx queues")

Signed-off-by: Dmitry Kozlyuk <dkozlyuk at nvidia.com>
Acked-by: Matan Azrad <matan at nvidia.com>
---
 drivers/net/mlx5/mlx5_rxq.c | 2 +-
 drivers/net/mlx5/mlx5_txq.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index c0605637a7..aaa26a40d4 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -2074,7 +2074,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_rxq_ctrl *rxq_ctrl;
 
-	if (!(*priv->rxqs)[idx])
+	if (priv->rxqs == NULL || (*priv->rxqs)[idx] == NULL)
 		return 0;
 	rxq_ctrl = container_of((*priv->rxqs)[idx], struct mlx5_rxq_ctrl, rxq);
 	assert(rxq_ctrl->priv);
diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c
index 9c929a57ea..a63b362048 100644
--- a/drivers/net/mlx5/mlx5_txq.c
+++ b/drivers/net/mlx5/mlx5_txq.c
@@ -1410,7 +1410,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
 	struct mlx5_priv *priv = dev->data->dev_private;
 	struct mlx5_txq_ctrl *txq;
 
-	if (!(*priv->txqs)[idx])
+	if (priv->txqs == NULL || (*priv->txqs)[idx] == NULL)
 		return 0;
 	txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
 	if (txq->obj && !mlx5_txq_obj_release(txq->obj))
-- 
2.32.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2021-08-10 15:11:15.948402460 +0200
+++ 0076-net-mlx5-fix-Rx-Tx-queue-checks.patch	2021-08-10 15:11:13.082638562 +0200
@@ -1 +1 @@
-From 94e257ec8ca82a98e38ffb9e7c117a8aac554489 Mon Sep 17 00:00:00 2001
+From a1b444b122c2784e383cd9df6880087a1e038095 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 94e257ec8ca82a98e38ffb9e7c117a8aac554489 ]
+
@@ -13 +14,0 @@
-Cc: stable at dpdk.org
@@ -23 +24 @@
-index dacffc9251..4a8b67e731 100644
+index c0605637a7..aaa26a40d4 100644
@@ -26 +27 @@
-@@ -1712,7 +1712,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
+@@ -2074,7 +2074,7 @@ mlx5_rxq_release(struct rte_eth_dev *dev, uint16_t idx)
@@ -34 +35 @@
- 	if (__atomic_sub_fetch(&rxq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1)
+ 	assert(rxq_ctrl->priv);
@@ -36 +37 @@
-index f68c0c61a9..eb4d34ca55 100644
+index 9c929a57ea..a63b362048 100644
@@ -39 +40 @@
-@@ -1246,7 +1246,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
+@@ -1410,7 +1410,7 @@ mlx5_txq_release(struct rte_eth_dev *dev, uint16_t idx)
@@ -41 +42 @@
- 	struct mlx5_txq_ctrl *txq_ctrl;
+ 	struct mlx5_txq_ctrl *txq;
@@ -46,2 +47,2 @@
- 	txq_ctrl = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
- 	if (__atomic_sub_fetch(&txq_ctrl->refcnt, 1, __ATOMIC_RELAXED) > 1)
+ 	txq = container_of((*priv->txqs)[idx], struct mlx5_txq_ctrl, txq);
+ 	if (txq->obj && !mlx5_txq_obj_release(txq->obj))


More information about the stable mailing list