From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by dpdk.org (Postfix) with ESMTP id A40BB1B48B for ; Fri, 4 Jan 2019 14:26:39 +0100 (CET) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1669E45F86; Fri, 4 Jan 2019 13:26:39 +0000 (UTC) Received: from ktraynor.remote.csb (ovpn-117-13.ams2.redhat.com [10.36.117.13]) by smtp.corp.redhat.com (Postfix) with ESMTP id DA2255C224; Fri, 4 Jan 2019 13:26:37 +0000 (UTC) From: Kevin Traynor To: Nikhil Rao Cc: dpdk stable Date: Fri, 4 Jan 2019 13:23:57 +0000 Message-Id: <20190104132455.15170-15-ktraynor@redhat.com> In-Reply-To: <20190104132455.15170-1-ktraynor@redhat.com> References: <20190104132455.15170-1-ktraynor@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Fri, 04 Jan 2019 13:26:39 +0000 (UTC) Subject: [dpdk-stable] patch 'eventdev: fix eth Tx adapter queue count checks' has been queued to LTS release 18.11.1 X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Jan 2019 13:26:40 -0000 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 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 --- .../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 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@dpdk.org Signed-off-by: Nikhil Rao ---