DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Jiang, YuX" <yux.jiang@intel.com>
To: David Marchand <david.marchand@redhat.com>,
	"dev@dpdk.org" <dev@dpdk.org>
Cc: Harman Kalra <hkalra@marvell.com>
Subject: Re: [dpdk-dev] [PATCH] eal: fix device hotplug
Date: Tue, 2 Nov 2021 09:35:09 +0000	[thread overview]
Message-ID: <SJ0PR11MB51505A19449F90EC360075D9FE8B9@SJ0PR11MB5150.namprd11.prod.outlook.com> (raw)
In-Reply-To: <20211102075259.3392-1-david.marchand@redhat.com>

> -----Original Message-----
> From: David Marchand <david.marchand@redhat.com>
> Sent: Tuesday, November 2, 2021 3:53 PM
> To: dev@dpdk.org
> Cc: Jiang, YuX <yux.jiang@intel.com>; Harman Kalra <hkalra@marvell.com>
> Subject: [PATCH] eal: fix device hotplug
> 
> The device event interrupt handler was always freed.
> 
> Bugzilla ID: 845
> Fixes: c2bd9367e18f ("lib: remove direct access to interrupt handle")
> 
> Signed-off-by: David Marchand <david.marchand@redhat.com>
> ---
>  lib/eal/linux/eal_dev.c | 12 +++++++++---
>  1 file changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/lib/eal/linux/eal_dev.c b/lib/eal/linux/eal_dev.c index
> 06820a3666..925cdba553 100644
> --- a/lib/eal/linux/eal_dev.c
> +++ b/lib/eal/linux/eal_dev.c
> @@ -317,10 +317,12 @@ rte_dev_event_monitor_start(void)
>  		goto exit;
>  	}
> 
> -	if (rte_intr_type_set(intr_handle, RTE_INTR_HANDLE_DEV_EVENT))
> +	ret = rte_intr_type_set(intr_handle,
> RTE_INTR_HANDLE_DEV_EVENT);
> +	if (ret)
>  		goto exit;
> 
> -	if (rte_intr_fd_set(intr_handle, -1))
> +	ret = rte_intr_fd_set(intr_handle, -1);
> +	if (ret)
>  		goto exit;
> 
>  	ret = dev_uev_socket_fd_create();
> @@ -339,7 +341,10 @@ rte_dev_event_monitor_start(void)
>  	monitor_refcount++;
> 
>  exit:
> -	rte_intr_instance_free(intr_handle);
> +	if (ret) {
> +		rte_intr_instance_free(intr_handle);
> +		intr_handle = NULL;
> +	}
>  	rte_rwlock_write_unlock(&monitor_lock);
>  	return ret;
>  }
> @@ -370,6 +375,7 @@ rte_dev_event_monitor_stop(void)
> 
>  	close(rte_intr_fd_get(intr_handle));
>  	rte_intr_instance_free(intr_handle);
> +	intr_handle = NULL;
> 
>  	monitor_refcount--;
> 
> --
> 2.23.0
Hi David,

The patch https://patchwork.dpdk.org/project/dpdk/patch/20211102075259.3392-1-david.marchand@redhat.com/   
failed to verify. 

after executing "device_del dev1" in the qemu window, the testpmd window hangs to death and output as following:
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)
EAL: Cannot find bus for device (0000:00:05.0)

  reply	other threads:[~2021-11-02  9:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-02  7:52 David Marchand
2021-11-02  9:35 ` Jiang, YuX [this message]
2021-11-04 14:15   ` David Marchand
2021-11-04 14:11 ` Maxime Coquelin
2021-11-04 14:22   ` David Marchand

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=SJ0PR11MB51505A19449F90EC360075D9FE8B9@SJ0PR11MB5150.namprd11.prod.outlook.com \
    --to=yux.jiang@intel.com \
    --cc=david.marchand@redhat.com \
    --cc=dev@dpdk.org \
    --cc=hkalra@marvell.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;
as well as URLs for NNTP newsgroup(s).