patches for DPDK stable branches
 help / color / mirror / Atom feed
* [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices
@ 2021-04-23 12:25 Thierry Herbelot
  2021-04-23 14:24 ` Maxime Coquelin
  2021-04-28  6:07 ` Xia, Chenbo
  0 siblings, 2 replies; 3+ messages in thread
From: Thierry Herbelot @ 2021-04-23 12:25 UTC (permalink / raw)
  To: dev
  Cc: Thierry Herbelot, Thomas Monjalon, Maxime Coquelin, Chenbo Xia, stable

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices
  2021-04-23 12:25 [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices Thierry Herbelot
@ 2021-04-23 14:24 ` Maxime Coquelin
  2021-04-28  6:07 ` Xia, Chenbo
  1 sibling, 0 replies; 3+ messages in thread
From: Maxime Coquelin @ 2021-04-23 14:24 UTC (permalink / raw)
  To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, Chenbo Xia, stable



On 4/23/21 2:25 PM, Thierry Herbelot wrote:
> 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(-)
> 

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

Thanks,
Maxime


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices
  2021-04-23 12:25 [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices Thierry Herbelot
  2021-04-23 14:24 ` Maxime Coquelin
@ 2021-04-28  6:07 ` Xia, Chenbo
  1 sibling, 0 replies; 3+ messages in thread
From: Xia, Chenbo @ 2021-04-28  6:07 UTC (permalink / raw)
  To: Thierry Herbelot, dev; +Cc: Thomas Monjalon, Maxime Coquelin, stable

> -----Original Message-----
> From: Thierry Herbelot <thierry.herbelot@6wind.com>
> Sent: Friday, April 23, 2021 8:25 PM
> To: dev@dpdk.org
> Cc: Thierry Herbelot <thierry.herbelot@6wind.com>; Thomas Monjalon
> <thomas@monjalon.net>; Maxime Coquelin <maxime.coquelin@redhat.com>; Xia,
> Chenbo <chenbo.xia@intel.com>; stable@dpdk.org
> Subject: [PATCH] net/virtio: fix kernel set memory table for multi-queue
> devices
> 
> 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>
> ---
> 2.29.2

Patch applied to next-virtio/main, Thanks


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-04-28  6:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-23 12:25 [dpdk-stable] [PATCH] net/virtio: fix kernel set memory table for multi-queue devices Thierry Herbelot
2021-04-23 14:24 ` Maxime Coquelin
2021-04-28  6:07 ` Xia, Chenbo

patches for DPDK stable branches

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://inbox.dpdk.org/stable/0 stable/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 stable stable/ https://inbox.dpdk.org/stable \
		stable@dpdk.org
	public-inbox-index stable

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://inbox.dpdk.org/inbox.dpdk.stable


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git