All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bruce Richardson <bruce.richardson@intel.com>
To: Anurag Mandal <anurag.mandal@intel.com>
Cc: <dev@dpdk.org>, <vladimir.medvedkin@intel.com>,
	<anatoly.burakov@intel.com>, <stable@dpdk.org>
Subject: Re: [PATCH 8/8] net/ixgbe: fix VF interrupt callback leak on close
Date: Mon, 30 Nov 2026 17:54:02 +0000	[thread overview]
Message-ID: <aw24OoGITeCUireD@bricha3-mobl1.ger.corp.intel.com> (raw)
In-Reply-To: <835b4859952819ed3e4a4ab454aff5a40a2a6b1a.1795959868.git.anurag.mandal@intel.com>

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.

  reply	other threads:[~2026-11-30 17:54 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aw24OoGITeCUireD@bricha3-mobl1.ger.corp.intel.com \
    --to=bruce.richardson@intel.com \
    --cc=anatoly.burakov@intel.com \
    --cc=anurag.mandal@intel.com \
    --cc=dev@dpdk.org \
    --cc=stable@dpdk.org \
    --cc=vladimir.medvedkin@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.