[PATCH v11 1/7] eal: add static per-lcore memory allocation facility
Thomas Monjalon
thomas at monjalon.net
Wed Oct 16 10:10:32 CEST 2024
15/10/2024 09:10, Mattias Rönnblom:
> On 2024-10-15 08:41, Mattias Rönnblom wrote:
> > On 2024-10-14 10:17, Morten Brørup wrote:
>
> <snip>
>
> >>
> >>> +/**
> >>> + * Get pointer to lcore variable instance with the specified lcore id.
> >>> + *
> >>> + * @param lcore_id
> >>> + * The lcore id specifying which of the @c RTE_MAX_LCORE value
> >>> + * instances should be accessed. The lcore id need not be valid
> >>> + * (e.g., may be @ref LCORE_ID_ANY), but in such a case, the pointer
> >>> + * is also not valid (and thus should not be dereferenced).
> >>> + * @param handle
> >>> + * The lcore variable handle.
> >>> + */
> >>> +#define RTE_LCORE_VAR_LCORE_VALUE(lcore_id, handle) \
> >>> + ((typeof(handle))rte_lcore_var_lcore_ptr(lcore_id, handle))
> >>
> >> Please remove the _VALUE suffix.
> >>
> >
> > You changed your mind? I'm missing the rationale here.
> >
>
> I supposed this is a bit of subjective hairsplitting, but does anyone
> else have an opinion?
>
> Short versus somewhat more readable name.
>
> To get "your own" value should be something like
>
> struct foo *lcore_foo = RTE_LCORE_VAR(foo);
> versus
> struct foo *lcore_foo = RTE_LCORE_VAR_VALUE(foo);
>
> We should also strip "_VALUE" off of the RTE_LCORE_FOREACH_VALUE() macro
> name in case we change the names of the access macros.
I feel "_VALUE" is too much. I prefer the shorter version.
More information about the dev
mailing list