From: Maxime Coquelin <mcoqueli@redhat.com>
To: Thierry Herbelot <thierry.herbelot@6wind.com>, dev@dpdk.org
Cc: Thomas Monjalon <thomas@monjalon.net>,
stable@dpdk.org, Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>
Subject: Re: [dpdk-dev] [PATCH] net/virtio: fix kernel set features for multi-queue devices
Date: Tue, 1 Jun 2021 09:51:37 +0200 [thread overview]
Message-ID: <c50762a9-4184-45b3-3f1d-f517d8216258@redhat.com> (raw)
In-Reply-To: <20210528132038.26464-1-thierry.herbelot@6wind.com>
On 5/28/21 3:20 PM, Thierry Herbelot wrote:
> Restore the original code, where VHOST_SET_FEATURES is applied to
> all vhostfds of the device.
>
> Fixes: cc0151b34dee ("net/virtio: add virtio-user features ops")
> Cc: stable@dpdk.org
> 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 ad46f10a9300..d65f89e1fc16 100644
> --- a/drivers/net/virtio/virtio_user/vhost_kernel.c
> +++ b/drivers/net/virtio/virtio_user/vhost_kernel.c
> @@ -158,6 +158,8 @@ static int
> vhost_kernel_set_features(struct virtio_user_dev *dev, uint64_t features)
> {
> struct vhost_kernel_data *data = dev->backend_data;
> + uint32_t i;
> + int ret;
>
> /* We don't need memory protection here */
> features &= ~(1ULL << VIRTIO_F_IOMMU_PLATFORM);
> @@ -166,7 +168,16 @@ vhost_kernel_set_features(struct virtio_user_dev *dev, uint64_t features)
> features &= ~VHOST_KERNEL_HOST_OFFLOADS_MASK;
> features &= ~(1ULL << VIRTIO_NET_F_MQ);
>
> - return vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_FEATURES, &features);
> + for (i = 0; i < dev->max_queue_pairs; ++i) {
> + if (data->vhostfds[i] < 0)
> + continue;
> +
> + ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_FEATURES, &features);
> + if (ret < 0)
> + return ret;
> + }
> +
> + return 0;
> }
>
> static int
>
Thanks for fixing it, it should be the last one...
Except GET_FEATURES that was also queried for every queue pair, but I
don't think it makes sense to query it and just drop the value read.
What do you think?
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
Thanks,
Maxime
next prev parent reply other threads:[~2021-06-01 7:51 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-28 13:20 Thierry Herbelot
2021-06-01 7:51 ` Maxime Coquelin [this message]
2021-06-01 7:54 ` Thierry Herbelot
2021-06-17 16:49 ` 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=c50762a9-4184-45b3-3f1d-f517d8216258@redhat.com \
--to=mcoqueli@redhat.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@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).