Re: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-18 Thread Mattias Rönnblom
On 2024-09-17 18:29, Konstantin Ananyev wrote: +#define LCORE_BUFFER_SIZE (RTE_MAX_LCORE_VAR * RTE_MAX_LCORE) + +static void *lcore_buffer; +static size_t offset = RTE_MAX_LCORE_VAR; + +static void * +lcore_var_alloc(size_t size, size_t align) +{ + void *handle; + void *value; + +

Re: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-18 Thread Mattias Rönnblom
On 2024-09-17 18:11, Konstantin Ananyev wrote: + +/** + * 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., m

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-17 Thread Konstantin Ananyev
> >> +#define LCORE_BUFFER_SIZE (RTE_MAX_LCORE_VAR * RTE_MAX_LCORE) > >> + > >> +static void *lcore_buffer; > >> +static size_t offset = RTE_MAX_LCORE_VAR; > >> + > >> +static void * > >> +lcore_var_alloc(size_t size, size_t align) > >> +{ > >> + void *handle; > >> + void *value; > >> + > >> +

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-17 Thread Konstantin Ananyev
> >> + > >> +/** > >> + * 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 @re

Re: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-17 Thread Mattias Rönnblom
On 2024-09-16 16:02, Konstantin Ananyev wrote: Introduce DPDK per-lcore id variables, or lcore variables for short. An lcore variable has one value for every current and future lcore id-equipped thread. The primary use case is for statically allocating small, frequently-accessed data struct

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-17 Thread Konstantin Ananyev
> > From: Konstantin Ananyev [mailto:konstantin.anan...@huawei.com] > > Sent: Tuesday, 17 September 2024 01.20 > > > > > > > +/** > > > > > + * Get pointer to lcore variable instance of the current thread. > > > > > + * > > > > > + * May only be used by EAL threads and registered non-EAL threads.

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-17 Thread Morten Brørup
> From: Konstantin Ananyev [mailto:konstantin.anan...@huawei.com] > Sent: Tuesday, 17 September 2024 01.20 > > > > > +/** > > > > + * Get pointer to lcore variable instance of the current thread. > > > > + * > > > > + * May only be used by EAL threads and registered non-EAL threads. > > > > + */ >

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-16 Thread Konstantin Ananyev
> > > +/** > > > + * Get pointer to lcore variable instance of the current thread. > > > + * > > > + * May only be used by EAL threads and registered non-EAL threads. > > > + */ > > > +#define RTE_LCORE_VAR_VALUE(handle) \ > > > + RTE_LCORE_VAR_LCORE_VALUE(rte_lcore_id(), handle) > > > > Would it

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-16 Thread Morten Brørup
> From: Konstantin Ananyev [mailto:konstantin.anan...@huawei.com] > Sent: Monday, 16 September 2024 16.02 > > > Introduce DPDK per-lcore id variables, or lcore variables for short. > > > > An lcore variable has one value for every current and future lcore > > id-equipped thread. > > > > The primar

RE: [PATCH v4 1/7] eal: add static per-lcore memory allocation facility

2024-09-16 Thread Konstantin Ananyev
> Introduce DPDK per-lcore id variables, or lcore variables for short. > > An lcore variable has one value for every current and future lcore > id-equipped thread. > > The primary use case is for statically allocating > small, frequently-accessed data structures, for which one instance > shoul