[dpdk-stable] patch 'ethdev: fix device info getting' has been queued to stable release 18.08.1

Kevin Traynor ktraynor at redhat.com
Thu Nov 29 14:20:26 CET 2018


Hi,

FYI, your patch has been queued to stable release 18.08.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 12/08/18. 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. If the code is different (ie: not only metadata diffs), due for example to
a change in context or macro names, please double check it.

Thanks.

Kevin Traynor

---
>From 9cd64ef01b250f08db274fd9f28bad5e5f4f6d9c Mon Sep 17 00:00:00 2001
From: Wenzhuo Lu <wenzhuo.lu at intel.com>
Date: Tue, 13 Nov 2018 11:12:37 +0000
Subject: [PATCH] ethdev: fix device info getting

[ upstream commit 1a411a6fdbf18574153eb91bc9cc8b63025a2050 ]

The device information cannot be gotten correctly before
the configuration is set. Because on some NICs the
information has dependence on the configuration.

Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters")

Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
Reviewed-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 lib/librte_ethdev/rte_ethdev.c | 35 +++++++++++++++++++---------------
 1 file changed, 20 insertions(+), 15 deletions(-)

diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
index 85e80b313..196b27c95 100644
--- a/lib/librte_ethdev/rte_ethdev.c
+++ b/lib/librte_ethdev/rte_ethdev.c
@@ -1032,4 +1032,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);
 
+	if (dev->data->dev_started) {
+		RTE_ETHDEV_LOG(ERR,
+			"Port %u must be stopped to allow configuration\n",
+			port_id);
+		return -EBUSY;
+	}
+
+	 /* Store original config, as rollback required on failure */
+	memcpy(&orig_conf, &dev->data->dev_conf, sizeof(dev->data->dev_conf));
+
+	/*
+	 * Copy the dev_conf parameter into the dev structure.
+	 * rte_eth_dev_info_get() requires dev_conf, copy it before dev_info get
+	 */
+	memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf));
+
 	rte_eth_dev_info_get(port_id, &dev_info);
 
@@ -1053,5 +1069,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 			"Number of RX queues requested (%u) is greater than max supported(%d)\n",
 			nb_rx_q, RTE_MAX_QUEUES_PER_PORT);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto rollback;
 	}
 
@@ -1060,20 +1077,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
 			"Number of TX queues requested (%u) is greater than max supported(%d)\n",
 			nb_tx_q, RTE_MAX_QUEUES_PER_PORT);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto rollback;
 	}
 
-	if (dev->data->dev_started) {
-		RTE_ETHDEV_LOG(ERR,
-			"Port %u must be stopped to allow configuration\n",
-			port_id);
-		return -EBUSY;
-	}
-
-	 /* Store original config, as rollback required on failure */
-	memcpy(&orig_conf, &dev->data->dev_conf, sizeof(dev->data->dev_conf));
-
-	/* Copy the dev_conf parameter into the dev structure */
-	memcpy(&dev->data->dev_conf, &local_conf, sizeof(dev->data->dev_conf));
-
 	/*
 	 * Check that the numbers of RX and TX queues are not greater
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2018-11-29 13:11:35.687043120 +0000
+++ 0025-ethdev-fix-device-info-getting.patch	2018-11-29 13:11:34.000000000 +0000
@@ -1,14 +1,15 @@
-From 1a411a6fdbf18574153eb91bc9cc8b63025a2050 Mon Sep 17 00:00:00 2001
+From 9cd64ef01b250f08db274fd9f28bad5e5f4f6d9c Mon Sep 17 00:00:00 2001
 From: Wenzhuo Lu <wenzhuo.lu at intel.com>
 Date: Tue, 13 Nov 2018 11:12:37 +0000
 Subject: [PATCH] ethdev: fix device info getting
 
+[ upstream commit 1a411a6fdbf18574153eb91bc9cc8b63025a2050 ]
+
 The device information cannot be gotten correctly before
 the configuration is set. Because on some NICs the
 information has dependence on the configuration.
 
 Fixes: 3be82f5cc5e3 ("ethdev: support PMD-tuned Tx/Rx parameters")
-Cc: stable at dpdk.org
 
 Signed-off-by: Wenzhuo Lu <wenzhuo.lu at intel.com>
 Signed-off-by: Ferruh Yigit <ferruh.yigit at intel.com>
@@ -18,10 +19,10 @@
  1 file changed, 20 insertions(+), 15 deletions(-)
 
 diff --git a/lib/librte_ethdev/rte_ethdev.c b/lib/librte_ethdev/rte_ethdev.c
-index 04dff1f5e..0f01138ea 100644
+index 85e80b313..196b27c95 100644
 --- a/lib/librte_ethdev/rte_ethdev.c
 +++ b/lib/librte_ethdev/rte_ethdev.c
-@@ -1105,4 +1105,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
+@@ -1032,4 +1032,20 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  	RTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->dev_configure, -ENOTSUP);
  
 +	if (dev->data->dev_started) {
@@ -42,7 +43,7 @@
 +
  	rte_eth_dev_info_get(port_id, &dev_info);
  
-@@ -1126,5 +1142,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
+@@ -1053,5 +1069,6 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  			"Number of RX queues requested (%u) is greater than max supported(%d)\n",
  			nb_rx_q, RTE_MAX_QUEUES_PER_PORT);
 -		return -EINVAL;
@@ -50,7 +51,7 @@
 +		goto rollback;
  	}
  
-@@ -1133,20 +1150,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
+@@ -1060,20 +1077,8 @@ rte_eth_dev_configure(uint16_t port_id, uint16_t nb_rx_q, uint16_t nb_tx_q,
  			"Number of TX queues requested (%u) is greater than max supported(%d)\n",
  			nb_tx_q, RTE_MAX_QUEUES_PER_PORT);
 -		return -EINVAL;


More information about the stable mailing list