[dpdk-stable] patch 'ethdev: limit maximum number of queues' has been queued to LTS release 18.11.6

Kevin Traynor ktraynor at redhat.com
Wed Dec 11 22:26:58 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.11.6

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

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable-queue/commit/1d985701169f7e22307996d48598abfdb79927f0

Thanks.

Kevin.

---
>From 1d985701169f7e22307996d48598abfdb79927f0 Mon Sep 17 00:00:00 2001
From: Thomas Monjalon <thomas at monjalon.net>
Date: Wed, 27 Nov 2019 13:22:56 +0100
Subject: [PATCH] ethdev: limit maximum number of queues

[ upstream commit 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 ]

A buffer overflow happens in testpmd with some drivers
since the queue arrays are limited to RTE_MAX_QUEUES_PER_PORT.

The advertised capabilities of mlx4, mlx5 and softnic
for the number of queues were the maximum number: UINT16_MAX.
They must be limited by the configured RTE_MAX_QUEUES_PER_PORT
that applications expect to be respected.

The limitation is applied at ethdev level (function rte_eth_dev_info_get),
in order to force the configured limit for all drivers.

Fixes: 14b53e27b30e ("ethdev: fix crash with multiprocess")

Reported-by: Raslan Darawsheh <rasland at mellanox.com>
Signed-off-by: Thomas Monjalon <thomas at monjalon.net>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
Reviewed-by: David Marchand <david.marchand at redhat.com>
---
 lib/librte_ethdev/rte_ethdev.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 16e6a5d38..a5df3e562 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -2535,4 +2535,11 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
+
+	/* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */
+	dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues,
+			RTE_MAX_QUEUES_PER_PORT);
+	dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues,
+			RTE_MAX_QUEUES_PER_PORT);
+
 	dev_info->driver_name = dev->device->driver->name;
 	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
-- 
2.21.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-11 21:24:17.842739129 +0000
+++ 0066-ethdev-limit-maximum-number-of-queues.patch	2019-12-11 21:24:12.754649420 +0000
@@ -1 +1 @@
-From 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 Mon Sep 17 00:00:00 2001
+From 1d985701169f7e22307996d48598abfdb79927f0 Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 ]
+
@@ -18 +19,0 @@
-Cc: stable at dpdk.org
@@ -25,2 +26,2 @@
- lib/librte_ethdev/rte_ethdev.c | 6 ++++++
- 1 file changed, 6 insertions(+)
+ lib/librte_ethdev/rte_ethdev.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
@@ -29 +30 @@
-index 8d2ce31a8..6e9cb243e 100644
+index 16e6a5d38..a5df3e562 100644
@@ -32,3 +33,4 @@
-@@ -2987,4 +2987,10 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
- 	}
- 
+@@ -2535,4 +2535,11 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
+ 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
+ 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
++



More information about the stable mailing list