* [dpdk-dev] [PATCH 0/3] enable echo when CLI loading from file @ 2017-11-15 15:45 Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li ` (2 more replies) 0 siblings, 3 replies; 14+ messages in thread From: Xueming Li @ 2017-11-15 15:45 UTC (permalink / raw) To: Olivier Matz, Jingjing Wu; +Cc: Xueming Li, dev Current "load" command load CLI batch from file and run in silent. This patch set use highest bit of verbose level to enable CLI echo. This will be very helpful to run a set of CLI from file and know which one prints out error message. Xueming Li (3): lib/cmdline: add echo support in batch loading from file app/testpmd: support command echo in CLI batch loading test: update batch loading test app/test-pmd/cmdline.c | 3 ++- lib/librte_cmdline/cmdline_socket.c | 5 +++-- lib/librte_cmdline/cmdline_socket.h | 3 ++- test/test/test_cmdline_lib.c | 10 +++++----- 4 files changed, 12 insertions(+), 9 deletions(-) -- 2.13.3 ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch loading from file 2017-11-15 15:45 [dpdk-dev] [PATCH 0/3] enable echo when CLI loading from file Xueming Li @ 2017-11-15 15:45 ` Xueming Li 2017-12-11 12:29 ` Burakov, Anatoly ` (2 more replies) 2017-11-15 15:45 ` [dpdk-dev] [PATCH 2/3] " Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 3/3] test: update batch loading test Xueming Li 2 siblings, 3 replies; 14+ messages in thread From: Xueming Li @ 2017-11-15 15:45 UTC (permalink / raw) To: Olivier Matz, Jingjing Wu; +Cc: Xueming Li, dev Add echo option to echo commandline to screen when running loaded scripts from file. Signed-off-by: Xueming Li <xuemingl@mellanox.com> --- lib/librte_cmdline/cmdline_socket.c | 5 +++-- lib/librte_cmdline/cmdline_socket.h | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/librte_cmdline/cmdline_socket.c b/lib/librte_cmdline/cmdline_socket.c index 3fc243b70..e57ddeffb 100644 --- a/lib/librte_cmdline/cmdline_socket.c +++ b/lib/librte_cmdline/cmdline_socket.c @@ -73,7 +73,8 @@ #include "cmdline.h" struct cmdline * -cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) +cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path, + int echo) { int fd; @@ -86,7 +87,7 @@ cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) dprintf("open() failed\n"); return NULL; } - return cmdline_new(ctx, prompt, fd, -1); + return cmdline_new(ctx, prompt, fd, echo ? 1 : -1); } struct cmdline * diff --git a/lib/librte_cmdline/cmdline_socket.h b/lib/librte_cmdline/cmdline_socket.h index aa6068e7e..208134b12 100644 --- a/lib/librte_cmdline/cmdline_socket.h +++ b/lib/librte_cmdline/cmdline_socket.h @@ -68,7 +68,8 @@ extern "C" { #endif -struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path); +struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, + const char *path, int echo); struct cmdline *cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt); void cmdline_stdin_exit(struct cmdline *cl); -- 2.13.3 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch loading from file 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li @ 2017-12-11 12:29 ` Burakov, Anatoly 2017-12-19 10:30 ` Olivier MATZ 2017-12-26 14:25 ` [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading Xueming Li 2 siblings, 0 replies; 14+ messages in thread From: Burakov, Anatoly @ 2017-12-11 12:29 UTC (permalink / raw) To: Xueming Li, Olivier Matz, Jingjing Wu; +Cc: dev On 15-Nov-17 3:45 PM, Xueming Li wrote: > Add echo option to echo commandline to screen when running loaded > scripts from file. > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > --- <...snip...> > @@ -86,7 +87,7 @@ cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) > dprintf("open() failed\n"); > return NULL; > } > - return cmdline_new(ctx, prompt, fd, -1); > + return cmdline_new(ctx, prompt, fd, echo ? 1 : -1); This should probably be "echo ? STDOUT_FILENO : -1", to make the intention clearer. > -- Thanks, Anatoly ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch loading from file 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li 2017-12-11 12:29 ` Burakov, Anatoly @ 2017-12-19 10:30 ` Olivier MATZ 2017-12-19 11:20 ` Xueming(Steven) Li 2017-12-26 14:25 ` [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading Xueming Li 2 siblings, 1 reply; 14+ messages in thread From: Olivier MATZ @ 2017-12-19 10:30 UTC (permalink / raw) To: Xueming Li; +Cc: Jingjing Wu, dev Hi Xueming, On Wed, Nov 15, 2017 at 11:45:43PM +0800, Xueming Li wrote: > Add echo option to echo commandline to screen when running loaded > scripts from file. > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > --- > lib/librte_cmdline/cmdline_socket.c | 5 +++-- > lib/librte_cmdline/cmdline_socket.h | 3 ++- > 2 files changed, 5 insertions(+), 3 deletions(-) > > diff --git a/lib/librte_cmdline/cmdline_socket.c b/lib/librte_cmdline/cmdline_socket.c > index 3fc243b70..e57ddeffb 100644 > --- a/lib/librte_cmdline/cmdline_socket.c > +++ b/lib/librte_cmdline/cmdline_socket.c > @@ -73,7 +73,8 @@ > #include "cmdline.h" > > struct cmdline * > -cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) > +cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path, > + int echo) > { > int fd; > > @@ -86,7 +87,7 @@ cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path) > dprintf("open() failed\n"); > return NULL; > } > - return cmdline_new(ctx, prompt, fd, -1); > + return cmdline_new(ctx, prompt, fd, echo ? 1 : -1); > } > > struct cmdline * > diff --git a/lib/librte_cmdline/cmdline_socket.h b/lib/librte_cmdline/cmdline_socket.h > index aa6068e7e..208134b12 100644 > --- a/lib/librte_cmdline/cmdline_socket.h > +++ b/lib/librte_cmdline/cmdline_socket.h > @@ -68,7 +68,8 @@ > extern "C" { > #endif > > -struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const char *path); > +struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, > + const char *path, int echo); > struct cmdline *cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const char *prompt); > void cmdline_stdin_exit(struct cmdline *cl); This breaks the API and ABI. And it also breaks the compilation, because the modifications of applications are done in the next commits. You can send a deprecation notice, and this patch could be added in for 18.05. But instead, I suggest you to reimplement your own version of cmdline_file_new() with the echo feature inside testpmd. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch loading from file 2017-12-19 10:30 ` Olivier MATZ @ 2017-12-19 11:20 ` Xueming(Steven) Li 0 siblings, 0 replies; 14+ messages in thread From: Xueming(Steven) Li @ 2017-12-19 11:20 UTC (permalink / raw) To: Olivier MATZ; +Cc: Jingjing Wu, dev The idea of implementation in testpmd looks good, thanks! Then I will combine all patches in v1 to avoid breaking build. > -----Original Message----- > From: Olivier MATZ [mailto:olivier.matz@6wind.com] > Sent: Tuesday, December 19, 2017 6:31 PM > To: Xueming(Steven) Li <xuemingl@mellanox.com> > Cc: Jingjing Wu <jingjing.wu@intel.com>; dev@dpdk.org > Subject: Re: [PATCH 1/3] lib/cmdline: add echo support in batch loading > from file > > Hi Xueming, > > On Wed, Nov 15, 2017 at 11:45:43PM +0800, Xueming Li wrote: > > Add echo option to echo commandline to screen when running loaded > > scripts from file. > > > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > > --- > > lib/librte_cmdline/cmdline_socket.c | 5 +++-- > > lib/librte_cmdline/cmdline_socket.h | 3 ++- > > 2 files changed, 5 insertions(+), 3 deletions(-) > > > > diff --git a/lib/librte_cmdline/cmdline_socket.c > > b/lib/librte_cmdline/cmdline_socket.c > > index 3fc243b70..e57ddeffb 100644 > > --- a/lib/librte_cmdline/cmdline_socket.c > > +++ b/lib/librte_cmdline/cmdline_socket.c > > @@ -73,7 +73,8 @@ > > #include "cmdline.h" > > > > struct cmdline * > > -cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const > > char *path) > > +cmdline_file_new(cmdline_parse_ctx_t *ctx, const char *prompt, const > char *path, > > + int echo) > > { > > int fd; > > > > @@ -86,7 +87,7 @@ cmdline_file_new(cmdline_parse_ctx_t *ctx, const char > *prompt, const char *path) > > dprintf("open() failed\n"); > > return NULL; > > } > > - return cmdline_new(ctx, prompt, fd, -1); > > + return cmdline_new(ctx, prompt, fd, echo ? 1 : -1); > > } > > > > struct cmdline * > > diff --git a/lib/librte_cmdline/cmdline_socket.h > > b/lib/librte_cmdline/cmdline_socket.h > > index aa6068e7e..208134b12 100644 > > --- a/lib/librte_cmdline/cmdline_socket.h > > +++ b/lib/librte_cmdline/cmdline_socket.h > > @@ -68,7 +68,8 @@ > > extern "C" { > > #endif > > > > -struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char > > *prompt, const char *path); > > +struct cmdline *cmdline_file_new(cmdline_parse_ctx_t *ctx, const char > *prompt, > > + const char *path, int echo); > > struct cmdline *cmdline_stdin_new(cmdline_parse_ctx_t *ctx, const > > char *prompt); void cmdline_stdin_exit(struct cmdline *cl); > > This breaks the API and ABI. > And it also breaks the compilation, because the modifications of > applications are done in the next commits. > > You can send a deprecation notice, and this patch could be added in for > 18.05. > > But instead, I suggest you to reimplement your own version of > cmdline_file_new() with the echo feature inside testpmd. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li 2017-12-11 12:29 ` Burakov, Anatoly 2017-12-19 10:30 ` Olivier MATZ @ 2017-12-26 14:25 ` Xueming Li 2018-01-10 8:35 ` Lu, Wenzhuo 2 siblings, 1 reply; 14+ messages in thread From: Xueming Li @ 2017-12-26 14:25 UTC (permalink / raw) Cc: Xueming Li, Jingjing Wu, dev, Olivier MATZ, Burakov Anatoly 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 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c index f71d96301..0c58dea7b 100644 --- a/app/test-pmd/cmdline.c +++ b/app/test-pmd/cmdline.c @@ -40,6 +40,7 @@ #include <termios.h> #include <unistd.h> #include <inttypes.h> +#include <fcntl.h> #ifndef __linux__ #ifndef __FreeBSD__ #include <net/socket.h> @@ -15776,9 +15777,19 @@ cmdline_parse_ctx_t main_ctx[] = { void cmdline_read_from_file(const char *filename) { + int fd; struct cmdline *cl; - cl = cmdline_file_new(main_ctx, "testpmd> ", filename); + if (!filename) + return; + fd = open(filename, O_RDONLY, 0); + if (fd < 0) { + printf("File open() failed\n"); + return; + } + + cl = cmdline_new(main_ctx, "testpmd> ", fd, + verbose_level & 0x8000 ? STDOUT_FILENO : -1); if (cl == NULL) { printf("Failed to create file based cmdline context: %s\n", filename); -- 2.13.3 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading 2017-12-26 14:25 ` [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading Xueming Li @ 2018-01-10 8:35 ` Lu, Wenzhuo 2018-01-10 8:51 ` Xueming(Steven) Li 0 siblings, 1 reply; 14+ messages in thread From: Lu, Wenzhuo @ 2018-01-10 8:35 UTC (permalink / raw) To: Xueming Li; +Cc: Wu, Jingjing, dev, Olivier MATZ, Burakov, Anatoly Hi Xueming, > -----Original Message----- > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li > Sent: Tuesday, December 26, 2017 10:26 PM > Cc: Xueming Li <xuemingl@mellanox.com>; Wu, Jingjing > <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > Subject: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI > batch loading > > Use first bit of verbose_level to enable CLI echo of batch loading. After this patch, the first bit of verbose_level is ambiguous. It can still enable/disable the log print. Is it by design? ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading 2018-01-10 8:35 ` Lu, Wenzhuo @ 2018-01-10 8:51 ` Xueming(Steven) Li 2018-01-10 12:25 ` Lu, Wenzhuo 0 siblings, 1 reply; 14+ messages in thread From: Xueming(Steven) Li @ 2018-01-10 8:51 UTC (permalink / raw) To: Lu, Wenzhuo; +Cc: Wu, Jingjing, dev, Olivier MATZ, Burakov, Anatoly > -----Original Message----- > From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com] > Sent: Wednesday, January 10, 2018 4:36 PM > To: Xueming(Steven) Li <xuemingl@mellanox.com> > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in > CLI batch loading > > Hi Xueming, > > > -----Original Message----- > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li > > Sent: Tuesday, December 26, 2017 10:26 PM > > Cc: Xueming Li <xuemingl@mellanox.com>; Wu, Jingjing > > <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > > Subject: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in > > CLI batch loading > > > > Use first bit of verbose_level to enable CLI echo of batch loading. > After this patch, the first bit of verbose_level is ambiguous. It can > still enable/disable the log print. > Is it by design? You are correct, there are some code in testpmd simply testing verbose>0. How about changing all the test to: verbose & 1? I have another patchset using other bits of verbose... ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading 2018-01-10 8:51 ` Xueming(Steven) Li @ 2018-01-10 12:25 ` Lu, Wenzhuo 2018-01-10 14:14 ` Xueming(Steven) Li 0 siblings, 1 reply; 14+ messages in thread From: Lu, Wenzhuo @ 2018-01-10 12:25 UTC (permalink / raw) To: Xueming(Steven) Li; +Cc: Wu, Jingjing, dev, Olivier MATZ, Burakov, Anatoly Hi Xueming, > -----Original Message----- > From: Xueming(Steven) Li [mailto:xuemingl@mellanox.com] > Sent: Wednesday, January 10, 2018 4:52 PM > To: Lu, Wenzhuo <wenzhuo.lu@intel.com> > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in > CLI batch loading > > > > -----Original Message----- > > From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com] > > Sent: Wednesday, January 10, 2018 4:36 PM > > To: Xueming(Steven) Li <xuemingl@mellanox.com> > > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo > > in CLI batch loading > > > > Hi Xueming, > > > > > -----Original Message----- > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li > > > Sent: Tuesday, December 26, 2017 10:26 PM > > > Cc: Xueming Li <xuemingl@mellanox.com>; Wu, Jingjing > > > <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > > <olivier.matz@6wind.com>; Burakov, Anatoly > > > <anatoly.burakov@intel.com> > > > Subject: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in > > > CLI batch loading > > > > > > Use first bit of verbose_level to enable CLI echo of batch loading. > > After this patch, the first bit of verbose_level is ambiguous. It can > > still enable/disable the log print. > > Is it by design? > You are correct, there are some code in testpmd simply testing verbose>0. > How about changing all the test to: verbose & 1? I have another patchset > using other bits of verbose... I don't object to give more meaning to verbose. Agree with "verbose & 1". As you said, now only 0 and 1 has meaning. Don't forget to comment this variable carefully. And also update the doc 'testpmd_funcs.rst' to let the users know how to use the new functions of this CLI 'set verbose (level)'. ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading 2018-01-10 12:25 ` Lu, Wenzhuo @ 2018-01-10 14:14 ` Xueming(Steven) Li 0 siblings, 0 replies; 14+ messages in thread From: Xueming(Steven) Li @ 2018-01-10 14:14 UTC (permalink / raw) To: Lu, Wenzhuo; +Cc: Wu, Jingjing, dev, Olivier MATZ, Burakov, Anatoly Hi Wenzhuo, Thanks for your suggestion, will update later. Regards, Xueming > -----Original Message----- > From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com] > Sent: Wednesday, January 10, 2018 8:26 PM > To: Xueming(Steven) Li <xuemingl@mellanox.com> > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo in > CLI batch loading > > Hi Xueming, > > > -----Original Message----- > > From: Xueming(Steven) Li [mailto:xuemingl@mellanox.com] > > Sent: Wednesday, January 10, 2018 4:52 PM > > To: Lu, Wenzhuo <wenzhuo.lu@intel.com> > > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > <olivier.matz@6wind.com>; Burakov, Anatoly <anatoly.burakov@intel.com> > > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo > > in CLI batch loading > > > > > > > -----Original Message----- > > > From: Lu, Wenzhuo [mailto:wenzhuo.lu@intel.com] > > > Sent: Wednesday, January 10, 2018 4:36 PM > > > To: Xueming(Steven) Li <xuemingl@mellanox.com> > > > Cc: Wu, Jingjing <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > > <olivier.matz@6wind.com>; Burakov, Anatoly > > > <anatoly.burakov@intel.com> > > > Subject: RE: [dpdk-dev] [PATCH v1] app/testpmd: support command echo > > > in CLI batch loading > > > > > > Hi Xueming, > > > > > > > -----Original Message----- > > > > From: dev [mailto:dev-bounces@dpdk.org] On Behalf Of Xueming Li > > > > Sent: Tuesday, December 26, 2017 10:26 PM > > > > Cc: Xueming Li <xuemingl@mellanox.com>; Wu, Jingjing > > > > <jingjing.wu@intel.com>; dev@dpdk.org; Olivier MATZ > > > > <olivier.matz@6wind.com>; Burakov, Anatoly > > > > <anatoly.burakov@intel.com> > > > > Subject: [dpdk-dev] [PATCH v1] app/testpmd: support command echo > > > > in CLI batch loading > > > > > > > > Use first bit of verbose_level to enable CLI echo of batch loading. > > > After this patch, the first bit of verbose_level is ambiguous. It > > > can still enable/disable the log print. > > > Is it by design? > > You are correct, there are some code in testpmd simply testing verbose>0. > > How about changing all the test to: verbose & 1? I have another > > patchset using other bits of verbose... > I don't object to give more meaning to verbose. Agree with "verbose & 1". > As you said, now only 0 and 1 has meaning. > Don't forget to comment this variable carefully. And also update the doc > 'testpmd_funcs.rst' to let the users know how to use the new functions of > this CLI 'set verbose (level)'. ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 2/3] app/testpmd: support command echo in CLI batch loading 2017-11-15 15:45 [dpdk-dev] [PATCH 0/3] enable echo when CLI loading from file Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li @ 2017-11-15 15:45 ` Xueming Li 2017-12-11 12:36 ` Burakov, Anatoly 2017-11-15 15:45 ` [dpdk-dev] [PATCH 3/3] test: update batch loading test Xueming Li 2 siblings, 1 reply; 14+ messages in thread From: Xueming Li @ 2017-11-15 15:45 UTC (permalink / raw) To: Olivier Matz, Jingjing Wu; +Cc: Xueming Li, dev 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); -- 2.13.3 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 2/3] app/testpmd: support command echo in CLI batch loading 2017-11-15 15:45 ` [dpdk-dev] [PATCH 2/3] " Xueming Li @ 2017-12-11 12:36 ` Burakov, Anatoly 0 siblings, 0 replies; 14+ messages in thread From: Burakov, Anatoly @ 2017-12-11 12:36 UTC (permalink / raw) To: dev 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? -- Thanks, Anatoly ^ permalink raw reply [flat|nested] 14+ messages in thread
* [dpdk-dev] [PATCH 3/3] test: update batch loading test 2017-11-15 15:45 [dpdk-dev] [PATCH 0/3] enable echo when CLI loading from file Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 2/3] " Xueming Li @ 2017-11-15 15:45 ` Xueming Li 2017-12-11 12:33 ` Burakov, Anatoly 2 siblings, 1 reply; 14+ messages in thread From: Xueming Li @ 2017-11-15 15:45 UTC (permalink / raw) To: Olivier Matz, Jingjing Wu; +Cc: Xueming Li, dev Support echo back in batch loading. Signed-off-by: Xueming Li <xuemingl@mellanox.com> --- test/test/test_cmdline_lib.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/test/test/test_cmdline_lib.c b/test/test/test_cmdline_lib.c index 65b823a72..c700671d1 100644 --- a/test/test/test_cmdline_lib.c +++ b/test/test/test_cmdline_lib.c @@ -165,17 +165,17 @@ test_cmdline_socket_fns(void) goto error; if (cmdline_stdin_new(&ctx, NULL) != NULL) goto error; - if (cmdline_file_new(NULL, "prompt", "/dev/null") != NULL) + if (cmdline_file_new(NULL, "prompt", "/dev/null", 0) != NULL) goto error; - if (cmdline_file_new(&ctx, NULL, "/dev/null") != NULL) + if (cmdline_file_new(&ctx, NULL, "/dev/null", 0) != NULL) goto error; - if (cmdline_file_new(&ctx, "prompt", NULL) != NULL) + if (cmdline_file_new(&ctx, "prompt", NULL, 0) != NULL) goto error; - if (cmdline_file_new(&ctx, "prompt", "-/invalid/~/path") != NULL) { + if (cmdline_file_new(&ctx, "prompt", "-/invalid/~/path", 0) != NULL) { printf("Error: succeeded in opening invalid file for reading!"); return -1; } - if (cmdline_file_new(&ctx, "prompt", "/dev/null") == NULL) { + if (cmdline_file_new(&ctx, "prompt", "/dev/null", 0) == NULL) { printf("Error: failed to open /dev/null for reading!"); return -1; } -- 2.13.3 ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [dpdk-dev] [PATCH 3/3] test: update batch loading test 2017-11-15 15:45 ` [dpdk-dev] [PATCH 3/3] test: update batch loading test Xueming Li @ 2017-12-11 12:33 ` Burakov, Anatoly 0 siblings, 0 replies; 14+ messages in thread From: Burakov, Anatoly @ 2017-12-11 12:33 UTC (permalink / raw) To: dev On 15-Nov-17 3:45 PM, Xueming Li wrote: > Support echo back in batch loading. > > Signed-off-by: Xueming Li <xuemingl@mellanox.com> > --- Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> -- Thanks, Anatoly ^ permalink raw reply [flat|nested] 14+ messages in thread
end of thread, other threads:[~2018-01-10 14:14 UTC | newest] Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2017-11-15 15:45 [dpdk-dev] [PATCH 0/3] enable echo when CLI loading from file Xueming Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 1/3] lib/cmdline: add echo support in batch " Xueming Li 2017-12-11 12:29 ` Burakov, Anatoly 2017-12-19 10:30 ` Olivier MATZ 2017-12-19 11:20 ` Xueming(Steven) Li 2017-12-26 14:25 ` [dpdk-dev] [PATCH v1] app/testpmd: support command echo in CLI batch loading Xueming Li 2018-01-10 8:35 ` Lu, Wenzhuo 2018-01-10 8:51 ` Xueming(Steven) Li 2018-01-10 12:25 ` Lu, Wenzhuo 2018-01-10 14:14 ` Xueming(Steven) Li 2017-11-15 15:45 ` [dpdk-dev] [PATCH 2/3] " Xueming Li 2017-12-11 12:36 ` Burakov, Anatoly 2017-11-15 15:45 ` [dpdk-dev] [PATCH 3/3] test: update batch loading test Xueming Li 2017-12-11 12:33 ` Burakov, Anatoly
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).