[prev in list] [next in list] [prev in thread] [next in thread]
List: dpdk-dev
Subject: Re: [PATCH v7 1/5] eal: add lcore info in telemetry
From: Stephen Hemminger <stephen () networkplumber ! org>
Date: 2023-01-31 16:41:41
Message-ID: 20230131084141.7dac021c () hermes ! local
[Download RAW message or body]
On Tue, 31 Jan 2023 10:40:08 +0100
"Robin Jarry" <rjarry@redhat.com> wrote:
> Hi Stephen,
>
> Stephen Hemminger, Jan 26, 2023 at 18:03:
> > Alternatively, you could should check for lcore out of range.
> >
> > Simplified as:
> > struct lcore_telemetry_info info = { .d = d };
> > char *endptr; // init not really needed
> >
> > if (params == NULL) // length check can be handled later
> > return -EINVAL;
> >
> > info.lcore_id = strtoul(params, &endptr, 10);
> >
> > if (*params == '\0' || *endptr != '\0 ||
> > info.lcore_id >= RTE_MAX_LCORE)
> > return -EINVAL;
>
> Ok that may be more exhaustive. But even if the lcore_id is out of
> range, it will not be matched by the callback.
>
> Do you think it warrants sending a v8 of the whole series just for this?
The reason for the range check is to avoid wraparound.
Actually, you need a temp variable there since lcore_id is
uint16_t and unsigned long is 64 bits on most platforms.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic