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

2024-10-16 Thread Mattias Rönnblom
On 2024-10-16 10:17, Thomas Monjalon wrote: 16/10/2024 06:13, Mattias Rönnblom: On 2024-10-16 00:33, Stephen Hemminger wrote: On Tue, 15 Oct 2024 11:33:38 +0200 Mattias Rönnblom wrote: + * Lcore variables + * + * This API provides a mechanism to create and access per-lcore id + * variables

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

2024-10-16 Thread Thomas Monjalon
16/10/2024 06:13, Mattias Rönnblom: > > On 2024-10-16 00:33, Stephen Hemminger wrote: > > On Tue, 15 Oct 2024 11:33:38 +0200 > > Mattias Rönnblom wrote: > > > >> + * Lcore variables > >> + * > >> + * This API provides a mechanism to create and access per-lcore id > >> + * variables in a space- a

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

2024-10-15 Thread Mattias Rönnblom
On 2024-10-16 00:35, Stephen Hemminger wrote: On Tue, 15 Oct 2024 11:33:38 +0200 Mattias Rönnblom wrote: +/** + * Allocate space in the per-lcore id buffers for an lcore variable. + * + * The pointer returned is only an opaque identifier of the variable. To + * get an actual pointer to a parti

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

2024-10-15 Thread Mattias Rönnblom
On 2024-10-16 00:33, Stephen Hemminger wrote: On Tue, 15 Oct 2024 11:33:38 +0200 Mattias Rönnblom wrote: + * Lcore variables + * + * This API provides a mechanism to create and access per-lcore id + * variables in a space- and cycle-efficient manner. + * + * A per-lcore id variable (or lcor

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

2024-10-15 Thread Stephen Hemminger
On Tue, 15 Oct 2024 11:33:38 +0200 Mattias Rönnblom wrote: > +/** > + * Allocate space in the per-lcore id buffers for an lcore variable. > + * > + * The pointer returned is only an opaque identifier of the variable. To > + * get an actual pointer to a particular instance of the variable use > +

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

2024-10-15 Thread Stephen Hemminger
On Tue, 15 Oct 2024 11:33:38 +0200 Mattias Rönnblom wrote: > + * Lcore variables > + * > + * This API provides a mechanism to create and access per-lcore id > + * variables in a space- and cycle-efficient manner. > + * > + * A per-lcore id variable (or lcore variable for short) holds a > + * uniq

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

2024-10-15 Thread Morten Brørup
> From: Mattias Rönnblom [mailto:hof...@lysator.liu.se] > Sent: Tuesday, 15 October 2024 21.03 > > On 2024-10-15 12:13, Morten Brørup wrote: > >> +void * > >> +rte_lcore_var_alloc(size_t size, size_t align) > >> +{ > >> + /* Having the per-lcore buffer size aligned on cache lines > >> + * assur

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

2024-10-15 Thread Mattias Rönnblom
On 2024-10-15 12:13, Morten Brørup wrote: +void * +rte_lcore_var_alloc(size_t size, size_t align) +{ + /* Having the per-lcore buffer size aligned on cache lines +* assures as well as having the base pointer aligned on cache +* size assures that aligned offsets also translat

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

2024-10-15 Thread Morten Brørup
> +void * > +rte_lcore_var_alloc(size_t size, size_t align) > +{ > + /* Having the per-lcore buffer size aligned on cache lines > + * assures as well as having the base pointer aligned on cache > + * size assures that aligned offsets also translate to alipgned > + * pointers acro

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

2024-10-15 Thread Mattias Rönnblom
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 should exist for each l