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

luca.boccassi at gmail.com luca.boccassi at gmail.com
Thu Dec 19 15:34:44 CET 2019


Hi,

FYI, your patch has been queued to LTS release 17.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 12/21/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.

Thanks.

Luca Boccassi

---
>From 12d3b2b57aaa9815147c7e26b352a70be2d834a9 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_ether/rte_ethdev.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
index d8595ab34a..f11670789d 100644
--- a/lib/librte_ether/rte_ethdev.c
+++ b/lib/librte_ether/rte_ethdev.c
@@ -2051,6 +2051,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
 	dev_info->rx_desc_lim = lim;
 	dev_info->tx_desc_lim = lim;
 
+	/* 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);
+
 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
 	dev_info->driver_name = dev->device->driver->name;
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-12-19 14:32:31.767630802 +0000
+++ 0137-ethdev-limit-maximum-number-of-queues.patch	2019-12-19 14:32:26.361302902 +0000
@@ -1,8 +1,10 @@
-From 20bbb9e0450f2ccda374584173dc0a5cd93c9f06 Mon Sep 17 00:00:00 2001
+From 12d3b2b57aaa9815147c7e26b352a70be2d834a9 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.
 
@@ -15,23 +17,22 @@
 in order to force the configured limit for all drivers.
 
 Fixes: 14b53e27b30e ("ethdev: fix crash with multiprocess")
-Cc: stable at dpdk.org
 
 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 | 6 ++++++
+ lib/librte_ether/rte_ethdev.c | 6 ++++++
  1 file changed, 6 insertions(+)
 
-diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
-index 8d2ce31a81..6e9cb243ea 100644
---- a/lib/librte_ethdev/rte_ethdev.c
-+++ b/lib/librte_ethdev/rte_ethdev.c
-@@ -2986,6 +2986,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
- 		return eth_err(port_id, diag);
- 	}
+diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c
+index d8595ab34a..f11670789d 100644
+--- a/lib/librte_ether/rte_ethdev.c
++++ b/lib/librte_ether/rte_ethdev.c
+@@ -2051,6 +2051,12 @@ rte_eth_dev_info_get(uint16_t port_id, struct rte_eth_dev_info *dev_info)
+ 	dev_info->rx_desc_lim = lim;
+ 	dev_info->tx_desc_lim = lim;
  
 +	/* Maximum number of queues should be <= RTE_MAX_QUEUES_PER_PORT */
 +	dev_info->max_rx_queues = RTE_MIN(dev_info->max_rx_queues,
@@ -39,9 +40,9 @@
 +	dev_info->max_tx_queues = RTE_MIN(dev_info->max_tx_queues,
 +			RTE_MAX_QUEUES_PER_PORT);
 +
+ 	RTE_FUNC_PTR_OR_RET(*dev->dev_ops->dev_infos_get);
+ 	(*dev->dev_ops->dev_infos_get)(dev, dev_info);
  	dev_info->driver_name = dev->device->driver->name;
- 	dev_info->nb_rx_queues = dev->data->nb_rx_queues;
- 	dev_info->nb_tx_queues = dev->data->nb_tx_queues;
 -- 
 2.20.1
 


More information about the stable mailing list