patch 'net/vhost: fix leak in interrupt handle setup' has been queued to stable release 22.11.2
Xueming Li
xuemingl at nvidia.com
Sun Apr 9 17:24:58 CEST 2023
Hi,
FYI, your patch has been queued to stable release 22.11.2
Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 04/11/23. 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.
Queued patches are on a temporary branch at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging
This queued commit can be viewed at:
https://git.dpdk.org/dpdk-stable/log/?h=22.11-staging/commit/1ecf04df54f5ed0743bee50b3498c1a18639a4f2
Thanks.
Xueming Li <xuemingl at nvidia.com>
---
>From 1ecf04df54f5ed0743bee50b3498c1a18639a4f2 Mon Sep 17 00:00:00 2001
From: David Marchand <david.marchand at redhat.com>
Date: Thu, 9 Mar 2023 13:37:51 +0100
Subject: [PATCH] net/vhost: fix leak in interrupt handle setup
Cc: Xueming Li <xuemingl at nvidia.com>
[ upstream commit 24c3a04e16aeab45719cf038d2371ccf8d1bc780 ]
Do a systematic cleanup if any part of the interrupt handle setup fails.
Fixes: d61138d4f0e2 ("drivers: remove direct access to interrupt handle")
Signed-off-by: David Marchand <david.marchand at redhat.com>
Reviewed-by: Chenbo Xia <chenbo.xia at intel.com>
---
drivers/net/vhost/rte_eth_vhost.c | 53 ++++++++++++++++++++-----------
1 file changed, 34 insertions(+), 19 deletions(-)
diff --git a/drivers/net/vhost/rte_eth_vhost.c b/drivers/net/vhost/rte_eth_vhost.c
index e8b0ed4f0b..96598f710d 100644
--- a/drivers/net/vhost/rte_eth_vhost.c
+++ b/drivers/net/vhost/rte_eth_vhost.c
@@ -686,25 +686,32 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
dev->intr_handle = rte_intr_instance_alloc(RTE_INTR_INSTANCE_F_PRIVATE);
if (dev->intr_handle == NULL) {
VHOST_LOG(ERR, "Fail to allocate intr_handle\n");
- return -ENOMEM;
+ ret = -ENOMEM;
+ goto error;
+ }
+ if (rte_intr_efd_counter_size_set(dev->intr_handle, sizeof(uint64_t))) {
+ ret = -rte_errno;
+ goto error;
}
- if (rte_intr_efd_counter_size_set(dev->intr_handle, sizeof(uint64_t)))
- return -rte_errno;
if (rte_intr_vec_list_alloc(dev->intr_handle, NULL, nb_rxq)) {
- VHOST_LOG(ERR,
- "Failed to allocate memory for interrupt vector\n");
- rte_intr_instance_free(dev->intr_handle);
- return -ENOMEM;
+ VHOST_LOG(ERR, "Failed to allocate memory for interrupt vector\n");
+ ret = -ENOMEM;
+ goto error;
}
VHOST_LOG(INFO, "Prepare intr vec\n");
for (i = 0; i < nb_rxq; i++) {
- if (rte_intr_vec_list_index_set(dev->intr_handle, i, RTE_INTR_VEC_RXTX_OFFSET + i))
- return -rte_errno;
- if (rte_intr_efds_index_set(dev->intr_handle, i, -1))
- return -rte_errno;
+ if (rte_intr_vec_list_index_set(dev->intr_handle, i,
+ RTE_INTR_VEC_RXTX_OFFSET + i)) {
+ ret = -rte_errno;
+ goto error;
+ }
+ if (rte_intr_efds_index_set(dev->intr_handle, i, -1)) {
+ ret = -rte_errno;
+ goto error;
+ }
vq = dev->data->rx_queues[i];
if (!vq) {
VHOST_LOG(INFO, "rxq-%d not setup yet, skip!\n", i);
@@ -729,16 +736,24 @@ eth_vhost_install_intr(struct rte_eth_dev *dev)
VHOST_LOG(INFO, "Installed intr vec for rxq-%d\n", i);
}
- if (rte_intr_nb_efd_set(dev->intr_handle, nb_rxq))
- return -rte_errno;
-
- if (rte_intr_max_intr_set(dev->intr_handle, nb_rxq + 1))
- return -rte_errno;
-
- if (rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_VDEV))
- return -rte_errno;
+ if (rte_intr_nb_efd_set(dev->intr_handle, nb_rxq)) {
+ ret = -rte_errno;
+ goto error;
+ }
+ if (rte_intr_max_intr_set(dev->intr_handle, nb_rxq + 1)) {
+ ret = -rte_errno;
+ goto error;
+ }
+ if (rte_intr_type_set(dev->intr_handle, RTE_INTR_HANDLE_VDEV)) {
+ ret = -rte_errno;
+ goto error;
+ }
return 0;
+
+error:
+ eth_vhost_uninstall_intr(dev);
+ return ret;
}
static void
--
2.25.1
---
Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- - 2023-04-09 21:45:41.598189800 +0800
+++ 0110-net-vhost-fix-leak-in-interrupt-handle-setup.patch 2023-04-09 21:45:38.769042200 +0800
@@ -1 +1 @@
-From 24c3a04e16aeab45719cf038d2371ccf8d1bc780 Mon Sep 17 00:00:00 2001
+From 1ecf04df54f5ed0743bee50b3498c1a18639a4f2 Mon Sep 17 00:00:00 2001
@@ -4,0 +5,3 @@
+Cc: Xueming Li <xuemingl at nvidia.com>
+
+[ upstream commit 24c3a04e16aeab45719cf038d2371ccf8d1bc780 ]
@@ -9 +11,0 @@
-Cc: stable at dpdk.org
@@ -18 +20 @@
-index 198bf4d1f4..96deb18d91 100644
+index e8b0ed4f0b..96598f710d 100644
More information about the stable
mailing list