On 2024-10-10 17:54, Stephen Hemminger wrote:
On Thu, 10 Oct 2024 16:21:59 +0200
Mattias Rönnblom <mattias.ronnb...@ericsson.com> 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 <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.ronnb...@ericsson.com>
Acked-by: Morten Brørup <m...@smartsharesystems.com>
Acked-by: Konstantin Ananyev <konstantin.anan...@huawei.com>
Acked-by: Chengwen Feng <fengcheng...@huawei.com>
Acked-by: Stephen Hemminger <step...@networkplumber.org>
If you need to send v10, fix this please.
OK, will do.
WARNING:TYPO_SPELLING: 'varibles' may be misspelled - perhaps 'variables'?
#336: FILE: doc/guides/prog_guide/env_abstraction_layer.rst:447:
+Lcore varibles are suitable for small object statically allocated at
WARNING:TYPO_SPELLING: 'identifer' may be misspelled - perhaps 'identifier'?
#867: FILE: lib/eal/include/rte_lcore_var.h:360:
+ * The pointer returned is only an opaque identifer of the variable. To
I wonder why my checkpatch doesn't spot this, but the DPDK CI version does.