* [PATCH 0/8] net/ixgbe: fix memory and resource leaks
@ 2026-11-29 13:53 Anurag Mandal
2026-11-29 13:53 ` [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal
` (8 more replies)
0 siblings, 9 replies; 27+ messages in thread
From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw)
To: dev; +Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov,
Anurag Mandal
This patch series fixes memory and resource leaks in the ixgbe PMD.
1. The first patch fixes a regression from 26.07: since the common Tx path
frees mbufs during descriptor cleanup, stopping an ixgbe Tx queue that
uses a scalar path (full-featured or simple) drops mbufs without
freeing them. Repeated port stop/start cycles exhaust the mempool.
2. The other patches fix leaks on error paths and in device lifecycle
operations:
a. Tx queue structure when the descriptor ring cannot be reserved
b. Rx mbufs when a failed runtime queue start is retried
c. MAC address arrays on every PF and VF device reset
d. VF representor ports, which are never released
e. security context when the dynamic mbuf field registration fails
f. Rx interrupt eventfds when device start fails
g. VF interrupt callback when it is running during close
Anurag Mandal (8):
net/ixgbe: fix Tx mbuf leak on queue stop
net/ixgbe: fix Tx queue leak on ring allocation failure
net/ixgbe: fix Rx mbuf leak on queue start failure
net/ixgbe: fix MAC address leak on device reset
net/ixgbe: fix VF representor port leak
net/ixgbe: fix security context leak on init failure
net/ixgbe: fix eventfd leak on start failure
net/ixgbe: fix VF interrupt callback leak on close
drivers/net/intel/ixgbe/ixgbe_ethdev.c | 46 +++++++++++++------
drivers/net/intel/ixgbe/ixgbe_rxtx.c | 34 ++++++++++++--
.../net/intel/ixgbe/ixgbe_vf_representor.c | 5 +-
3 files changed, 67 insertions(+), 18 deletions(-)
--
2.25.1
^ permalink raw reply [flat|nested] 27+ messages in thread* [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 16:51 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal ` (7 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable Since the common scalar Tx path frees mbufs during descriptor cleanup, ci_txq_release_all_mbufs() only frees the entries between last_desc_cleaned + 1 and tx_tail - 1 for non-vector queues, and then clears the whole software ring. ixgbe pmd does not use the common scalar Tx path. Its full-featured Tx function frees an mbuf only when the ring slot is reused, and its simple Tx function never updates last_desc_cleaned. Once the ring has wrapped, completed (full-featured) or in-flight (simple) mbufs outside that window are dropped without being freed. Up to a ring of mbufs is leaked per Tx queue on every queue stop, port stop and queue release, which exhausts the mempool after repeated stop/start cycles. Free every non-NULL software ring entry for the scalar paths, as was done earlier. The vector path keeps using the common helper. Fixes: bfe024981f41 ("net/intel: optimize for fast-free hint") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 1901811883..49295b5dc8 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -2482,11 +2482,33 @@ ixgbe_tx_free_swring(struct ci_tx_queue *txq) rte_free(txq->sw_ring); } +static void __rte_cold +ixgbe_tx_queue_release_mbufs(struct ci_tx_queue *txq) +{ + uint16_t i; + + if (txq->use_vec_entry) { + ci_txq_release_all_mbufs(txq, false); + return; + } + + if (txq->sw_ring == NULL) + return; + + /* scalar paths only overwrite or NULL an entry after freeing it */ + for (i = 0; i < txq->nb_tx_desc; i++) { + if (txq->sw_ring[i].mbuf != NULL) { + rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf); + txq->sw_ring[i].mbuf = NULL; + } + } +} + static void __rte_cold ixgbe_tx_queue_release(struct ci_tx_queue *txq) { if (txq != NULL && txq->ops != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->free_swring(txq); rte_free(txq->rs_last_id); rte_memzone_free(txq->mz); @@ -3465,7 +3487,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev) struct ci_tx_queue *txq = dev->data->tx_queues[i]; if (txq != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->reset(txq); dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } @@ -5754,7 +5776,7 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) } if (txq->ops != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->reset(txq); } dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop 2026-11-29 13:53 ` [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal @ 2026-11-30 16:51 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 16:51 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:06PM +0000, Anurag Mandal wrote: > Since the common scalar Tx path frees mbufs during > descriptor cleanup, ci_txq_release_all_mbufs() only > frees the entries between last_desc_cleaned + 1 and > tx_tail - 1 for non-vector queues, and then clears > the whole software ring. > > ixgbe pmd does not use the common scalar Tx path. > Its full-featured Tx function frees an mbuf only > when the ring slot is reused, and its simple Tx > function never updates last_desc_cleaned. > Once the ring has wrapped, completed (full-featured) > or in-flight (simple) mbufs outside that window are > dropped without being freed. > Up to a ring of mbufs is leaked per Tx queue on every > queue stop, port stop and queue release, which > exhausts the mempool after repeated stop/start cycles. > > Free every non-NULL software ring entry for the scalar > paths, as was done earlier. > The vector path keeps using the common helper. > > Fixes: bfe024981f41 ("net/intel: optimize for fast-free hint") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_rxtx.c | 28 +++++++++++++++++++++++++--- > 1 file changed, 25 insertions(+), 3 deletions(-) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-11-29 13:53 ` [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:30 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal ` (6 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable When the descriptor ring memzone cannot be reserved in ixgbe_dev_tx_queue_setup(), the queue is released with ixgbe_tx_queue_release(). That function does nothing while txq->ops is NULL, and ops is only set after the memzone reservation, so the queue structure is leaked. Free the queue structure directly on that error path. Fixes: 429c6d86b371 ("ixgbe: prepare for vector pmd") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 49295b5dc8..32db2410b0 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -2855,7 +2855,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, sizeof(union ixgbe_adv_tx_desc) * IXGBE_MAX_RING_DESC, IXGBE_ALIGN, socket_id); if (tz == NULL) { - ixgbe_tx_queue_release(txq); + rte_free(txq); return -ENOMEM; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure 2026-11-29 13:53 ` [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal @ 2026-11-30 17:30 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:30 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:07PM +0000, Anurag Mandal wrote: > When the descriptor ring memzone cannot be reserved in > ixgbe_dev_tx_queue_setup(), the queue is released with > ixgbe_tx_queue_release(). > That function does nothing while txq->ops is NULL, and > ops is only set after the memzone reservation, so the > queue structure is leaked. > > Free the queue structure directly on that error path. > > Fixes: 429c6d86b371 ("ixgbe: prepare for vector pmd") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-11-29 13:53 ` [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal 2026-11-29 13:53 ` [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:30 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset Anurag Mandal ` (5 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbe_alloc_rx_queue_mbufs() returns on the first allocation failure and leaves the mbufs already allocated in the software ring. When called from ixgbe_dev_rx_queue_start(), nothing releases them and the queue stays in stopped state, so the ethdev layer does not call the queue stop callback either. The next start attempt overwrites the ring entries and leaks those mbufs. Free the partially allocated mbufs before returning the error. Fixes: 029fd06d40fa ("ixgbe: queue start and stop") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 32db2410b0..c9fe970cf6 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -4653,6 +4653,10 @@ ixgbe_alloc_rx_queue_mbufs(struct ci_rx_queue *rxq) if (mbuf == NULL) { PMD_INIT_LOG(ERR, "RX mbuf alloc failed queue_id=%u", (unsigned) rxq->queue_id); + while (i-- > 0) { + rte_mbuf_raw_free(rxe[i].mbuf); + rxe[i].mbuf = NULL; + } return -ENOMEM; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure 2026-11-29 13:53 ` [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal @ 2026-11-30 17:30 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:30 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:08PM +0000, Anurag Mandal wrote: > ixgbe_alloc_rx_queue_mbufs() returns on the first > allocation failure and leaves the mbufs already > allocated in the software ring. > > When called from ixgbe_dev_rx_queue_start(), > nothing releases them and the queue stays in > stopped state, so the ethdev layer does not > call the queue stop callback either. > The next start attempt overwrites the ring > entries and leaks those mbufs. > > Free the partially allocated mbufs before > returning the error. > > Fixes: 029fd06d40fa ("ixgbe: queue start and stop") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_rxtx.c | 4 ++++ > 1 file changed, 4 insertions(+) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (2 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:41 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 5/8] net/ixgbe: fix VF representor port leak Anurag Mandal ` (4 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable Since the MAC address arrays are freed by rte_eth_dev_release_port(), the driver uninit functions no longer free them. A device reset runs uninit and init without releasing the port, and init allocates new arrays over the old ones. Each PF reset leaks the MAC and hash MAC address arrays, and each VF reset leaks the MAC address array. Free the previous array just before allocating its replacement in init. Freeing it in the reset callbacks instead would leave it NULL when init fails earlier, e.g. when a VF reset returns -EAGAIN while the PF is resetting, and ixgbevf_dev_close() would then walk a NULL array. Fixes: e16adf08e54d ("ethdev: free all common data when releasing port") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index a284dd485a..cbf8175c56 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1186,6 +1186,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) /* reset mappings for queue statistics hw counters*/ ixgbe_reset_qstat_mappings(hw); + /* dev_reset re-runs init with the previous arrays still allocated */ + rte_free(eth_dev->data->mac_addrs); + /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("ixgbe", RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries, 0); @@ -1202,6 +1205,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) ð_dev->data->mac_addrs[0]); /* Allocate memory for storing hash filter MAC addresses */ + rte_free(eth_dev->data->hash_mac_addrs); eth_dev->data->hash_mac_addrs = rte_zmalloc( "ixgbe", RTE_ETHER_ADDR_LEN * IXGBE_VMDQ_NUM_UC_MAC, 0); if (eth_dev->data->hash_mac_addrs == NULL) { @@ -1562,6 +1566,9 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) /* Get Rx/Tx queue count via mailbox, which is ready after reset_hw */ ixgbevf_get_queues(hw, &tcs, &tc); + /* dev_reset re-runs init with the previous array still allocated */ + rte_free(eth_dev->data->mac_addrs); + /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("ixgbevf", RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries, 0); -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset 2026-11-29 13:53 ` [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset Anurag Mandal @ 2026-11-30 17:41 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:41 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:09PM +0000, Anurag Mandal wrote: > Since the MAC address arrays are freed by > rte_eth_dev_release_port(), the driver uninit > functions no longer free them. > A device reset runs uninit and init without > releasing the port, and init allocates new arrays > over the old ones. > Each PF reset leaks the MAC and hash MAC address > arrays, and each VF reset leaks the MAC address > array. > > Free the previous array just before allocating > its replacement in init. > Freeing it in the reset callbacks instead would > leave it NULL when init fails earlier, e.g. when > a VF reset returns -EAGAIN while the PF is resetting, > and ixgbevf_dev_close() would then walk a NULL array. > > Fixes: e16adf08e54d ("ethdev: free all common data when releasing port") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_ethdev.c | 7 +++++++ > 1 file changed, 7 insertions(+) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 5/8] net/ixgbe: fix VF representor port leak 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (3 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:42 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 6/8] net/ixgbe: fix security context leak on init failure Anurag Mandal ` (3 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable VF representor ports are never released. They have no close callback, so rte_eth_dev_close() returns -ENOTSUP before releasing the port. On device removal, eth_ixgbe_pci_remove() looks up the port by the PCI device name, which always finds the PF, so the representor branch is dead code. Each representor leaks its port and private data, and its MAC address pointer is left pointing into the per-VF data of the PF, which is freed when the PF is closed. Add a close callback for representors, and release them before the PF on device removal. As close may also be called from a secondary process, only clear the shared MAC address pointer in the primary. Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 17 ++++++++--------- drivers/net/intel/ixgbe/ixgbe_vf_representor.c | 5 ++++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index cbf8175c56..dabdfd932b 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1711,17 +1711,16 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) { struct rte_eth_dev *ethdev; + uint16_t port_id; - ethdev = rte_eth_dev_allocated(pci_dev->device.name); - if (!ethdev) - return 0; + /* representors point into PF private data, so release them first */ + RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device) { + ethdev = &rte_eth_devices[port_id]; + if (rte_eth_dev_is_repr(ethdev)) + rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit); + } - if (rte_eth_dev_is_repr(ethdev)) - return rte_eth_dev_pci_generic_remove(pci_dev, - ixgbe_vf_representor_uninit); - else - return rte_eth_dev_pci_generic_remove(pci_dev, - eth_ixgbe_dev_uninit); + return rte_eth_dev_pci_generic_remove(pci_dev, eth_ixgbe_dev_uninit); } static struct rte_pci_driver rte_ixgbe_pmd = { diff --git a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c index c11983e307..83f8f667a9 100644 --- a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c @@ -5,6 +5,7 @@ #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h> +#include <rte_eal.h> #include "ethdev_driver.h" #include "base/ixgbe_type.h" @@ -173,6 +174,7 @@ static const struct eth_dev_ops ixgbe_vf_representor_dev_ops = { .dev_start = ixgbe_vf_representor_dev_start, .dev_configure = ixgbe_vf_representor_dev_configure, .dev_stop = ixgbe_vf_representor_dev_stop, + .dev_close = ixgbe_vf_representor_uninit, .rx_queue_setup = ixgbe_vf_representor_rx_queue_setup, .tx_queue_setup = ixgbe_vf_representor_tx_queue_setup, @@ -267,7 +269,8 @@ int ixgbe_vf_representor_uninit(struct rte_eth_dev *ethdev) { /* mac_addrs must not be freed because part of ixgbe_vf_info */ - ethdev->data->mac_addrs = NULL; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + ethdev->data->mac_addrs = NULL; return 0; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 5/8] net/ixgbe: fix VF representor port leak 2026-11-29 13:53 ` [PATCH 5/8] net/ixgbe: fix VF representor port leak Anurag Mandal @ 2026-11-30 17:42 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:42 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:10PM +0000, Anurag Mandal wrote: > VF representor ports are never released. > > They have no close callback, so rte_eth_dev_close() > returns -ENOTSUP before releasing the port. > On device removal, eth_ixgbe_pci_remove() looks up > the port by the PCI device name, which always finds > the PF, so the representor branch is dead code. > Each representor leaks its port and private data, > and its MAC address pointer is left pointing into the > per-VF data of the PF, which is freed when the PF is > closed. > > Add a close callback for representors, and release them > before the PF on device removal. > As close may also be called from a secondary process, > only clear the shared MAC address pointer in the primary. > > Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_ethdev.c | 17 ++++++++--------- > drivers/net/intel/ixgbe/ixgbe_vf_representor.c | 5 ++++- > 2 files changed, 12 insertions(+), 10 deletions(-) > Some AI feedback on this patch, worth checking out. PCI removal ignores a failed child destroy and proceeds to remove the PF. The new ixgbe_ethdev.c:1722 discards the return value. ethdev_driver.c:387 can fail, yet PCI removal returns the PF removal result. That can report successful removal while a representor remains registered. Check the return and stop before removing the PF if a child could not be destroyed ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 6/8] net/ixgbe: fix security context leak on init failure 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (4 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 5/8] net/ixgbe: fix VF representor port leak Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:42 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure Anurag Mandal ` (2 subsequent siblings) 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbe_ipsec_ctx_create() stores the newly allocated security context in the device before registering the security dynamic mbuf field. If that registration fails, eth_ixgbe_dev_init() returns without freeing the context, and rte_eth_dev_release_port() does not free it either. Go through the existing error path, which frees the context. Fixes: 614af7548968 ("security: switch metadata to dynamic mbuf field") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index dabdfd932b..65314ee80c 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1114,8 +1114,10 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) ixgbe_swfw_lock_reset(hw); /* Initialize security_ctx only for primary process*/ - if (ixgbe_ipsec_ctx_create(eth_dev)) - return -ENOMEM; + if (ixgbe_ipsec_ctx_create(eth_dev)) { + ret = -ENOMEM; + goto err_exit; + } /* Initialize DCB configuration*/ memset(dcb_config, 0, sizeof(struct ixgbe_dcb_config)); -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 6/8] net/ixgbe: fix security context leak on init failure 2026-11-29 13:53 ` [PATCH 6/8] net/ixgbe: fix security context leak on init failure Anurag Mandal @ 2026-11-30 17:42 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:42 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:11PM +0000, Anurag Mandal wrote: > ixgbe_ipsec_ctx_create() stores the newly allocated > security context in the device before registering the > security dynamic mbuf field. > If that registration fails, eth_ixgbe_dev_init() > returns without freeing the context, and > rte_eth_dev_release_port() does not free it either. > > Go through the existing error path, which frees the context. > > Fixes: 614af7548968 ("security: switch metadata to dynamic mbuf field") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_ethdev.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (5 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 6/8] net/ixgbe: fix security context leak on init failure Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:43 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable When Rx queue interrupts are enabled, the PF and VF start functions create eventfds with rte_intr_efd_enable(). If start fails afterwards, the eventfds are not released: the ethdev layer does not call dev_stop after a failed start, and the next start creates new eventfds over the old ones. For the VF, close does not release them either, because ixgbevf_dev_stop() returns early once the adapter is stopped. Disable the eventfds on the start error paths, and free the PF interrupt vector list there as well, as dev_stop does. Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 65314ee80c..798a14bedd 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -2576,6 +2576,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev) dev->data->nb_rx_queues)) { PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" " intr_vec", dev->data->nb_rx_queues); + rte_intr_efd_disable(intr_handle); return -ENOMEM; } } @@ -2796,6 +2797,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev) error: PMD_INIT_LOG(ERR, "failure in ixgbe_dev_start(): %d", err); ixgbe_dev_clear_queues(dev); + rte_intr_efd_disable(intr_handle); + rte_intr_vec_list_free(intr_handle); return -EIO; } @@ -5532,6 +5535,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" " intr_vec", dev->data->nb_rx_queues); ixgbe_dev_clear_queues(dev); + rte_intr_efd_disable(intr_handle); return -ENOMEM; } } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure 2026-11-29 13:53 ` [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure Anurag Mandal @ 2026-11-30 17:43 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:43 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:12PM +0000, Anurag Mandal wrote: > When Rx queue interrupts are enabled, the PF > and VF start functions create eventfds with > rte_intr_efd_enable(). > If start fails afterwards, the eventfds are not > released: the ethdev layer does not call dev_stop > after a failed start, and the next start creates > new eventfds over the old ones. > For the VF, close does not release them either, > because ixgbevf_dev_stop() returns early once > the adapter is stopped. > > Disable the eventfds on the start error paths, > and free the PF interrupt vector list there as > well, as dev_stop does. > > Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF") > Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> > --- > drivers/net/intel/ixgbe/ixgbe_ethdev.c | 4 ++++ > 1 file changed, 4 insertions(+) > Acked-by: Bruce Richardson <bruce.richardson@intel.com> ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (6 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure Anurag Mandal @ 2026-11-29 13:53 ` Anurag Mandal 2026-11-30 17:54 ` Bruce Richardson 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal 8 siblings, 1 reply; 27+ messages in thread From: Anurag Mandal @ 2026-11-29 13:53 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbevf_dev_close() unregisters its interrupt callback only once. If the callback is running at that time, rte_intr_callback_unregister() returns -EAGAIN and the callback stays registered: its allocation is leaked, it keeps a pointer to the closed device, and a reset registers a second one. The PF close already retries in that case. Wait for the running callback to complete before unregistering. When close is called from the callback itself, like by an application resetting the port on RTE_ETH_EVENT_INTR_RESET, waiting would never end, so defer the removal until the callback returns instead. Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 798a14bedd..94564055d9 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -5641,8 +5641,16 @@ ixgbevf_dev_close(struct rte_eth_dev *dev) ixgbevf_remove_mac_addr(dev, 0); rte_intr_disable(intr_handle); - rte_intr_callback_unregister(intr_handle, - ixgbevf_dev_interrupt_handler, dev); + if (rte_intr_callback_unregister(intr_handle, + ixgbevf_dev_interrupt_handler, dev) == -EAGAIN) { + /* the handler may be our caller and cannot be waited for */ + if (rte_thread_is_intr()) + rte_intr_callback_unregister_pending(intr_handle, + ixgbevf_dev_interrupt_handler, dev, NULL); + else + rte_intr_callback_unregister_sync(intr_handle, + ixgbevf_dev_interrupt_handler, dev); + } return ret; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* Re: [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close 2026-11-29 13:53 ` [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal @ 2026-11-30 17:54 ` Bruce Richardson 0 siblings, 0 replies; 27+ messages in thread From: Bruce Richardson @ 2026-11-30 17:54 UTC (permalink / raw) To: Anurag Mandal; +Cc: dev, vladimir.medvedkin, anatoly.burakov, stable On Sun, Nov 29, 2026 at 01:53:13PM +0000, Anurag Mandal wrote: > ixgbevf_dev_close() unregisters its interrupt callback only once. If the > callback is running at that time, rte_intr_callback_unregister() returns > -EAGAIN and the callback stays registered: its allocation is leaked, it > keeps a pointer to the closed device, and a reset registers a second one. > The PF close already retries in that case. > > Wait for the running callback to complete before unregistering. When > close is called from the callback itself, like by an application > resetting the port on RTE_ETH_EVENT_INTR_RESET, waiting would never end, > so defer the removal until the callback returns instead. > > Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link > up/down") Cc: stable@dpdk.org > > Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- > drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++-- 1 file changed, > 10 insertions(+), 2 deletions(-) > Some AI feedback worth considering on this patch too. deferred unregister does not make close from inside the callback safe. The new ixgbe_ethdev.c:5648 defers removal of the callback registration, not release of the ethdev. If an application closes a stopped VF from its reset callback, ethdev frees dev_private before control returns to the ixgbe_ethdev.c:7765. That code then executes intr->flags &= ~IXGBE_FLAG_MAILBOX; through the freed pointer and calls ixgbevf_intr_enable(dev). This lifetime hazard predates the patch, but the new self-callback branch does not resolve it. I would hold this commit until the notification is delivered without subsequent handler access to the device, or teardown itself is deferred until the handler returns. Test close from the callback as well as reset: only close releases the port. ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (7 preceding siblings ...) 2026-11-29 13:53 ` [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 1/9] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal ` (8 more replies) 8 siblings, 9 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev; +Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal V2-changes: - patch 5: fail PCI removal if a representor cannot be released - patch 8: new, report the VF reset event only once the interrupt handler is done with the device - patch 9 (patch 8 in v1): mention closing the port from the reset callback in the commit message This patch series fixes memory and resource leaks in the ixgbe PMD. 1. The first patch fixes a regression from 26.07: since the common Tx path frees mbufs during descriptor cleanup, stopping an ixgbe Tx queue that uses a scalar path (full-featured or simple) drops mbufs without freeing them. Repeated port stop/start cycles exhaust the mempool. 2. The other patches fix leaks on error paths and in device lifecycle operations: a. Tx queue structure when the descriptor ring cannot be reserved b. Rx mbufs when a failed runtime queue start is retried c. MAC address arrays on every PF and VF device reset d. VF representor ports, which are never released e. security context when the dynamic mbuf field registration fails f. Rx interrupt eventfds when device start fails g. Not a leak fix but it makes the VF interrupt handler stop using the device once it has reported a PF reset, so that the port can be closed from the event callback. h. VF interrupt callback when it is running during close Anurag Mandal (9): net/ixgbe: fix Tx mbuf leak on queue stop net/ixgbe: fix Tx queue leak on ring allocation failure net/ixgbe: fix Rx mbuf leak on queue start failure net/ixgbe: fix MAC address leak on device reset net/ixgbe: fix VF representor port leak net/ixgbe: fix security context leak on init failure net/ixgbe: fix eventfd leak on start failure net/ixgbe: fix VF use after free in interrupt handler net/ixgbe: fix VF interrupt callback leak on close drivers/net/intel/ixgbe/ixgbe_ethdev.c | 75 +++++++++++++------ drivers/net/intel/ixgbe/ixgbe_rxtx.c | 34 ++++++++- .../net/intel/ixgbe/ixgbe_vf_representor.c | 5 +- 3 files changed, 88 insertions(+), 26 deletions(-) -- 2.25.1 ^ permalink raw reply [flat|nested] 27+ messages in thread
* [PATCH v2 1/9] net/ixgbe: fix Tx mbuf leak on queue stop 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 2/9] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal ` (7 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable Since the common scalar Tx path frees mbufs during descriptor cleanup, ci_txq_release_all_mbufs() only frees the entries between last_desc_cleaned + 1 and tx_tail - 1 for non-vector queues, and then clears the whole software ring. ixgbe pmd does not use the common scalar Tx path. Its full-featured Tx function frees an mbuf only when the ring slot is reused, and its simple Tx function never updates last_desc_cleaned. Once the ring has wrapped, completed (full-featured) or in-flight (simple) mbufs outside that window are dropped without being freed. Up to a ring of mbufs is leaked per Tx queue on every queue stop, port stop and queue release, which exhausts the mempool after repeated stop/start cycles. Free every non-NULL software ring entry for the scalar paths, as was done earlier. The vector path keeps using the common helper. Fixes: bfe024981f41 ("net/intel: optimize for fast-free hint") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 1901811883..49295b5dc8 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -2482,11 +2482,33 @@ ixgbe_tx_free_swring(struct ci_tx_queue *txq) rte_free(txq->sw_ring); } +static void __rte_cold +ixgbe_tx_queue_release_mbufs(struct ci_tx_queue *txq) +{ + uint16_t i; + + if (txq->use_vec_entry) { + ci_txq_release_all_mbufs(txq, false); + return; + } + + if (txq->sw_ring == NULL) + return; + + /* scalar paths only overwrite or NULL an entry after freeing it */ + for (i = 0; i < txq->nb_tx_desc; i++) { + if (txq->sw_ring[i].mbuf != NULL) { + rte_pktmbuf_free_seg(txq->sw_ring[i].mbuf); + txq->sw_ring[i].mbuf = NULL; + } + } +} + static void __rte_cold ixgbe_tx_queue_release(struct ci_tx_queue *txq) { if (txq != NULL && txq->ops != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->free_swring(txq); rte_free(txq->rs_last_id); rte_memzone_free(txq->mz); @@ -3465,7 +3487,7 @@ ixgbe_dev_clear_queues(struct rte_eth_dev *dev) struct ci_tx_queue *txq = dev->data->tx_queues[i]; if (txq != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->reset(txq); dev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED; } @@ -5754,7 +5776,7 @@ ixgbe_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id) } if (txq->ops != NULL) { - ci_txq_release_all_mbufs(txq, false); + ixgbe_tx_queue_release_mbufs(txq); txq->ops->reset(txq); } dev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED; -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 2/9] net/ixgbe: fix Tx queue leak on ring allocation failure 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 1/9] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 3/9] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal ` (6 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable When the descriptor ring memzone cannot be reserved in ixgbe_dev_tx_queue_setup(), the queue is released with ixgbe_tx_queue_release(). That function does nothing while txq->ops is NULL, and ops is only set after the memzone reservation, so the queue structure is leaked. Free the queue structure directly on that error path. Fixes: 429c6d86b371 ("ixgbe: prepare for vector pmd") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 49295b5dc8..32db2410b0 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -2855,7 +2855,7 @@ ixgbe_dev_tx_queue_setup(struct rte_eth_dev *dev, sizeof(union ixgbe_adv_tx_desc) * IXGBE_MAX_RING_DESC, IXGBE_ALIGN, socket_id); if (tz == NULL) { - ixgbe_tx_queue_release(txq); + rte_free(txq); return -ENOMEM; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 3/9] net/ixgbe: fix Rx mbuf leak on queue start failure 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 1/9] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 2/9] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 4/9] net/ixgbe: fix MAC address leak on device reset Anurag Mandal ` (5 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbe_alloc_rx_queue_mbufs() returns on the first allocation failure and leaves the mbufs already allocated in the software ring. When called from ixgbe_dev_rx_queue_start(), nothing releases them and the queue stays in stopped state, so the ethdev layer does not call the queue stop callback either. The next start attempt overwrites the ring entries and leaks those mbufs. Free the partially allocated mbufs before returning the error. Fixes: 029fd06d40fa ("ixgbe: queue start and stop") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c index 32db2410b0..c9fe970cf6 100644 --- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c +++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c @@ -4653,6 +4653,10 @@ ixgbe_alloc_rx_queue_mbufs(struct ci_rx_queue *rxq) if (mbuf == NULL) { PMD_INIT_LOG(ERR, "RX mbuf alloc failed queue_id=%u", (unsigned) rxq->queue_id); + while (i-- > 0) { + rte_mbuf_raw_free(rxe[i].mbuf); + rxe[i].mbuf = NULL; + } return -ENOMEM; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 4/9] net/ixgbe: fix MAC address leak on device reset 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (2 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 3/9] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 5/9] net/ixgbe: fix VF representor port leak Anurag Mandal ` (4 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable Since the MAC address arrays are freed by rte_eth_dev_release_port(), the driver uninit functions no longer free them. A device reset runs uninit and init without releasing the port, and init allocates new arrays over the old ones. Each PF reset leaks the MAC and hash MAC address arrays, and each VF reset leaks the MAC address array. Free the previous array just before allocating its replacement in init. Freeing it in the reset callbacks instead would leave it NULL when init fails earlier, e.g. when a VF reset returns -EAGAIN while the PF is resetting, and ixgbevf_dev_close() would then walk a NULL array. Fixes: e16adf08e54d ("ethdev: free all common data when releasing port") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index b832ff1f07..475045c825 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1186,6 +1186,9 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) /* reset mappings for queue statistics hw counters*/ ixgbe_reset_qstat_mappings(hw); + /* dev_reset re-runs init with the previous arrays still allocated */ + rte_free(eth_dev->data->mac_addrs); + /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("ixgbe", RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries, 0); @@ -1202,6 +1205,7 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) ð_dev->data->mac_addrs[0]); /* Allocate memory for storing hash filter MAC addresses */ + rte_free(eth_dev->data->hash_mac_addrs); eth_dev->data->hash_mac_addrs = rte_zmalloc( "ixgbe", RTE_ETHER_ADDR_LEN * IXGBE_VMDQ_NUM_UC_MAC, 0); if (eth_dev->data->hash_mac_addrs == NULL) { @@ -1562,6 +1566,9 @@ eth_ixgbevf_dev_init(struct rte_eth_dev *eth_dev) /* Get Rx/Tx queue count via mailbox, which is ready after reset_hw */ ixgbevf_get_queues(hw, &tcs, &tc); + /* dev_reset re-runs init with the previous array still allocated */ + rte_free(eth_dev->data->mac_addrs); + /* Allocate memory for storing MAC addresses */ eth_dev->data->mac_addrs = rte_zmalloc("ixgbevf", RTE_ETHER_ADDR_LEN * hw->mac.num_rar_entries, 0); -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 5/9] net/ixgbe: fix VF representor port leak 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (3 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 4/9] net/ixgbe: fix MAC address leak on device reset Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 6/9] net/ixgbe: fix security context leak on init failure Anurag Mandal ` (3 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable VF representor ports are never released. They have no close callback, so rte_eth_dev_close() returns -ENOTSUP before releasing the port. On device removal, eth_ixgbe_pci_remove() looks up the port by the PCI device name, which always finds the PF, so the representor branch is dead code. Each representor leaks its port and private data, and its MAC address pointer is left pointing into the per-VF data of the PF, which is freed when the PF is closed. Add a close callback for representors, and release them before the PF on device removal, failing the removal if one cannot be released so the PF is not removed underneath it. As close may also be called from a secondary process, only clear the shared MAC address pointer in the primary. Fixes: cf80ba6e2038 ("net/ixgbe: add support for representor ports") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 24 ++++++++++++------- .../net/intel/ixgbe/ixgbe_vf_representor.c | 5 +++- 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 475045c825..8b1ffb0739 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1711,17 +1711,23 @@ eth_ixgbe_pci_probe(struct rte_pci_driver *pci_drv __rte_unused, static int eth_ixgbe_pci_remove(struct rte_pci_device *pci_dev) { struct rte_eth_dev *ethdev; + uint16_t port_id; + int ret; - ethdev = rte_eth_dev_allocated(pci_dev->device.name); - if (!ethdev) - return 0; + /* representors point into PF private data, so release them first */ + RTE_ETH_FOREACH_DEV_OF(port_id, &pci_dev->device) { + ethdev = &rte_eth_devices[port_id]; + if (!rte_eth_dev_is_repr(ethdev)) + continue; + ret = rte_eth_dev_destroy(ethdev, ixgbe_vf_representor_uninit); + if (ret != 0) { + PMD_DRV_LOG(ERR, "failed to release representor port %u: %d", + port_id, ret); + return ret; + } + } - if (rte_eth_dev_is_repr(ethdev)) - return rte_eth_dev_pci_generic_remove(pci_dev, - ixgbe_vf_representor_uninit); - else - return rte_eth_dev_pci_generic_remove(pci_dev, - eth_ixgbe_dev_uninit); + return rte_eth_dev_pci_generic_remove(pci_dev, eth_ixgbe_dev_uninit); } static struct rte_pci_driver rte_ixgbe_pmd = { diff --git a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c index c11983e307..83f8f667a9 100644 --- a/drivers/net/intel/ixgbe/ixgbe_vf_representor.c +++ b/drivers/net/intel/ixgbe/ixgbe_vf_representor.c @@ -5,6 +5,7 @@ #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h> +#include <rte_eal.h> #include "ethdev_driver.h" #include "base/ixgbe_type.h" @@ -173,6 +174,7 @@ static const struct eth_dev_ops ixgbe_vf_representor_dev_ops = { .dev_start = ixgbe_vf_representor_dev_start, .dev_configure = ixgbe_vf_representor_dev_configure, .dev_stop = ixgbe_vf_representor_dev_stop, + .dev_close = ixgbe_vf_representor_uninit, .rx_queue_setup = ixgbe_vf_representor_rx_queue_setup, .tx_queue_setup = ixgbe_vf_representor_tx_queue_setup, @@ -267,7 +269,8 @@ int ixgbe_vf_representor_uninit(struct rte_eth_dev *ethdev) { /* mac_addrs must not be freed because part of ixgbe_vf_info */ - ethdev->data->mac_addrs = NULL; + if (rte_eal_process_type() == RTE_PROC_PRIMARY) + ethdev->data->mac_addrs = NULL; return 0; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 6/9] net/ixgbe: fix security context leak on init failure 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (4 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 5/9] net/ixgbe: fix VF representor port leak Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 7/9] net/ixgbe: fix eventfd leak on start failure Anurag Mandal ` (2 subsequent siblings) 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbe_ipsec_ctx_create() stores the newly allocated security context in the device before registering the security dynamic mbuf field. If that registration fails, eth_ixgbe_dev_init() returns without freeing the context, and rte_eth_dev_release_port() does not free it either. Go through the existing error path, which frees the context. Fixes: 614af7548968 ("security: switch metadata to dynamic mbuf field") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 8b1ffb0739..6df98f2d09 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -1114,8 +1114,10 @@ eth_ixgbe_dev_init(struct rte_eth_dev *eth_dev, void *init_params __rte_unused) ixgbe_swfw_lock_reset(hw); /* Initialize security_ctx only for primary process*/ - if (ixgbe_ipsec_ctx_create(eth_dev)) - return -ENOMEM; + if (ixgbe_ipsec_ctx_create(eth_dev)) { + ret = -ENOMEM; + goto err_exit; + } /* Initialize DCB configuration*/ memset(dcb_config, 0, sizeof(struct ixgbe_dcb_config)); -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 7/9] net/ixgbe: fix eventfd leak on start failure 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (5 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 6/9] net/ixgbe: fix security context leak on init failure Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 8/9] net/ixgbe: fix VF use after free in interrupt handler Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 9/9] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable When Rx queue interrupts are enabled, the PF and VF start functions create eventfds with rte_intr_efd_enable(). If start fails afterwards, the eventfds are not released: the ethdev layer does not call dev_stop after a failed start, and the next start creates new eventfds over the old ones. For the VF, close does not release them either, because ixgbevf_dev_stop() returns early once the adapter is stopped. Disable the eventfds on the start error paths, and free the PF interrupt vector list there as well, as dev_stop does. Fixes: 0eb609239efd ("ixgbe: enable Rx queue interrupts for PF and VF") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 6df98f2d09..4181bbcd17 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -2583,6 +2583,7 @@ ixgbe_dev_start(struct rte_eth_dev *dev) dev->data->nb_rx_queues)) { PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" " intr_vec", dev->data->nb_rx_queues); + rte_intr_efd_disable(intr_handle); return -ENOMEM; } } @@ -2803,6 +2804,8 @@ ixgbe_dev_start(struct rte_eth_dev *dev) error: PMD_INIT_LOG(ERR, "failure in ixgbe_dev_start(): %d", err); ixgbe_dev_clear_queues(dev); + rte_intr_efd_disable(intr_handle); + rte_intr_vec_list_free(intr_handle); return -EIO; } @@ -5539,6 +5542,7 @@ ixgbevf_dev_start(struct rte_eth_dev *dev) PMD_INIT_LOG(ERR, "Failed to allocate %d rx_queues" " intr_vec", dev->data->nb_rx_queues); ixgbe_dev_clear_queues(dev); + rte_intr_efd_disable(intr_handle); return -ENOMEM; } } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 8/9] net/ixgbe: fix VF use after free in interrupt handler 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (6 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 7/9] net/ixgbe: fix eventfd leak on start failure Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 9/9] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable The VF interrupt handler reports a PF reset with RTE_ETH_EVENT_INTR_RESET and then keeps using the device: it clears the mailbox flag in the private data and re-enables the interrupts. An application may close or detach the port from the event callback, which releases the port and frees its private data, so the handler then accesses freed memory. Report the event only once the handler is done with the device. As a result, interrupts are re-enabled before the callback runs instead of after it. Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 4181bbcd17..003fe32891 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -7714,7 +7714,8 @@ ixgbevf_dev_allmulticast_disable(struct rte_eth_dev *dev) return ret; } -static void ixgbevf_mbx_process(struct rte_eth_dev *dev) +/* return true if the PF requested a VF reset */ +static bool ixgbevf_mbx_process(struct rte_eth_dev *dev) { struct ixgbe_hw *hw = IXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private); u32 in_msg = 0; @@ -7726,10 +7727,11 @@ static void ixgbevf_mbx_process(struct rte_eth_dev *dev) if (in_msg == IXGBE_PF_CONTROL_MSG) { /* dummy mbx read to ack pf */ if (ixgbe_read_mbx(hw, &in_msg, 1, 0)) - return; - rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, - NULL); + return false; + return true; } + + return false; } static int @@ -7753,20 +7755,21 @@ ixgbevf_dev_interrupt_get_status(struct rte_eth_dev *dev) return 0; } -static int +static bool ixgbevf_dev_interrupt_action(struct rte_eth_dev *dev) { struct ixgbe_interrupt *intr = IXGBE_DEV_PRIVATE_TO_INTR(dev->data->dev_private); + bool pf_reset = false; if (intr->flags & IXGBE_FLAG_MAILBOX) { - ixgbevf_mbx_process(dev); + pf_reset = ixgbevf_mbx_process(dev); intr->flags &= ~IXGBE_FLAG_MAILBOX; } ixgbevf_intr_enable(dev); - return 0; + return pf_reset; } static void @@ -7775,7 +7778,10 @@ ixgbevf_dev_interrupt_handler(void *param) struct rte_eth_dev *dev = (struct rte_eth_dev *)param; ixgbevf_dev_interrupt_get_status(dev); - ixgbevf_dev_interrupt_action(dev); + /* the callback may close and free the port, so it must come last */ + if (ixgbevf_dev_interrupt_action(dev)) + rte_eth_dev_callback_process(dev, RTE_ETH_EVENT_INTR_RESET, + NULL); } /** -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
* [PATCH v2 9/9] net/ixgbe: fix VF interrupt callback leak on close 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal ` (7 preceding siblings ...) 2026-12-01 10:55 ` [PATCH v2 8/9] net/ixgbe: fix VF use after free in interrupt handler Anurag Mandal @ 2026-12-01 10:55 ` Anurag Mandal 8 siblings, 0 replies; 27+ messages in thread From: Anurag Mandal @ 2026-12-01 10:55 UTC (permalink / raw) To: dev Cc: bruce.richardson, vladimir.medvedkin, anatoly.burakov, Anurag Mandal, stable ixgbevf_dev_close() unregisters its interrupt callback only once. If the callback is running at that time, rte_intr_callback_unregister() returns -EAGAIN and the callback stays registered: its allocation is leaked, it keeps a pointer to the closed device, and a reset registers a second one. The PF close already retries in that case. Wait for the running callback to complete before unregistering. When close is called from the callback itself, e.g. by an application resetting or closing the port on RTE_ETH_EVENT_INTR_RESET, waiting would never end, so defer the removal until the callback returns instead. Fixes: 77234603fba0 ("net/ixgbe: support VF mailbox interrupt for link up/down") Cc: stable@dpdk.org Signed-off-by: Anurag Mandal <anurag.mandal@intel.com> --- drivers/net/intel/ixgbe/ixgbe_ethdev.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c index 003fe32891..231319d02f 100644 --- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c +++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c @@ -5648,8 +5648,16 @@ ixgbevf_dev_close(struct rte_eth_dev *dev) ixgbevf_remove_mac_addr(dev, 0); rte_intr_disable(intr_handle); - rte_intr_callback_unregister(intr_handle, - ixgbevf_dev_interrupt_handler, dev); + if (rte_intr_callback_unregister(intr_handle, + ixgbevf_dev_interrupt_handler, dev) == -EAGAIN) { + /* the handler may be our caller and cannot be waited for */ + if (rte_thread_is_intr()) + rte_intr_callback_unregister_pending(intr_handle, + ixgbevf_dev_interrupt_handler, dev, NULL); + else + rte_intr_callback_unregister_sync(intr_handle, + ixgbevf_dev_interrupt_handler, dev); + } return ret; } -- 2.25.1 ^ permalink raw reply related [flat|nested] 27+ messages in thread
end of thread, other threads:[~2026-12-01 11:02 UTC | newest] Thread overview: 27+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-11-29 13:53 [PATCH 0/8] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-11-29 13:53 ` [PATCH 1/8] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal 2026-11-30 16:51 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 2/8] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal 2026-11-30 17:30 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 3/8] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal 2026-11-30 17:30 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 4/8] net/ixgbe: fix MAC address leak on device reset Anurag Mandal 2026-11-30 17:41 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 5/8] net/ixgbe: fix VF representor port leak Anurag Mandal 2026-11-30 17:42 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 6/8] net/ixgbe: fix security context leak on init failure Anurag Mandal 2026-11-30 17:42 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 7/8] net/ixgbe: fix eventfd leak on start failure Anurag Mandal 2026-11-30 17:43 ` Bruce Richardson 2026-11-29 13:53 ` [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal 2026-11-30 17:54 ` Bruce Richardson 2026-12-01 10:55 ` [PATCH v2 0/9] net/ixgbe: fix memory and resource leaks Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 1/9] net/ixgbe: fix Tx mbuf leak on queue stop Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 2/9] net/ixgbe: fix Tx queue leak on ring allocation failure Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 3/9] net/ixgbe: fix Rx mbuf leak on queue start failure Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 4/9] net/ixgbe: fix MAC address leak on device reset Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 5/9] net/ixgbe: fix VF representor port leak Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 6/9] net/ixgbe: fix security context leak on init failure Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 7/9] net/ixgbe: fix eventfd leak on start failure Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 8/9] net/ixgbe: fix VF use after free in interrupt handler Anurag Mandal 2026-12-01 10:55 ` [PATCH v2 9/9] net/ixgbe: fix VF interrupt callback leak on close Anurag Mandal
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.