[dpdk-stable] patch 'eventdev: fix eth Tx adapter queue count checks' has been queued to LTS release 18.11.1

Kevin Traynor ktraynor at redhat.com
Fri Jan 4 14:23:57 CET 2019


Hi,

FYI, your patch has been queued to LTS release 18.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 01/11/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.

Kevin Traynor

---
>From ca606f46af5c45e08c2492e87749ba2808347538 Mon Sep 17 00:00:00 2001
From: Nikhil Rao <nikhil.rao at intel.com>
Date: Mon, 17 Dec 2018 10:09:41 +0530
Subject: [PATCH] eventdev: fix eth Tx adapter queue count checks

[ upstream commit 5bd4ae2d774b5988a1b5ec084f27f859e91c655e ]

rte_event_eth_tx_adapter_queue_add() - add a check
that returns an error if the ethdev has zero Tx queues
configured.

rte_event_eth_tx_adapter_queue_del() - remove the
checks for ethdev queue count, instead check for
queues added to the adapter which maybe different
from the current ethdev queue count.

Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")

Signed-off-by: Nikhil Rao <nikhil.rao at intel.com>
---
 .../rte_event_eth_tx_adapter.c                | 54 +++++++++++++------
 1 file changed, 37 insertions(+), 17 deletions(-)

diff --git a/lib/librte_eventdev/rte_event_eth_tx_adapter.c b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
index ccf8a7550..67216a305 100644
--- a/lib/librte_eventdev/rte_event_eth_tx_adapter.c
+++ b/lib/librte_eventdev/rte_event_eth_tx_adapter.c
@@ -60,4 +60,18 @@ do {\
 } while (0)
 
+#define TXA_CHECK_TXQ(dev, queue) \
+do {\
+	if ((dev)->data->nb_tx_queues == 0) { \
+		RTE_EDEV_LOG_ERR("No tx queues configured"); \
+		return -EINVAL; \
+	} \
+	if ((queue) != -1 && \
+		(uint16_t)(queue) >= (dev)->data->nb_tx_queues) { \
+		RTE_EDEV_LOG_ERR("Invalid tx queue_id %" PRIu16, \
+				(uint16_t)(queue)); \
+		return -EINVAL; \
+	} \
+} while (0)
+
 /* Tx retry callback structure */
 struct txa_retry {
@@ -796,12 +810,28 @@ txa_service_queue_del(uint8_t id,
 	uint16_t port_id;
 
+	txa = txa_service_id_to_data(id);
+	port_id = dev->data->port_id;
+
 	if (tx_queue_id == -1) {
-		uint16_t i;
-		int ret = -1;
+		uint16_t i, q, nb_queues;
+		int ret = 0;
 
-		for (i = 0; i < dev->data->nb_tx_queues; i++) {
-			ret = txa_service_queue_del(id, dev, i);
-			if (ret != 0)
-				break;
+		nb_queues = txa->nb_queues;
+		if (nb_queues == 0)
+			return 0;
+
+		i = 0;
+		q = 0;
+		tqi = txa->txa_ethdev[port_id].queues;
+
+		while (i < nb_queues) {
+
+			if (tqi[q].added) {
+				ret = txa_service_queue_del(id, dev, q);
+				if (ret != 0)
+					break;
+			}
+			i++;
+			q++;
 		}
 		return ret;
@@ -809,5 +839,4 @@ txa_service_queue_del(uint8_t id,
 
 	txa = txa_service_id_to_data(id);
-	port_id = dev->data->port_id;
 
 	tqi = txa_service_queue(txa, port_id, tx_queue_id);
@@ -1000,9 +1029,5 @@ rte_event_eth_tx_adapter_queue_add(uint8_t id,
 
 	eth_dev = &rte_eth_devices[eth_dev_id];
-	if (queue != -1 && (uint16_t)queue >= eth_dev->data->nb_tx_queues) {
-		RTE_EDEV_LOG_ERR("Invalid tx queue_id %" PRIu16,
-				(uint16_t)queue);
-		return -EINVAL;
-	}
+	TXA_CHECK_TXQ(eth_dev, queue);
 
 	caps = 0;
@@ -1035,9 +1060,4 @@ rte_event_eth_tx_adapter_queue_del(uint8_t id,
 
 	eth_dev = &rte_eth_devices[eth_dev_id];
-	if (queue != -1 && (uint16_t)queue >= eth_dev->data->nb_tx_queues) {
-		RTE_EDEV_LOG_ERR("Invalid tx queue_id %" PRIu16,
-				(uint16_t)queue);
-		return -EINVAL;
-	}
 
 	caps = 0;
-- 
2.19.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2019-01-04 13:23:07.817307496 +0000
+++ 0015-eventdev-fix-eth-Tx-adapter-queue-count-checks.patch	2019-01-04 13:23:07.000000000 +0000
@@ -1,8 +1,10 @@
-From 5bd4ae2d774b5988a1b5ec084f27f859e91c655e Mon Sep 17 00:00:00 2001
+From ca606f46af5c45e08c2492e87749ba2808347538 Mon Sep 17 00:00:00 2001
 From: Nikhil Rao <nikhil.rao at intel.com>
 Date: Mon, 17 Dec 2018 10:09:41 +0530
 Subject: [PATCH] eventdev: fix eth Tx adapter queue count checks
 
+[ upstream commit 5bd4ae2d774b5988a1b5ec084f27f859e91c655e ]
+
 rte_event_eth_tx_adapter_queue_add() - add a check
 that returns an error if the ethdev has zero Tx queues
 configured.
@@ -13,7 +15,6 @@
 from the current ethdev queue count.
 
 Fixes: a3bbf2e09756 ("eventdev: add eth Tx adapter implementation")
-Cc: stable at dpdk.org
 
 Signed-off-by: Nikhil Rao <nikhil.rao at intel.com>
 ---


More information about the stable mailing list