[dpdk-dev] [PATCH v3] app/proc-info: fix port mask parse issue

Thomas Monjalon thomas at monjalon.net
Wed Nov 14 04:10:28 CET 2018


Hi,

07/11/2018 07:10, Li Han:
> parse_portmask return type is int,but global variable
> "enabled_port_mask" type is uint32_t.so in proc_info_parse_args
> function,when parse_portmask return -1,"enabled_port_mask" will
> get a huge value and "if (enabled_port_mask == 0)" will never happen.
> 
> Fixes: 22561383ea17 ("app: replace dump_cfg by proc_info")
> Signed-off-by: Li Han <han.li1 at zte.com.cn>
[...]
> -static uint32_t enabled_port_mask;
> +static uint64_t enabled_port_mask;
[...]
> -static int
> +static unsigned long
>  parse_portmask(const char *portmask)

On one side, you use uint64_t, on the other side, you use unsigned long.
I don't understand the logic behind.




More information about the dev mailing list