#
9ebdbe62 |
| 08-Nov-2024 |
Thomas Monjalon <thomas@monjalon.net> |
eal: fix lcore variables cleanup on Windows
The memory allocated with _aligned_malloc() must be released with _aligned_free() on Windows.
The POSIX free() was called in eal_lcore_var_cleanup(), cal
eal: fix lcore variables cleanup on Windows
The memory allocated with _aligned_malloc() must be released with _aligned_free() on Windows.
The POSIX free() was called in eal_lcore_var_cleanup(), called in rte_eal_cleanup(), and triggered a heap corruption: exit status 3221226356 or signal 3221226228 SIGinvalid with MALLOC_PERTURB_=86
Fixes: 5bce9bed67ad ("eal: add static per-lcore memory allocation facility")
Reported-by: David Marchand <david.marchand@redhat.com> Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Reviewed-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com> Reviewed-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
show more ...
|
#
776d4753 |
| 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
doc: add lcore variables guide
Add lcore variables programmer's guide. This guide gives both an overview of the API, its implementation, and alternatives to the use of lcore variables for maintainin
doc: add lcore variables guide
Add lcore variables programmer's guide. This guide gives both an overview of the API, its implementation, and alternatives to the use of lcore variables for maintaining per-lcore id data.
It has pictures, too.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Reviewed-by: Luka Jankovic <luka.jankovic@ericsson.com>
show more ...
|
#
5bce9bed |
| 25-Oct-2024 |
Mattias Rönnblom <mattias.ronnblom@ericsson.com> |
eal: add static per-lcore memory allocation facility
Introduce DPDK per-lcore id variables, or lcore variables for short.
An lcore variable has one value for every current and future lcore id-equip
eal: add static per-lcore memory allocation facility
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 <rte_lcore_var.h> use case is for statically allocating small, frequently-accessed data structures, for which one instance should exist for each lcore.
Lcore variables are similar to thread-local storage (TLS, e.g., C11 _Thread_local), but decoupling the values' life time with that of the threads.
Lcore variables are also similar in terms of functionality provided by FreeBSD kernel's DPCPU_*() family of macros and the associated build-time machinery. DPCPU uses linker scripts, which effectively prevents the reuse of its, otherwise seemingly viable, approach.
The currently-prevailing way to solve the same problem as lcore variables is to keep a module's per-lcore data as RTE_MAX_LCORE-sized array of cache-aligned, RTE_CACHE_GUARDed structs. The benefit of lcore variables over this approach is that data related to the same lcore now is close (spatially, in memory), rather than data used by the same module, which in turn avoid excessive use of padding, polluting caches with unused data.
Signed-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Konstantin Ananyev <konstantin.ananyev@huawei.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|