DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Jens Freimann <jfreimann@redhat.com>, dev@dpdk.org
Cc: tiwei.bie@intel.com
Subject: Re: [dpdk-dev] [Patch v3 2/2] net/virtio-user: ctrl vq support for packed
Date: Fri, 11 Jan 2019 10:12:59 +0100	[thread overview]
Message-ID: <8455a67c-2bdb-7458-f247-3f4946cbe9e8@redhat.com> (raw)
In-Reply-To: <20190110214727.1142-3-jfreimann@redhat.com>



On 1/10/19 10:47 PM, Jens Freimann wrote:
> Add support to virtio-user for control virtqueues.
> 
> Signed-off-by: Jens Freimann <jfreimann@redhat.com>
> ---
>   .../net/virtio/virtio_user/virtio_user_dev.c  | 104 ++++++++++++++++--
>   .../net/virtio/virtio_user/virtio_user_dev.h  |  15 ++-
>   drivers/net/virtio/virtio_user_ethdev.c       |  56 +++++++++-
>   3 files changed, 159 insertions(+), 16 deletions(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/virtio_user_dev.c b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> index b9044faff..e7d1cf225 100644
> --- a/drivers/net/virtio/virtio_user/virtio_user_dev.c
> +++ b/drivers/net/virtio/virtio_user/virtio_user_dev.c
> @@ -43,15 +43,26 @@ virtio_user_kick_queue(struct virtio_user_dev *dev, uint32_t queue_sel)
>   	struct vhost_vring_file file;
>   	struct vhost_vring_state state;
>   	struct vring *vring = &dev->vrings[queue_sel];
> +	struct vring_packed *pq_vring = &dev->packed_vrings[queue_sel];
>   	struct vhost_vring_addr addr = {
>   		.index = queue_sel,
> -		.desc_user_addr = (uint64_t)(uintptr_t)vring->desc,
> -		.avail_user_addr = (uint64_t)(uintptr_t)vring->avail,
> -		.used_user_addr = (uint64_t)(uintptr_t)vring->used,
>   		.log_guest_addr = 0,
>   		.flags = 0, /* disable log */
>   	};
>   
> +	if (dev->features & (1ULL << VIRTIO_F_RING_PACKED)) {
> +		addr.desc_user_addr =
> +			(uint64_t)(uintptr_t)pq_vring->desc_packed;
> +		addr.avail_user_addr =
> +			(uint64_t)(uintptr_t)pq_vring->driver_event;
> +		addr.used_user_addr =
> +			(uint64_t)(uintptr_t)pq_vring->device_event;
> +	} else {
> +		addr.desc_user_addr = (uint64_t)(uintptr_t)vring->desc;
> +		addr.avail_user_addr = (uint64_t)(uintptr_t)vring->avail;
> +		addr.used_user_addr = (uint64_t)(uintptr_t)vring->used;
> +	}
> +
>   	state.index = queue_sel;
>   	state.num = vring->num;
>   	dev->ops->send_request(dev, VHOST_USER_SET_VRING_NUM, &state);
> @@ -467,15 +478,10 @@ virtio_user_dev_init(struct virtio_user_dev *dev, char *path, int queues,
>   	if (!in_order)
>   		dev->unsupported_features |= (1ull << VIRTIO_F_IN_ORDER);
>   
> -	if (packed_vq) {
> -		if (cq) {
> -			PMD_INIT_LOG(ERR, "control vq not supported yet with "
> -					  "packed virtqueues\n");
> -			return -1;
> -		}
> -	} else {
> +	if (packed_vq)
> +		dev->device_features |= (1ull << VIRTIO_F_RING_PACKED);
> +	else
>   		dev->unsupported_features |= (1ull << VIRTIO_F_RING_PACKED);
> -	}

I think you missed Tiwei comment on v3, i.e. this should be enough:
	if (!packed_vq)
		dev->unsupported_features |= (1ull << VIRTIO_F_RING_PACKED);



Other than that, the patch looks good to me. With above fixed, feel free
to add my:

Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>

Thanks!
Maxime

      reply	other threads:[~2019-01-11  9:13 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-10 21:47 [dpdk-dev] [PATCH v3 0/2] net/virtio-user: add packed vq support Jens Freimann
2019-01-10 21:47 ` [dpdk-dev] [Patch v3 1/2] net/virtio: check head desc with correct wrap counter Jens Freimann
2019-01-11  9:03   ` Maxime Coquelin
2019-01-10 21:47 ` [dpdk-dev] [Patch v3 2/2] net/virtio-user: ctrl vq support for packed Jens Freimann
2019-01-11  9:12   ` Maxime Coquelin [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=8455a67c-2bdb-7458-f247-3f4946cbe9e8@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=dev@dpdk.org \
    --cc=jfreimann@redhat.com \
    --cc=tiwei.bie@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).