From: Thierry Herbelot <thierry.herbelot@6wind.com>
To: dev@dpdk.org
Cc: Thierry Herbelot <thierry.herbelot@6wind.com>,
Thomas Monjalon <thomas@monjalon.net>,
Maxime Coquelin <maxime.coquelin@redhat.com>,
Chenbo Xia <chenbo.xia@intel.com>,
stable@dpdk.org
Subject: [dpdk-dev] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices
Date: Fri, 23 Apr 2021 14:25:15 +0200 [thread overview]
Message-ID: <20210423122515.31078-1-thierry.herbelot@6wind.com> (raw)
Restore the original code, where VHOST_SET_MEM_TABLE is applied to
all vhostfds of the device.
Fixes: 539d910c9c768 ("net/virtio: add virtio-user memory tables ops")
Cc: stable@dpdk.org
Signed-off-by: Thierry Herbelot <thierry.herbelot@6wind.com>
---
drivers/net/virtio/virtio_user/vhost_kernel.c | 12 +++++++++---
1 file changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/net/virtio/virtio_user/vhost_kernel.c b/drivers/net/virtio/virtio_user/vhost_kernel.c
index 58e66bb7b4ae..ad46f10a9300 100644
--- a/drivers/net/virtio/virtio_user/vhost_kernel.c
+++ b/drivers/net/virtio/virtio_user/vhost_kernel.c
@@ -206,6 +206,7 @@ add_memseg_list(const struct rte_memseg_list *msl, void *arg)
static int
vhost_kernel_set_memory_table(struct virtio_user_dev *dev)
{
+ uint32_t i;
struct vhost_kernel_data *data = dev->backend_data;
struct vhost_memory_kernel *vm;
int ret;
@@ -227,9 +228,14 @@ vhost_kernel_set_memory_table(struct virtio_user_dev *dev)
if (ret < 0)
goto err_free;
- ret = vhost_kernel_ioctl(data->vhostfds[0], VHOST_SET_MEM_TABLE, vm);
- if (ret < 0)
- goto err_free;
+ for (i = 0; i < dev->max_queue_pairs; ++i) {
+ if (data->vhostfds[i] < 0)
+ continue;
+
+ ret = vhost_kernel_ioctl(data->vhostfds[i], VHOST_SET_MEM_TABLE, vm);
+ if (ret < 0)
+ goto err_free;
+ }
free(vm);
--
2.29.2
next reply other threads:[~2021-04-23 12:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-23 12:25 Thierry Herbelot [this message]
2021-04-23 14:24 ` Maxime Coquelin
2021-04-28 6:07 ` Xia, Chenbo
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=20210423122515.31078-1-thierry.herbelot@6wind.com \
--to=thierry.herbelot@6wind.com \
--cc=chenbo.xia@intel.com \
--cc=dev@dpdk.org \
--cc=maxime.coquelin@redhat.com \
--cc=stable@dpdk.org \
--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).