From mboxrd@z Thu Jan 1 00:00:00 1970 From: Yuanhan Liu Subject: Re: [PATCH v3 2/7] net/virtio_user: fix not properly reset device Date: Wed, 4 Jan 2017 13:46:27 +0800 Message-ID: <20170104054627.GF21228@yliu-dev.sh.intel.com> References: <1483502366-140154-1-git-send-email-jianfeng.tan@intel.com> <1483502366-140154-3-git-send-email-jianfeng.tan@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: dev@dpdk.org, ferruh.yigit@intel.com, cunming.liang@intel.com, stable@dpdk.org To: Jianfeng Tan Return-path: Content-Disposition: inline In-Reply-To: <1483502366-140154-3-git-send-email-jianfeng.tan@intel.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jan 04, 2017 at 03:59:21AM +0000, Jianfeng Tan wrote: > virtio_user is not properly reset when users call vtpci_reset(), > as it ignores VIRTIO_CONFIG_STATUS_RESET status in > virtio_user_set_status(). > > This might lead to initialization failure as it starts to re-init > the device before sending RESET messege to backend. Besides, previous > callfds and kickfds are not closed. > > To fix it, we add support to disable virtqueues when it's set to > DRIVER OK status, and re-init fields in struct virtio_user_dev. > > Fixes: e9efa4d93821 ("net/virtio-user: add new virtual PCI driver") > Fixes: 37a7eb2ae816 ("net/virtio-user: add device emulation layer") > > CC: stable@dpdk.org > > Signed-off-by: Jianfeng Tan Note that, typically, there should be no empty line between 'Cc' and SoB. > --- > drivers/net/virtio/virtio_user/virtio_user_dev.c | 26 ++++++++++++++++-------- > drivers/net/virtio/virtio_user_ethdev.c | 15 ++++++++------ > 2 files changed, 27 insertions(+), 14 deletions(-) > > diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c > index 0d7e17b..a38398b 100644 > --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c > +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c > @@ -182,7 +182,17 @@ virtio_user_start_device(struct virtio_user_dev *dev) > > int virtio_user_stop_device(struct virtio_user_dev *dev) The name doesn't seem to be well named: "dev_stop" comes to my firstly when I saw that :/ Rename it to "xxx_reset_device"? --yliu