DPDK patches and discussions
 help / color / mirror / Atom feed
From: Maxime Coquelin <maxime.coquelin@redhat.com>
To: Thierry Herbelot <thierry.herbelot@6wind.com>, dev@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>, Chenbo Xia <chenbo.xia@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix vhost_kernel_set_owner for multi-queue devices
Date: Tue, 13 Apr 2021 10:45:37 +0200	[thread overview]
Message-ID: <50803007-9628-e23c-001f-77d8fee3b571@redhat.com> (raw)
In-Reply-To: <20210408123729.9884-1-thierry.herbelot@6wind.com>

Hi Thierry,

On 4/8/21 2:37 PM, Thierry Herbelot wrote:
> Restore the original code, where VHOST_SET_OWNER is applied to
> all vhostfds of the device.
> 
> Fixes: 06856cabb89b0 ("net/virtio: add virtio-user ops to set owner")
> Cc: Maxime Coquelin <maxime.coquelin@redhat.com>
> Cc: Chenbo Xia <chenbo.xia@intel.com>
> Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
> ---
>  drivers/net/virtio/virtio_user/vhost_kernel.c | 13 ++++++++++++-
>  1 file changed, 12 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c
> index 768db55a6c1f..58e66bb7b4ae 100644
> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c
> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c
> @@ -101,9 +101,20 @@ vhost_kernel_ioctl(int fd, uint64_t request, void *arg)
>  static int
>  vhost_kernel_set_owner(struct virtio_user_dev *dev)
>  {
> +	int ret;
> +	uint32_t i;
>  	struct vhost_kernel_data *data = dev->backend_data;
>  
> -	return vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_OWNER, NULL);
> +	for (i = 0; i < dev->max_queue_pairs; ++i) {
> +		if (data->vhostfds[i] < 0)
> +			continue;
> +
> +		ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_OWNER, NULL);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
> +	return 0;
>  }
>  
>  static int
> 

Thanks for the fix, we indeed have to set owner for all the queue pairs.

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

Thanks,
Maxime


  reply	other threads:[~2021-04-13  8:45 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-08 12:37 Thierry Herbelot
2021-04-13  8:45 ` Maxime Coquelin [this message]
2021-04-15 12:48   ` Ferruh Yigit

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=50803007-9628-e23c-001f-77d8fee3b571@redhat.com \
    --to=maxime.coquelin@redhat.com \
    --cc=chenbo.xia@intel.com \
    --cc=dev@dpdk.org \
    --cc=thierry.herbelot@6wind.com \
    --cc=thomas@monjalon.net \
    /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).