[RFC] net/ice: add devargs to control link update

Ye, MingjinX mingjinx.ye at intel.com
Wed Oct 23 09:17:43 CEST 2024



> -----Original Message-----
> From: Stephen Hemminger <stephen at networkplumber.org>
> Sent: Tuesday, October 22, 2024 11:23 PM
> To: Ye, MingjinX <mingjinx.ye at intel.com>
> Cc: dev at dpdk.org
> Subject: Re: [RFC] net/ice: add devargs to control link update
> 
> On Tue, 22 Oct 2024 06:20:43 +0000
> Mingjin Ye <mingjinx.ye at intel.com> wrote:
> 
> > +static int
> > +ice_parse_clean_subtask_period(__rte_unused const char *key,
> > +		const char *value, void *args)
> > +{
> > +	int *num = (int *)args;
> Cast of void * unnecessary in C.
> You probably want period to be unsigned not signed.
> 
> > +	int tmp;
> > +
> > +	errno = 0;
> > +	tmp = atoi(value);
> > +	if (tmp < 0) {
> > +		PMD_DRV_LOG(WARNING, "%s: \"%s\" is not greater than
> or equal to zero",
> > +						key, value);
> > +		return -1;
> > +	}
> > +
> > +	*num = tmp;
> > +
> > +	return 0;
> > +}
> 
> Prefer strtoul() when parsing values, it allows for better error handling.
Thank you. Good suggestion.


More information about the dev mailing list