DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Tan, Jianfeng" <jianfeng.tan@intel.com>
To: "dev@dpdk.org" <dev@dpdk.org>
Cc: "yliu@fridaylinux.org" <yliu@fridaylinux.org>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio-user: fix segfault as features change
Date: Tue, 23 Jan 2018 09:47:37 +0000	[thread overview]
Message-ID: <ED26CBA2FAD1BF48A8719AEF02201E36513D11D4@SHSMSX103.ccr.corp.intel.com> (raw)
In-Reply-To: <1516700843-131786-1-git-send-email-jianfeng.tan@intel.com>

Correct yuanhan's email :-)

> -----Original Message-----
> From: Tan, Jianfeng
> Sent: Tuesday, January 23, 2018 5:47 PM
> To: dev@dpdk.org
> Cc: yuanhan.liu@linux.intel.com; maxime.coquelin@redhat.com; Tan,
> Jianfeng
> Subject: [PATCH] net/virtio-user: fix segfault as features change
> 
> Since commit 59fe5e17d93 ("vhost: propagate set features handling error"),
> vhost does not allow to set different features without reset.
> 
> The virito-user driver fails to reset the device in below commit.
> 
> To fix, we send the reset message as stopping the device.
> 
> Fixes: c12a26ee209e ("net/virtio-user: fix not properly reset device")
> 
> Reported-by: Lei Yao <lei.a.yao@intel.com>
> Reported-by: Tiwei Bie <tiwei.bie@intel.com>
> Signed-off-by: Jianfeng Tan <jianfeng.tan@intel.com>
> ---
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 7a70c18..3b5f737 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -142,6 +142,11 @@ int virtio_user_stop_device(struct virtio_user_dev
> *dev)
>  	for (i = 0; i < dev->max_queue_pairs; ++i)
>  		dev->ops->enable_qp(dev, i, 0);
> 
> +	if (dev->ops->send_request(dev, VHOST_USER_RESET_OWNER,
> NULL) < 0) {
> +		PMD_DRV_LOG(INFO, "Failed to reset the device\n");
> +		return -1;
> +	}
> +
>  	return 0;
>  }
> 
> --
> 2.7.4

      reply	other threads:[~2018-01-23  9:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  9:47 Jianfeng Tan
2018-01-23  9:47 ` Tan, Jianfeng [this message]

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=ED26CBA2FAD1BF48A8719AEF02201E36513D11D4@SHSMSX103.ccr.corp.intel.com \
    --to=jianfeng.tan@intel.com \
    --cc=dev@dpdk.org \
    --cc=maxime.coquelin@redhat.com \
    --cc=yliu@fridaylinux.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 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).