[PATCH v14] app/procinfo: display eventdev xstats

Sevincer, Abdullah abdullah.sevincer at intel.com
Thu May 18 01:30:00 CEST 2023


> +The cast will cause truncation of large values, so this might be a nop.
> +If you really want to check, then something like:

> +	unsigned long evdev_id;
> +	char *endp;

> +	evdev_id = strtoul(list, &endp, 0);
> +	if (!*list || !*endp || evdev_id >= RTE_EVENT_MAX_DEVS) {
> +	    fprintf(stderr, "Invalid eventdev id: %s\n", list);
> +	    return -EINVAL;
> +	}

Thanks Stephen, you are right it will truncate large values, RTE_EVENT_MAX_DEVS is 16, so I thought
Uint8_t is enough to hold the id. I am not sure if we will have a large number of evdevs, so ids.

But your suggestion seems better I will change it.


More information about the dev mailing list