Re: [PATCH 4/8] net/nfb: add device argument "port" to limit used ports

Stephen Hemminger
2026-01-16T17:36:10Z

On Thu, 15 Jan 2026 16:16:52 +0100
spinler@cesnet.cz 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