[dpdk-dev] [dpdk-stable] [PATCH] examples: fix return value of function that parses portmask

Thomas Monjalon thomas at monjalon.net
Sat Jul 11 12:00:58 CEST 2020


Why nobody reviewed? Isn't there some maintainers of example apps?

11/06/2020 14:36, Sarosh Arif:
> Giving invalid or zero portmask as command line option to 
> these applications will have an unexpected response.
> The reason behind this is that the return value of function
> that parses portmask is stored in a variable whose datatype is 
> unsigned int, hence returning -1 in case of zero or
> invalid portmask causes an unexpected behaviour. 

After looking at few examples, the function returns a signed int.

> If we return 0 instead of -1 this issue can be resolved.

Yes, the caller of the function seems to expect 0 as error value.

> The program already contains the functionality to print
> "invalid portmask" and program usage if zero is returned.
> 
> Signed-off-by: Sarosh Arif <sarosh.arif at emumba.com>





More information about the dev mailing list