All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Monjalon <thomas.monjalon@6wind.com>
To: Jianfeng Tan <jianfeng.tan@intel.com>, ferruh.yigit@intel.com
Cc: dev@dpdk.org, stephen@networkplumber.org, jing.d.chen@intel.com
Subject: Re: [PATCH] igb_uio: stop device when closing /dev/uioX
Date: Thu, 30 Mar 2017 22:22:53 +0200	[thread overview]
Message-ID: <1729096.OcIPJKQlaJ@xps13> (raw)
In-Reply-To: <1480697146-118038-1-git-send-email-jianfeng.tan@intel.com>

2016-12-02 16:45, Jianfeng Tan:
> Depends-on: http://dpdk.org/dev/patchwork/patch/17493/

The above patch is marked as rejected.
Do we want to reject also this patch?

> When a DPDK application grab a PCI device, device and driver work
> together to Rx/Tx packets. If the DPDK app crashes or gets killed,
> there's no chance for DPDK driver to stop the device, which means
> rte_eth_dev_stop() will not be called.
> 
> This could result in problems. In virtio's case, the device (the
> vhost backend), will keep working. If packets come, the vhost will
> copy them into the vring, which is negotiated with the previous DPDK
> app. But the resources, especially hugepages, are recycled by VM
> kernel. What's worse, the memory could be allocated for other usage,
> and re-written. This leads to an uncertain situation. Like this post
> has reported, https://bugs.launchpad.net/qemu/+bug/1558175, QEMU's
> vhost finds out wrong value, and exits the whole QEMU process.
> 
> To make it right, we need to restart (or reset) the device and make
> the device go into the initial state, when uio-generic or igb_uio
> recycles the PCI device. There's a chance in uio framework to disable
> devices when /dev/uioX gets closed. Here we enable the pci device
> in open() hook and disable it in release() hook.
> 
> However, if device is not enabled in probe() phase any more, we can
> not register irq in probe() through uio_register_device(). To address
> that, we invoke request_irq() to register callback directly.
> 
> Similar change needs to be done in uio-generic driver. And vfio-pci
> seems to have done that already.
> 
> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>

  reply	other threads:[~2017-03-30 20:22 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-01  2:16 [RFC] igb_uio: deprecate iomem and ioport mapping Jianfeng Tan
2016-09-02 12:31 ` Ferruh Yigit
2016-09-02 12:59   ` Tan, Jianfeng
2016-09-09  9:06 ` David Marchand
2016-09-09  9:31   ` Tan, Jianfeng
2016-09-22  5:44 ` [PATCH] doc: remove iomem and ioport handling in igb_uio Jianfeng Tan
2016-09-30 10:13   ` Ferruh Yigit
2016-11-11  2:12   ` Remy Horton
2016-11-13  8:55     ` Thomas Monjalon
2016-12-02 16:28 ` [PATCH] igb_uio: deprecate iomem and ioport mapping Jianfeng Tan
2016-12-02 16:45   ` [PATCH] igb_uio: stop device when closing /dev/uioX Jianfeng Tan
2017-03-30 20:22     ` Thomas Monjalon [this message]
2017-03-31 14:16       ` Ferruh Yigit
2016-12-02 23:47 ` [RFC] igb_uio: deprecate iomem and ioport mapping Stephen Hemminger
2016-12-05  7:04   ` Tan, Jianfeng
2017-01-05 15:23     ` Ferruh Yigit
2017-01-06  1:52       ` Tan, Jianfeng

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=1729096.OcIPJKQlaJ@xps13 \
    --to=thomas.monjalon@6wind.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jianfeng.tan@intel.com \
    --cc=jing.d.chen@intel.com \
    --cc=stephen@networkplumber.org \
    /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.