Skip to contentSkip to conversation

vhost: fix dequeue_zero_zopy cannot be enabled

PATCH Superseded Xuan Ding 4 participants 8 messages May 12, 2020 – May 19, 2020

lore
Share & tools
lore

Xuan Ding

author
#0 lore raw

PATCH 1/1 vhost: fix dequeue_zero_zopy cannot be enabled

Use flag instead of vsocket->is_server to determine whether vhost is in client mode. Because vsocket->is_server is not ready yet.

---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1
author
#1 lore raw

PATCH v2 1/1 vhost: fix zero-copy cannot be enabled

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

---

v2:
* Added the description of problem solved in commit log.

---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1
Reviewed-by on v2 1/1
#2 lore raw

Re: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

Quoted 7 lines · Xuan Ding

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

Fixes 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")

And no need to cc stable since above commit is introduced in this release.

Quoted 26 lines

---

v2:
* Added the description of problem solved in commit log.
---
lib/librte_vhost/socket.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1
Tested-by on v2 1/1
#5 lore raw

Re: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

In reply to Xuan Ding
Quoted 42 lines

-----Original Message-----
From: dev <[email protected]> On Behalf Of Xuan Ding
Sent: 2020年5月13日 10:14
To: [email protected]; Wang, Zhihong <[email protected]>; Ye, Xiaolong <[email protected]>
Cc: [email protected]; Ding, Xuan <[email protected]>; [email protected]
Subject: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

---

v2:
* Added the description of problem solved in commit log.

---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c index renamed from lib/librte_vhost/socket.c +0 -0

bb8d0d780..0a66ef976 100644

lib/librte_vhost/socket.c +1 -1
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t
 flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client

mode\n");
ret = -1;
--
2.17.1

#3 lore raw

Re: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

In reply to Ye Xiaolong

Hi, Maxime & Ferruh

This patch is used to fix the regression caused by commit 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode") which was introduced in RC2, I think we should get it in this release.

Thanks,
Xiaolong

Quoted 41 lines · Ye Xiaolong
Quoted 7 lines · Xuan Ding

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

Fixes 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")

And no need to cc stable since above commit is introduced in this release.

Quoted 26 lines

---

v2:
* Added the description of problem solved in commit log.
---
lib/librte_vhost/socket.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1
author
#6 lore raw

PATCH v4 1/1 vhost: fix zero-copy cannot be enabled

In reply to Xuan Ding

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

Fixes 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")

---

v4:
* Added in reply to the first Message Id.

v3:
* Removed Cc to stable and added fixes label.

v2:
* Added the description of problem solved in commit log.

---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1
Applied
#7 lore raw

Re: [dpdk-dev] [PATCH v4] vhost: fix zero-copy cannot be enabled

Quoted 11 lines · Xuan Ding

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

Fixes 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")

Applied to dpdk-next-net/master, thanks.

#4 lore raw

Re: [dpdk-dev] [PATCH v2] vhost: fix zero-copy cannot be enabled

In reply to Ye Xiaolong
Quoted 5 lines · Ye Xiaolong

Hi, Maxime & Ferruh

This patch is used to fix the regression caused by commit 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode") which was introduced in RC2, I think we should get it in this release.

+1, v4 of the patch applied to next-net for -rc3

Quoted 46 lines

Thanks,
Xiaolong

Quoted 41 lines · Ye Xiaolong
Quoted 7 lines · Xuan Ding

This patch fixes the situation where vhost-user cannot start as server with dequeue_zero_copy enabled.

Using flag instead of vsocket->is_server to determine whether vhost-user is in client mode. Because vsocket->is_server is not ready at this time.

Fixes 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")

And no need to cc stable since above commit is introduced in this release.

Quoted 26 lines

---

v2:
* Added the description of problem solved in commit log.
---
lib/librte_vhost/socket.c | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
lib/librte_vhost/socket.c +1 -1
index bb8d0d780..0a66ef976 100644
@@ -926,7 +926,7 @@ rte_vhost_driver_register(const char *path, uint64_t flags)
 			ret = -1;
 			goto out_mutex;
 		}
-		if (!vsocket->is_server) {
+		if ((flags & RTE_VHOST_USER_CLIENT) != 0) {
 			VHOST_LOG_CONFIG(ERR,
 			"error: zero copy is incompatible with vhost client mode\n");
 			ret = -1;
Signature · 1 line
2.17.1