DPDK patches and discussions
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas@monjalon.net>
To: dev@dpdk.org
Cc: Luca Boccassi <bluca@debian.org>,
	maxime.coquelin@redhat.com, tiwei.bie@intel.com,
	yongwang@vmware.com, 3chas3@gmail.com,
	bruce.richardson@intel.com, jianfeng.tan@intel.com,
	anatoly.burakov@intel.com, llouis@vmware.com,
	brussell@vyatta.att-mail.com, stephen@networkplumber.org,
	jingjing.wu@intel.com, anatoly.burakov@intel.com,
	qi.z.zhang@intel.com
Subject: Re: [dpdk-dev] [PATCH v2 3/3] eal/linux: handle uio read failure in interrupt handler
Date: Thu, 11 Oct 2018 12:32:20 +0200	[thread overview]
Message-ID: <3749287.SKhoszCCOA@xps> (raw)
In-Reply-To: <20180919125757.17938-3-bluca@debian.org>

Looking for someone to review this patch please


19/09/2018 14:57, Luca Boccassi:
> If a device is unplugged while an interrupt is pending, the
> read call to the uio device to remove it from the poll wait list
> can fail resulting in it being continually polled forever. This
> change checks for the read failing and if so, unregisters the device
> as an interrupt source and causes the wait list to be rebuilt.
> 
> This race has been reported and observed in production.
> 
> Fixes: 0a45657a6794 ("pci: rework interrupt handling")
> Cc: stable@dpdk.org
> 
> Signed-off-by: Brian Russell <brussell@brocade.com>
> Signed-off-by: Luca Boccassi <bluca@debian.org>
> ---
>  lib/librte_eal/linuxapp/eal/eal_interrupts.c | 19 ++++++++++++++++++-
>  1 file changed, 18 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/linuxapp/eal/eal_interrupts.c b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
> index 4076c6d6ca..34584db883 100644
> --- a/lib/librte_eal/linuxapp/eal/eal_interrupts.c
> +++ b/lib/librte_eal/linuxapp/eal/eal_interrupts.c
> @@ -627,7 +627,7 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
>  	bool call = false;
>  	int n, bytes_read;
>  	struct rte_intr_source *src;
> -	struct rte_intr_callback *cb;
> +	struct rte_intr_callback *cb, *next;
>  	union rte_intr_read_buffer buf;
>  	struct rte_intr_callback active_cb;
>  
> @@ -701,6 +701,23 @@ eal_intr_process_interrupts(struct epoll_event *events, int nfds)
>  					"descriptor %d: %s\n",
>  					events[n].data.fd,
>  					strerror(errno));
> +				/*
> +				 * The device is unplugged or buggy, remove
> +				 * it as an interrupt source and return to
> +				 * force the wait list to be rebuilt.
> +				 */
> +				rte_spinlock_lock(&intr_lock);
> +				TAILQ_REMOVE(&intr_sources, src, next);
> +				rte_spinlock_unlock(&intr_lock);
> +
> +				for (cb = TAILQ_FIRST(&src->callbacks); cb;
> +							cb = next) {
> +					next = TAILQ_NEXT(cb, next);
> +					TAILQ_REMOVE(&src->callbacks, cb, next);
> +					free(cb);
> +				}
> +				free(src);
> +				return -1;
>  			} else if (bytes_read == 0)
>  				RTE_LOG(ERR, EAL, "Read nothing from file "
>  					"descriptor %d\n", events[n].data.fd);
> 

  reply	other threads:[~2018-10-11 10:32 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-08-16 13:50 [dpdk-dev] [PATCH 0/3] Fix hot plug/unplug of virtual devices Luca Boccassi
2018-08-16 13:50 ` [dpdk-dev] [PATCH 1/3] net/virtio: register/unregister intr handler on start/stop Luca Boccassi
2018-08-16 13:50 ` [dpdk-dev] [PATCH 2/3] net/vmxnet3: fix vmxnet3 dev_uninit() hot-unplug Luca Boccassi
2018-09-17 19:06   ` Louis Luo
2018-09-18 13:14     ` Luca Boccassi
2018-09-18 18:14       ` Louis Luo
2018-09-18 18:29         ` Luca Boccassi
2018-09-18 18:48           ` Louis Luo
2018-09-19 12:58             ` Luca Boccassi
2018-08-16 13:50 ` [dpdk-dev] [PATCH 3/3] eal/linux: handle uio read failure in interrupt handler Luca Boccassi
2018-09-19 12:57 ` [dpdk-dev] [PATCH v2 1/3] net/virtio: register/unregister intr handler on start/stop Luca Boccassi
2018-09-19 12:57   ` [dpdk-dev] [PATCH v2 2/3] net/vmxnet3: fix vmxnet3 dev_uninit() hot-unplug Luca Boccassi
2018-09-19 15:47     ` Chas Williams
2018-09-19 16:08       ` Luca Boccassi
2018-10-27 15:09       ` Thomas Monjalon
2018-10-31 17:27         ` Thomas Monjalon
2018-10-31 17:46           ` Luca Boccassi
2018-10-31 18:02             ` Thomas Monjalon
2018-10-31 18:54             ` Louis Luo
2018-09-27  8:39     ` Luca Boccassi
2018-09-19 12:57   ` [dpdk-dev] [PATCH v2 3/3] eal/linux: handle uio read failure in interrupt handler Luca Boccassi
2018-10-11 10:32     ` Thomas Monjalon [this message]
2018-09-27  8:40   ` [dpdk-dev] [PATCH v2 1/3] net/virtio: register/unregister intr handler on start/stop Luca Boccassi
2018-09-27 10:51     ` Maxime Coquelin
2018-09-27 11:14   ` Maxime Coquelin
2018-10-31 18:39 ` [dpdk-dev] [PATCH v3 " Luca Boccassi
2018-10-31 18:39   ` [dpdk-dev] [PATCH v3 2/3] net/vmxnet3: fix vmxnet3 dev_uninit() hot-unplug Luca Boccassi
2018-10-31 18:39   ` [dpdk-dev] [PATCH v3 3/3] eal/linux: handle uio read failure in interrupt handler Luca Boccassi
2018-11-02  9:49   ` [dpdk-dev] [dpdk-stable] [PATCH v3 1/3] net/virtio: register/unregister intr handler on start/stop Thomas Monjalon
2018-11-02 11:14     ` Luca Boccassi

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=3749287.SKhoszCCOA@xps \
    --to=thomas@monjalon.net \
    --cc=3chas3@gmail.com \
    --cc=anatoly.burakov@intel.com \
    --cc=bluca@debian.org \
    --cc=bruce.richardson@intel.com \
    --cc=brussell@vyatta.att-mail.com \
    --cc=dev@dpdk.org \
    --cc=jianfeng.tan@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=llouis@vmware.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=qi.z.zhang@intel.com \
    --cc=stephen@networkplumber.org \
    --cc=tiwei.bie@intel.com \
    --cc=yongwang@vmware.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).