[dpdk-dev,2/3] app/testpmd: support command echo in CLI batch loading

Message ID 20171115154545.8936-3-xuemingl@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Xueming Li Nov. 15, 2017, 3:45 p.m. UTC
  Use first bit of verbose_level to enable CLI echo of batch loading.

Signed-off-by: Xueming Li <xuemingl@mellanox.com>
---
 app/test-pmd/cmdline.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Burakov, Anatoly Dec. 11, 2017, 12:36 p.m. UTC | #1
On 15-Nov-17 3:45 PM, Xueming Li wrote:
> Use first bit of verbose_level to enable CLI echo of batch loading.
> 
> Signed-off-by: Xueming Li <xuemingl@mellanox.com>
> ---
>   app/test-pmd/cmdline.c | 3 ++-
>   1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index f5a483ad7..b40fe1ac7 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -15853,7 +15853,8 @@ cmdline_read_from_file(const char *filename)
>   {
>   	struct cmdline *cl;
>   
> -	cl = cmdline_file_new(main_ctx, "testpmd> ", filename);
> +	cl = cmdline_file_new(main_ctx, "testpmd> ", filename,
> +			      verbose_level & 0x8000);
>   	if (cl == NULL) {
>   		printf("Failed to create file based cmdline context: %s\n",
>   		       filename);
> 

I don't see verbose_level being used in testpmd other than checking if 
it's zero, so maybe just verbose level >= 2 instead of highest 
significant bit?
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index f5a483ad7..b40fe1ac7 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -15853,7 +15853,8 @@  cmdline_read_from_file(const char *filename)
 {
 	struct cmdline *cl;
 
-	cl = cmdline_file_new(main_ctx, "testpmd> ", filename);
+	cl = cmdline_file_new(main_ctx, "testpmd> ", filename,
+			      verbose_level & 0x8000);
 	if (cl == NULL) {
 		printf("Failed to create file based cmdline context: %s\n",
 		       filename);