[v4] examples/vhost: fix failure to launch dpdk-vhost

Message ID 20211103141719.221486-1-wenwux.ma@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Maxime Coquelin
Headers
Series [v4] examples/vhost: fix failure to launch dpdk-vhost |

Checks

Context Check Description
ci/checkpatch warning coding style issues
ci/iol-broadcom-Functional success Functional Testing PASS
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-broadcom-Performance success Performance Testing PASS
ci/iol-aarch64-unit-testing success Testing PASS
ci/github-robot: build success github build: passed
ci/Intel-compilation success Compilation OK
ci/intel-Testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-unit-testing fail Testing issues

Commit Message

Ma, WenwuX Nov. 3, 2021, 2:17 p.m. UTC
  When the default max queue value of vhost is 128, dpdk-vhost will fail to
launch with a 40G i40e port due to the mbuf allocation of the port queue fails.
Therefore, we modify the default value of max queue from 128 to 512,
it will ensure that there are enough mbufs.

Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
Cc: stable@dpdk.org

Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
---
 examples/vhost/main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Chenbo Xia Nov. 3, 2021, 4:58 a.m. UTC | #1
Hi,

> -----Original Message-----
> From: Ma, WenwuX <wenwux.ma@intel.com>
> Sent: Wednesday, November 3, 2021 10:17 PM
> To: dev@dpdk.org
> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Yigit,
> Ferruh <ferruh.yigit@intel.com>; Jiang, Cheng1 <cheng1.jiang@intel.com>; Hu,
> Jiayu <jiayu.hu@intel.com>; Yang, YvonneX <yvonnex.yang@intel.com>; Ma, WenwuX
> <wenwux.ma@intel.com>; stable@dpdk.org
> Subject: [PATCH v4] examples/vhost: fix failure to launch dpdk-vhost
> 
> When the default max queue value of vhost is 128, dpdk-vhost will fail to
> launch with a 40G i40e port due to the mbuf allocation of the port queue fails.
> Therefore, we modify the default value of max queue from 128 to 512,
> it will ensure that there are enough mbufs.
> 
> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
> Cc: stable@dpdk.org

When I was tracking the bad commit, I notice this change is on purpose to save hugepages:

commit f17eb179046962fdc29c3609b1c9bd46bfefa4f5
Author: Bernard Iremonger <bernard.iremonger@intel.com>
Date:   Thu Dec 10 15:49:17 2015 +0000

    examples/vhost: reduce number of hugepages needed

    Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed.
    Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages
    required by the vhost-switch program.

    To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable,
    before building the application.

    Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
    Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>

So as there's a way to solve the problem (although not perfect), I would suggest
using the compiler flag to do tests with the specific NIC.

If no one has objection, let's drop the patch.

Thanks,
Chenbo

> 
> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
> ---
>  examples/vhost/main.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
> index bc3d71c898..36969a4de5 100644
> --- a/examples/vhost/main.c
> +++ b/examples/vhost/main.c
> @@ -29,7 +29,7 @@
>  #include "main.h"
> 
>  #ifndef MAX_QUEUES
> -#define MAX_QUEUES 128
> +#define MAX_QUEUES 512
>  #endif
> 
>  /* the maximum number of external ports supported */
> --
> 2.25.1
  
Maxime Coquelin Nov. 3, 2021, 8:07 a.m. UTC | #2
Hi Chenbo,

On 11/3/21 05:58, Xia, Chenbo wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Ma, WenwuX <wenwux.ma@intel.com>
>> Sent: Wednesday, November 3, 2021 10:17 PM
>> To: dev@dpdk.org
>> Cc: maxime.coquelin@redhat.com; Xia, Chenbo <chenbo.xia@intel.com>; Yigit,
>> Ferruh <ferruh.yigit@intel.com>; Jiang, Cheng1 <cheng1.jiang@intel.com>; Hu,
>> Jiayu <jiayu.hu@intel.com>; Yang, YvonneX <yvonnex.yang@intel.com>; Ma, WenwuX
>> <wenwux.ma@intel.com>; stable@dpdk.org
>> Subject: [PATCH v4] examples/vhost: fix failure to launch dpdk-vhost
>>
>> When the default max queue value of vhost is 128, dpdk-vhost will fail to
>> launch with a 40G i40e port due to the mbuf allocation of the port queue fails.
>> Therefore, we modify the default value of max queue from 128 to 512,
>> it will ensure that there are enough mbufs.
>>
>> Fixes: 4796ad63ba1f ("examples/vhost: import userspace vhost application")
>> Cc: stable@dpdk.org
> 
> When I was tracking the bad commit, I notice this change is on purpose to save hugepages:
> 
> commit f17eb179046962fdc29c3609b1c9bd46bfefa4f5
> Author: Bernard Iremonger <bernard.iremonger@intel.com>
> Date:   Thu Dec 10 15:49:17 2015 +0000
> 
>      examples/vhost: reduce number of hugepages needed
> 
>      Add #ifndef MAX_QUEUES to change MAX_QUEUES at compile time if needed.
>      Change MAX_QUEUES from 512 to 128 to reduce the number of hugepages
>      required by the vhost-switch program.
> 
>      To change MAX_QUEUES add '-D MAX_QUEUES=512' to the EXTRA_CFLAGS variable,
>      before building the application.
> 
>      Signed-off-by: Bernard Iremonger <bernard.iremonger@intel.com>
>      Acked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>
> 
> So as there's a way to solve the problem (although not perfect), I would suggest
> using the compiler flag to do tests with the specific NIC.
> 
> If no one has objection, let's drop the patch.

I agree, let's drop it.

Thanks,
Maxime
> Thanks,
> Chenbo
> 
>>
>> Signed-off-by: Wenwu Ma <wenwux.ma@intel.com>
>> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
>> ---
>>   examples/vhost/main.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/examples/vhost/main.c b/examples/vhost/main.c
>> index bc3d71c898..36969a4de5 100644
>> --- a/examples/vhost/main.c
>> +++ b/examples/vhost/main.c
>> @@ -29,7 +29,7 @@
>>   #include "main.h"
>>
>>   #ifndef MAX_QUEUES
>> -#define MAX_QUEUES 128
>> +#define MAX_QUEUES 512
>>   #endif
>>
>>   /* the maximum number of external ports supported */
>> --
>> 2.25.1
>
  

Patch

diff --git a/examples/vhost/main.c b/examples/vhost/main.c
index bc3d71c898..36969a4de5 100644
--- a/examples/vhost/main.c
+++ b/examples/vhost/main.c
@@ -29,7 +29,7 @@ 
 #include "main.h"
 
 #ifndef MAX_QUEUES
-#define MAX_QUEUES 128
+#define MAX_QUEUES 512
 #endif
 
 /* the maximum number of external ports supported */