RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-07 Thread Konstantin Ananyev
> > > Ok I see. But what should we do to prevent this? Simply ignore the > > > request and log a warning? > > > > That's seems like simplest choice to me... Or if you still prefer to > > allow it - put a special comment that it is user responsibility to > > handle such possible race-condition (in

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Robin Jarry
Konstantin Ananyev, Feb 06, 2023 at 21:44: > > Ok I see. But what should we do to prevent this? Simply ignore the > > request and log a warning? > > That's seems like simplest choice to me... Or if you still prefer to > allow it - put a special comment that it is user responsibility to > handle suc

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Konstantin Ananyev
> Konstantin Ananyev, Feb 06, 2023 at 21:34: > > Yes, app knows what resources it wants to free. > > But it has no way to know *when* it is safe to free them. > > Just a bit more explanation: > > App invokes your function which resets global value of CB. > > How would it know that after return fr

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Robin Jarry
Konstantin Ananyev, Feb 06, 2023 at 21:34: > Yes, app knows what resources it wants to free. > But it has no way to know *when* it is safe to free them. > Just a bit more explanation: > App invokes your function which resets global value of CB. > How would it know that after return from this functi

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Konstantin Ananyev
> -Original Message- > From: Robin Jarry > Sent: Monday, February 6, 2023 8:29 PM > To: Konstantin Ananyev ; dev@dpdk.org > Cc: Tyler Retzlaff ; Kevin Laatz > ; Morten Brørup > > Subject: Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage >

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Robin Jarry
Konstantin Ananyev, Feb 06, 2023 at 21:07: > Problem is not in resetting cb function itself. > > Usually with CB user needs some sort of data structure (to accumulate > stats, track states, etc.). If we allow to reset the CB, then it > arises the question when/how should we allow user to free assoc

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-02-06 Thread Konstantin Ananyev
> > Konstantin Ananyev, Jan 04, 2023 at 11:53: > > Probably we can even print warning or so if some-one tries to overwrite > > it once again. > > I'm not sure that is necessary. If an application wants to reset the > callback to NULL at any point in time, I don't see why DPDK should tell > them

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-18 Thread Robin Jarry
Konstantin Ananyev, Jan 04, 2023 at 11:53: > Probably we can even print warning or so if some-one tries to overwrite > it once again. I'm not sure that is necessary. If an application wants to reset the callback to NULL at any point in time, I don't see why DPDK should tell them it is a bad thing.

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-04 Thread Konstantin Ananyev
> > Konstantin Ananyev, Dec 22, 2022 at 13:41: > > > +static rte_lcore_usage_cb lcore_usage_cb; > > > + > > > +void > > > +rte_lcore_register_usage_cb(rte_lcore_usage_cb cb) > > > +{ > > > + lcore_usage_cb = cb; > > > +} > > > + > > > > LGTM in general. > > One question: I assume this function i

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-04 Thread Morten Brørup
> From: Robin Jarry [mailto:rja...@redhat.com] > Sent: Wednesday, 4 January 2023 11.14 > > Morten Brørup, Dec 16, 2022 at 11:47: > > > + usage_str[0] = '\0'; > > > + usage_cb = lcore_usage_cb; > > > + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) { > > > > Move memset() inside here, and

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-04 Thread Robin Jarry
Robin Jarry, Dec 16, 2022 at 11:21: > Allow applications to register a callback that will be invoked in > rte_lcore_dump() and when requesting lcore info in the telemetry API. > > The callback is expected to return the number of TSC cycles that have > passed since application start and the number o

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-04 Thread Robin Jarry
Morten Brørup, Dec 16, 2022 at 11:47: > > + usage_str[0] = '\0'; > > + usage_cb = lcore_usage_cb; > > + if (usage_cb != NULL && usage_cb(lcore_id, &usage) == 0) { > > Move memset() inside here, and add comment: > > + /* The application's callback may not set all the fields in the structure,

Re: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2023-01-04 Thread Robin Jarry
Konstantin Ananyev, Dec 22, 2022 at 13:41: > > +static rte_lcore_usage_cb lcore_usage_cb; > > + > > +void > > +rte_lcore_register_usage_cb(rte_lcore_usage_cb cb) > > +{ > > + lcore_usage_cb = cb; > > +} > > + > > LGTM in general. > One question: I assume this function is supposed to be called jus

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2022-12-22 Thread Konstantin Ananyev
> > Allow applications to register a callback that will be invoked in > rte_lcore_dump() and when requesting lcore info in the telemetry API. > > The callback is expected to return the number of TSC cycles that have > passed since application start and the number of these cycles that were > spe

RE: [PATCH v5 2/4] eal: allow applications to report their cpu usage

2022-12-16 Thread Morten Brørup
> From: Robin Jarry [mailto:rja...@redhat.com] > Sent: Friday, 16 December 2022 11.21 > > Allow applications to register a callback that will be invoked in > rte_lcore_dump() and when requesting lcore info in the telemetry API. > > The callback is expected to return the number of TSC cycles that