[dpdk-stable] patch 'net/tap: fix queues fd check before close' has been queued to stable release 19.11.3

luca.boccassi at gmail.com luca.boccassi at gmail.com
Tue May 19 15:03:57 CEST 2020


Hi,

FYI, your patch has been queued to stable release 19.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 05/21/20. 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 ac051be918c7237f8db11090cf0d709d8a2925e2 Mon Sep 17 00:00:00 2001
From: Yunjian Wang <wangyunjian at huawei.com>
Date: Fri, 17 Apr 2020 20:03:57 +0800
Subject: [PATCH] net/tap: fix queues fd check before close

[ upstream commit 13b698d11feca4ab12237303d553dc4e89d8a8d6 ]

The fd is possibly a negative value while it is passed as an
argument to function "close". Fix the check to the fd.

Fixes: ed8132e7c912 ("net/tap: move fds of queues to be in process private")

Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>
---
 drivers/net/tap/rte_eth_tap.c | 4 ++--
 drivers/net/tap/tap_intr.c    | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/net/tap/rte_eth_tap.c b/drivers/net/tap/rte_eth_tap.c
index e644f8875b..7081ae23e9 100644
--- a/drivers/net/tap/rte_eth_tap.c
+++ b/drivers/net/tap/rte_eth_tap.c
@@ -1089,7 +1089,7 @@ tap_rx_queue_release(void *queue)
 	if (!rxq)
 		return;
 	process_private = rte_eth_devices[rxq->in_port].process_private;
-	if (process_private->rxq_fds[rxq->queue_id] > 0) {
+	if (process_private->rxq_fds[rxq->queue_id] != -1) {
 		close(process_private->rxq_fds[rxq->queue_id]);
 		process_private->rxq_fds[rxq->queue_id] = -1;
 		tap_rxq_pool_free(rxq->pool);
@@ -1109,7 +1109,7 @@ tap_tx_queue_release(void *queue)
 		return;
 	process_private = rte_eth_devices[txq->out_port].process_private;
 
-	if (process_private->txq_fds[txq->queue_id] > 0) {
+	if (process_private->txq_fds[txq->queue_id] != -1) {
 		close(process_private->txq_fds[txq->queue_id]);
 		process_private->txq_fds[txq->queue_id] = -1;
 	}
diff --git a/drivers/net/tap/tap_intr.c b/drivers/net/tap/tap_intr.c
index 58f36d3ccb..5cf4f173a0 100644
--- a/drivers/net/tap/tap_intr.c
+++ b/drivers/net/tap/tap_intr.c
@@ -71,7 +71,7 @@ tap_rx_intr_vec_install(struct rte_eth_dev *dev)
 		struct rx_queue *rxq = pmd->dev->data->rx_queues[i];
 
 		/* Skip queues that cannot request interrupts. */
-		if (!rxq || process_private->rxq_fds[i] <= 0) {
+		if (!rxq || process_private->rxq_fds[i] == -1) {
 			/* Use invalid intr_vec[] index to disable entry. */
 			intr_handle->intr_vec[i] =
 				RTE_INTR_VEC_RXTX_OFFSET +
-- 
2.20.1

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2020-05-19 14:04:48.609446182 +0100
+++ 0102-net-tap-fix-queues-fd-check-before-close.patch	2020-05-19 14:04:44.312650112 +0100
@@ -1,13 +1,14 @@
-From 13b698d11feca4ab12237303d553dc4e89d8a8d6 Mon Sep 17 00:00:00 2001
+From ac051be918c7237f8db11090cf0d709d8a2925e2 Mon Sep 17 00:00:00 2001
 From: Yunjian Wang <wangyunjian at huawei.com>
 Date: Fri, 17 Apr 2020 20:03:57 +0800
 Subject: [PATCH] net/tap: fix queues fd check before close
 
+[ upstream commit 13b698d11feca4ab12237303d553dc4e89d8a8d6 ]
+
 The fd is possibly a negative value while it is passed as an
 argument to function "close". Fix the check to the fd.
 
 Fixes: ed8132e7c912 ("net/tap: move fds of queues to be in process private")
-Cc: stable at dpdk.org
 
 Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
 Reviewed-by: Ferruh Yigit <ferruh.yigit at intel.com>


More information about the stable mailing list