[dpdk-dev,v2] testpmd: fix port parsing in show port info command

Message ID 1423186160-26035-1-git-send-email-xuelin.shi@freescale.com (mailing list archive)
State Accepted, archived
Headers

Commit Message

xuelin.shi@freescale.com Feb. 6, 2015, 1:29 a.m. UTC
  From: Xuelin Shi <xuelin.shi@freescale.com>

the port number type should be consistent with librte_cmdline,
else there is potential endian issue.

Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
---
v2 change:
 change port type to uint8
 rephrase patch title

 app/test-pmd/cmdline.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Olivier Matz Feb. 6, 2015, 8:30 a.m. UTC | #1
Hi,

On 02/06/2015 02:29 AM, xuelin.shi@freescale.com wrote:
> From: Xuelin Shi <xuelin.shi@freescale.com>
> 
> the port number type should be consistent with librte_cmdline,
> else there is potential endian issue.
> 
> Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
> ---
> v2 change:
>  change port type to uint8
>  rephrase patch title
> 
>  app/test-pmd/cmdline.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
> index 590e427..d5f31f2 100644
> --- a/app/test-pmd/cmdline.c
> +++ b/app/test-pmd/cmdline.c
> @@ -5584,7 +5584,7 @@ cmdline_parse_token_string_t cmd_showport_what =
>  	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
>  				 "info#stats#xstats#fdir#stat_qmap");
>  cmdline_parse_token_num_t cmd_showport_portnum =
> -	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, INT32);
> +	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
>  
>  cmdline_parse_inst_t cmd_showport = {
>  	.f = cmd_showport_parsed,
> 

Acked-by: Olivier Matz <olivier.matz@6wind.com>
  
Thomas Monjalon Feb. 15, 2015, 3:46 p.m. UTC | #2
> > the port number type should be consistent with librte_cmdline,
> > else there is potential endian issue.
> > 
> > Signed-off-by: Xuelin Shi <xuelin.shi@freescale.com>
> 
> Acked-by: Olivier Matz <olivier.matz@6wind.com>

Applied, thanks
  

Patch

diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 590e427..d5f31f2 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -5584,7 +5584,7 @@  cmdline_parse_token_string_t cmd_showport_what =
 	TOKEN_STRING_INITIALIZER(struct cmd_showport_result, what,
 				 "info#stats#xstats#fdir#stat_qmap");
 cmdline_parse_token_num_t cmd_showport_portnum =
-	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, INT32);
+	TOKEN_NUM_INITIALIZER(struct cmd_showport_result, portnum, UINT8);
 
 cmdline_parse_inst_t cmd_showport = {
 	.f = cmd_showport_parsed,