From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Stephen Hemminger <stephen@networkplumber.org>, dev@dpdk.org
Cc: stable@dpdk.org, Yu Jiang <yux.jiang@intel.com>,
Chenbo Xia <chenbox@nvidia.com>,
Bruce Richardson <bruce.richardson@intel.com>
Subject: Re: [PATCH] examples/vhost: fix hang on exit
Date: Thu, 29 Oct 2026 16:48:33 +0100 [thread overview]
Message-ID: <92444640-e79d-400c-9eaf-b63ba799c783@redhat.com> (raw)
In-Reply-To: <20261029144727.119072-1-stephen@networkplumber.org>
On 10/29/26 3:47 PM, Stephen Hemminger wrote:
> destroy_device() waits for the worker lcore to ack device removal.
> Since the signal handler rework, the workers exit before the vhost
> drivers are unregistered, so the destroy callback spins forever.
>
> Unregister the drivers while the workers are still polling, then
> stop and join them.
>
> Bugzilla ID: 2071
> Fixes: 5ffa8fafcbd3 ("examples/vhost: make signal handler safe")
> Cc: stable@dpdk.org
>
> Reported-by: Yu Jiang <yux.jiang@intel.com>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---
> examples/vhost/main.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index 523195f5c4..16c9387f8f 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -69,6 +69,8 @@ static uint32_t enabled_port_mask = 0;
> /* Set by the SIGINT handler to stop the worker loops. */
> static volatile sig_atomic_t quit;
>
> +static RTE_ATOMIC(bool) stop_workers;
> +
> /* Promiscuous mode */
> static uint32_t promiscuous;
>
> @@ -1242,7 +1244,7 @@ switch_worker(void *arg)
> }
> }
>
> - while (!quit) {
> + while (!rte_atomic_load_explicit(&stop_workers, rte_memory_order_relaxed)) {
> drain_mbuf_table(tx_q);
> drain_vhost_table();
> /*
Are you sure you committed all the changes? I don't see a store of true
to stop_workers.
next prev parent reply other threads:[~2026-10-29 15:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-10-29 14:47 [PATCH] examples/vhost: fix hang on exit Stephen Hemminger
2026-10-29 15:48 ` Maxime Coquelin [this message]
2026-10-29 16:57 ` [PATCH v2] " Stephen Hemminger
2026-10-29 18:03 ` Stephen Hemminger
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=92444640-e79d-400c-9eaf-b63ba799c783@redhat.com \
--to=maxime.coquelin@redhat.com \
--cc=bruce.richardson@intel.com \
--cc=chenbox@nvidia.com \
--cc=dev@dpdk.org \
--cc=stable@dpdk.org \
--cc=stephen@networkplumber.org \
--cc=yux.jiang@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox