DPDK patches and discussions
 help / color / mirror / Atom feed
From: "Yao, Lei A" <lei.a.yao@intel.com>
To: "Hu, Jiayu" <jiayu.hu@intel.com>, "dev@dpdk.org" <dev@dpdk.org>
Cc: "Bie, Tiwei" <tiwei.bie@intel.com>,
	"Yang, Zhiyong" <zhiyong.yang@intel.com>,
	"maxime.coquelin@redhat.com" <maxime.coquelin@redhat.com>
Subject: Re: [dpdk-dev] [PATCH v2] net/virtio-user: fix feature setting with vhost-net backend
Date: Wed, 9 May 2018 02:58:04 +0000	[thread overview]
Message-ID: <2DBBFF226F7CF64BAFCA79B681719D953A43E809@SHSMSX101.ccr.corp.intel.com> (raw)
In-Reply-To: <1525767284-130484-1-git-send-email-jiayu.hu@intel.com>



> -----Original Message-----
> From: Hu, Jiayu
> Sent: Tuesday, May 8, 2018 4:15 PM
> To: dev@dpdk.org
> Cc: Bie, Tiwei <tiwei.bie@intel.com>; Yang, Zhiyong
> <zhiyong.yang@intel.com>; maxime.coquelin@redhat.com; Yao, Lei A
> <lei.a.yao@intel.com>; Hu, Jiayu <jiayu.hu@intel.com>
> Subject: [PATCH v2] net/virtio-user: fix feature setting with vhost-net
> backend
> 
> When the backend is vhost-net, virtio-user must work in client mode and
> needs to request features from the backend in virtio_user_dev_init().
> But currently, virtio-user is assigned to default features in this case.
> 
> This patch is to fix this inappropriate feature setting.
> 
> Fixes: bd8f50a45d0f ("net/virtio-user: support server mode")
> Signed-off-by: Jiayu Hu <jiayu.hu@intel.com>
Tested-by: Lei Yao <lei.a.yao@intel.com>
Tested this patch based on 18.05-rc2. This patch fixed the vhost-net
kernel backend issue with DPDK. 
Basic test with virtio-user server mode is also pass. 
> ---
> changes in v2:
> - remove unnecessary indent change.
> - change commit log.
> 
>  drivers/net/virtio/virtio_user/virtio_user_dev.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index 38b8bc9..2d80188 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -353,7 +353,7 @@ virtio_user_dev_init(struct virtio_user_dev *dev,
> char *path, int queues,
>  		return -1;
>  	}
> 
> -	if (dev->vhostfd >= 0) {
> +	if (!dev->is_server) {
>  		if (dev->ops->send_request(dev,
> VHOST_USER_SET_OWNER,
>  					   NULL) < 0) {
>  			PMD_INIT_LOG(ERR, "set_owner fails: %s",
> @@ -367,6 +367,8 @@ virtio_user_dev_init(struct virtio_user_dev *dev,
> char *path, int queues,
>  				     strerror(errno));
>  			return -1;
>  		}
> +		if (dev->mac_specified)
> +			dev->device_features |= (1ull <<
> VIRTIO_NET_F_MAC);
>  	} else {
>  		/* We just pretend vhost-user can support all these features.
>  		 * Note that this could be problematic that if some feature is
> @@ -376,9 +378,6 @@ virtio_user_dev_init(struct virtio_user_dev *dev,
> char *path, int queues,
>  		dev->device_features =
> VIRTIO_USER_SUPPORTED_FEATURES;
>  	}
> 
> -	if (dev->mac_specified)
> -		dev->device_features |= (1ull << VIRTIO_NET_F_MAC);
> -
>  	if (cq) {
>  		/* device does not really need to know anything about CQ,
>  		 * so if necessary, we just claim to support CQ
> --
> 2.7.4

  reply	other threads:[~2018-05-09  2:58 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-07  6:50 [dpdk-dev] [PATCH] " Jiayu Hu
2018-05-08  2:49 ` Tiwei Bie
2018-05-08  7:44   ` Jiayu Hu
2018-05-10  5:04     ` Tiwei Bie
2018-05-10  8:33       ` Hu, Jiayu
2018-05-08  8:14 ` [dpdk-dev] [PATCH v2] " Jiayu Hu
2018-05-09  2:58   ` Yao, Lei A [this message]
2018-05-11  7:26   ` [dpdk-dev] [PATCH v3] " Jiayu Hu
2018-05-11  7:33     ` Tiwei Bie
2018-05-11  7:45       ` Yang, Zhiyong
2018-05-16  6:05     ` Maxime Coquelin

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=2DBBFF226F7CF64BAFCA79B681719D953A43E809@SHSMSX101.ccr.corp.intel.com \
    --to=lei.a.yao@intel.com \
    --cc=dev@dpdk.org \
    --cc=jiayu.hu@intel.com \
    --cc=maxime.coquelin@redhat.com \
    --cc=tiwei.bie@intel.com \
    --cc=zhiyong.yang@intel.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).