On Thu, 15 Jan 2026 16:16:52 +0100
[email protected] wrote:

>  
> +static int fill_port_mask(const char *key __rte_unused, const char *value, 
> void *opaque)
> +{
> +     int ret = 0;
> +     char *end = NULL;
> +     uint64_t *port_mask = opaque;
> +     int port;
> +
> +     port = strtol(value, &end, 16);
> +     if ((value[0] == '\0') || (end == NULL) || (*end != '\0'))
> +             ret = -1;
> +
> +     if (ret != 0 || port >= 64 || port < 0)
> +             return -1;
> +
> +     *port_mask |= (1ull << port);
> +     return 0;
> +}

Do you really want to allow negative values, why not use strtoul()
Also, if there is a limit of 64 this should be a #define or config constant

Reply via email to