[v2] vhost: fix zero-copy cannot be enabled

Message ID 20200513021410.98031-1-xuan.ding@intel.com (mailing list archive)
State Superseded, archived
Delegated to: Maxime Coquelin
Headers
Series [v2] vhost: fix zero-copy cannot be enabled |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail Compilation issues
ci/travis-robot warning Travis build: failed
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-nxp-Performance success Performance Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing fail Testing issues

Commit Message

Ding, Xuan May 13, 2020, 2:14 a.m. UTC
  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.

Cc: stable@dpdk.org

Signed-off-by: Xuan Ding <xuan.ding@intel.com>
---

v2:
* Added the description of problem solved in commit log.
---
 lib/librte_vhost/socket.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Xiaolong Ye May 19, 2020, 6:28 a.m. UTC | #1
On 05/13, Xuan Ding wrote:
>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.
>
>Cc: stable@dpdk.org

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

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

>
>Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>---
>
>v2:
>* Added the description of problem solved in commit log.
>---
> lib/librte_vhost/socket.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
>diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
>index bb8d0d780..0a66ef976 100644
>--- a/lib/librte_vhost/socket.c
>+++ b/lib/librte_vhost/socket.c
>@@ -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
>

Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  
Wang, Yinan May 19, 2020, 7:03 a.m. UTC | #2
Tested-by: Wang, Yinan <yinan.wang@intel.com>

> -----Original Message-----
> From: dev <dev-bounces@dpdk.org> On Behalf Of Xuan Ding
> Sent: 2020年5月13日 10:14
> To: maxime.coquelin@redhat.com; Wang, Zhihong <zhihong.wang@intel.com>;
> Ye, Xiaolong <xiaolong.ye@intel.com>
> Cc: dev@dpdk.org; Ding, Xuan <Xuan.Ding@intel.com>; stable@dpdk.org
> 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.
> 
> Cc: stable@dpdk.org
> 
> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
> ---
> 
> v2:
> * Added the description of problem solved in commit log.
> ---
>  lib/librte_vhost/socket.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c index
> bb8d0d780..0a66ef976 100644
> --- a/lib/librte_vhost/socket.c
> +++ b/lib/librte_vhost/socket.c
> @@ -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
  
Xiaolong Ye May 19, 2020, 7:13 a.m. UTC | #3
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

On 05/19, Ye Xiaolong wrote:
>On 05/13, Xuan Ding wrote:
>>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.
>>
>>Cc: stable@dpdk.org
>
>Fixes: 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")
>
>And no need to cc stable since above commit is introduced in this release.
>
>>
>>Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>---
>>
>>v2:
>>* Added the description of problem solved in commit log.
>>---
>> lib/librte_vhost/socket.c | 2 +-
>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>
>>diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
>>index bb8d0d780..0a66ef976 100644
>>--- a/lib/librte_vhost/socket.c
>>+++ b/lib/librte_vhost/socket.c
>>@@ -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
>>
>
>Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  
Ferruh Yigit May 19, 2020, 1:43 p.m. UTC | #4
On 5/19/2020 8:13 AM, Ye Xiaolong wrote:
> 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

> 
> Thanks,
> Xiaolong
> 
> On 05/19, Ye Xiaolong wrote:
>> On 05/13, Xuan Ding wrote:
>>> 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.
>>>
>>> Cc: stable@dpdk.org
>>
>> Fixes: 715070ea10e6 ("vhost: prevent zero-copy with incompatible client mode")
>>
>> And no need to cc stable since above commit is introduced in this release.
>>
>>>
>>> Signed-off-by: Xuan Ding <xuan.ding@intel.com>
>>> ---
>>>
>>> v2:
>>> * Added the description of problem solved in commit log.
>>> ---
>>> lib/librte_vhost/socket.c | 2 +-
>>> 1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
>>> index bb8d0d780..0a66ef976 100644
>>> --- a/lib/librte_vhost/socket.c
>>> +++ b/lib/librte_vhost/socket.c
>>> @@ -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
>>>
>>
>> Reviewed-by: Xiaolong Ye <xiaolong.ye@intel.com>
  

Patch

diff --git a/lib/librte_vhost/socket.c b/lib/librte_vhost/socket.c
index bb8d0d780..0a66ef976 100644
--- a/lib/librte_vhost/socket.c
+++ b/lib/librte_vhost/socket.c
@@ -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;