[dpdk-stable] patch 'net/mlx5: fix crash when setting hairpin queues' has been queued to stable release 19.11.1

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue Feb 11 12:19:43 CET 2020


Hi,

FYI, your patch has been queued to stable release 19.11.1

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 02/13/20. 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.

Thanks.

Luca Boccassi

---
>From 2f8346b61c7fcf0020d10679ca665a338c670f01 Mon Sep 17 00:00:00 2001
From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Date: Wed, 27 Nov 2019 22:18:41 +0800
Subject: [PATCH] net/mlx5: fix crash when setting hairpin queues

[ upstream commit bf864e820558a8b001d5de6be437456e82ac3c81 ]

If configuring the number of tx/rx queue with rte_eth_dev_configure
to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
hairpin queues via rte_eth_tx/rx_hairpin_queue_setup.

When starting the netdev, there is a crash because of NULL accessing.

Fixes: cf5516696d77 ("ethdev: add hairpin queue")

Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
Acked-by: Ori Kam <orika at mellanox.com>
---
 drivers/net/mlx5/mlx5_ethdev.c  | 2 +-
 drivers/net/mlx5/mlx5_trigger.c | 5 ++++-
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/net/mlx5/mlx5_ethdev.c b/drivers/net/mlx5/mlx5_ethdev.c
index d80ae458bc..3b4c5dbe7a 100644
--- a/drivers/net/mlx5/mlx5_ethdev.c
+++ b/drivers/net/mlx5/mlx5_ethdev.c
@@ -476,7 +476,7 @@ mlx5_dev_configure_rss_reta(struct rte_eth_dev *dev)
 
 		rxq_data = (*priv->rxqs)[i];
 		rxq_ctrl = container_of(rxq_data, struct mlx5_rxq_ctrl, rxq);
-		if (rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
+		if (rxq_ctrl && rxq_ctrl->type == MLX5_RXQ_TYPE_STANDARD)
 			rss_queue_arr[j++] = i;
 	}
 	rss_queue_n = j;
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index cafab25c67..ab6937ab10 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -106,9 +106,12 @@ mlx5_rxq_start(struct rte_eth_dev *dev)
 	unsigned int i;
 	int ret = 0;
 	enum mlx5_rxq_obj_type obj_type = MLX5_RXQ_OBJ_TYPE_IBV;
+	struct mlx5_rxq_data *rxq = NULL;
 
 	for (i = 0; i < priv->rxqs_n; ++i) {
-		if ((*priv->rxqs)[i]->lro) {
+		rxq = (*priv->rxqs)[i];
+
+		if (rxq && rxq->lro) {
 			obj_type =  MLX5_RXQ_OBJ_TYPE_DEVX_RQ;
 			break;
 		}
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-02-11 11:17:40.426093125 +0000
+++ 0037-net-mlx5-fix-crash-when-setting-hairpin-queues.patch	2020-02-11 11:17:38.372000824 +0000
@@ -1,8 +1,10 @@
-From bf864e820558a8b001d5de6be437456e82ac3c81 Mon Sep 17 00:00:00 2001
+From 2f8346b61c7fcf0020d10679ca665a338c670f01 Mon Sep 17 00:00:00 2001
 From: Tonghao Zhang <xiangxia.m.yue at gmail.com>
 Date: Wed, 27 Nov 2019 22:18:41 +0800
 Subject: [PATCH] net/mlx5: fix crash when setting hairpin queues
 
+[ upstream commit bf864e820558a8b001d5de6be437456e82ac3c81 ]
+
 If configuring the number of tx/rx queue with rte_eth_dev_configure
 to nr_queues + hairpin_nr_queues, and setting tx/rx queues to
 nr_queues with rte_eth_tx/rx_queue_setup. But not configuring the
@@ -11,7 +13,6 @@
 When starting the netdev, there is a crash because of NULL accessing.
 
 Fixes: cf5516696d77 ("ethdev: add hairpin queue")
-Cc: stable at dpdk.org
 
 Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com>
 Acked-by: Ori Kam <orika at mellanox.com>


More information about the stable mailing list