summaryrefslogtreecommitdiff
path: root/lib/stack
AgeCommit message (Collapse)Author
2024-10-09use C linkage where appropriate in headersMattias Rönnblom
Assure that 'extern "C" { /../ }' do not cover files included from a particular header file, and address minor issues resulting from this change of order. Dealing with C++ should delegate to the individual include file level, rather than being imposed by the user of that file. For example, forcing C linkage prevents __Generic macros being replaced with overloaded static inline functions in C++ translation units. Eliminate 'extern "C"' from files which do not declare any symbols (e.g., only macros or struct types). On the other hand, the headers check is too naive in assuming that all headers must contain a 'extern "C"'. Such a check was added in commit 1ee492bdc4ff ("buildtools/chkincs: check missing C++ guards"). Since this current change results in many headers not containing such a token, remove the check for 'extern "C"' until we have a better implementation. Signed-off-by: Mattias Rönnblom <[email protected]> Acked-by: Morten Brørup <[email protected]> Signed-off-by: David Marchand <[email protected]>
2024-08-08version: 24.11-rc0David Marchand
Start a new release cycle with empty release notes. The ABI version becomes 25.0. The map files are updated to the new ABI major number (25). The ABI exceptions are dropped and CI ABI checks are disabled because compatibility is not preserved. Signed-off-by: David Marchand <[email protected]> Acked-by: Thomas Monjalon <[email protected]>
2024-05-29build: exclude rather than include libs in MSVC buildTyler Retzlaff
Some libraries that could be built with MSVC were not being built. Switch from explicit include to exclude of libs to get immediate CI coverage of libraries that already work with MSVC Windows builds. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Acked-by: Morten Brørup <[email protected]>
2024-03-06lib: move alignment attribute on types for MSVCTyler Retzlaff
The current location used for __rte_aligned(a) for alignment of types is not compatible with MSVC. There is only a single location accepted by both toolchains. The standard offers no alignment facility that compatibly interoperates with C and C++ but it may be achieved by relocating the placement of __rte_aligned(a) to the aforementioned location accepted by all currently supported toolchains. To allow alignment for both compilers, do the following: * Expand __rte_aligned(a) to __declspec(align(a)) when building with MSVC. * Move __rte_aligned from the end of {struct,union} definitions to be between {struct,union} and tag. The placement between {struct,union} and the tag allows the desired alignment to be imparted on the type regardless of the toolchain being used for all of GCC, LLVM, MSVC compilers building both C and C++. Note: this move has an additional benefit as Doxygen is not confused anymore like for the rte_event_vector struct definition. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]> Signed-off-by: David Marchand <[email protected]>
2024-03-06lib: use C11 alignment attribute on variablesTyler Retzlaff
The current location used for __rte_aligned(a) for alignment of variables is not compatible with MSVC. For variables, standard C11 offers alignas(a) supported by conformant compilers i.e. both MSVC and GCC. Replace use of __rte_aligned(a) on variables/fields with alignas(a). Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Signed-off-by: David Marchand <[email protected]>
2024-03-01lib: use log helper with prefixTyler Retzlaff
Use RTE_LOG_LINE_PREFIX instead of RTE_LOG_LINE in macro expansions which allows a prefix and arguments to be inserted into the log line without the need to use the ## args variadic argument pack extension. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
2024-02-18lib: use atomic thread fence recommended APITyler Retzlaff
Use rte_atomic_thread_fence() instead of directly using __atomic_thread_fence() builtin GCC intrinsic or __rte_atomic_thread_fence() internal function. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Chengwen Feng <[email protected]> Acked-by: Thomas Monjalon <[email protected]>
2024-02-14use C11 alignofTyler Retzlaff
Replace use of __alignof__(e) (resp. __alignof__(T) with C11 alignof(typeof(e)) (resp. alignof(T)) to improve portability between toolchains. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Chengwen Feng <[email protected]> Acked-by: Anoob Joseph <[email protected]> Acked-by: Volodymyr Fialko <[email protected]> Acked-by: Akhil Goyal <[email protected]> Acked-by: Ajit Khaparde <[email protected]>
2023-12-21lib: use per line logging in helpersDavid Marchand
Use RTE_LOG_LINE in existing macros that append a \n. This will help catching unwanted newline character or multilines in log messages. Signed-off-by: David Marchand <[email protected]> Reviewed-by: Chengwen Feng <[email protected]> Reviewed-by: Andrew Rybchenko <[email protected]>
2023-12-21lib: remove redundant newline from logsDavid Marchand
Fix places where two newline characters may be logged. Cc: [email protected] Signed-off-by: David Marchand <[email protected]> Acked-by: Stephen Hemminger <[email protected]> Reviewed-by: Chengwen Feng <[email protected]> Acked-by: Mattias Rönnblom <[email protected]>
2023-10-30stack: use stdatomic APITyler Retzlaff
Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding rte_atomic_xxx optional stdatomic API Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Acked-by: David Marchand <[email protected]>
2023-08-16remove C11 compatibility macroTyler Retzlaff
C11 conformant compiler is documented as a minimum requirement to build and consume DPDK. Remove use of RTE_STD_C11 macro marking use of C11 features with __extension__ since it is no longer necessary and then remove definition of RTE_STD_C11 macro. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Bruce Richardson <[email protected]> Reviewed-by: Morten Brørup <[email protected]>
2023-07-31version: 23.11-rc0David Marchand
Start a new release cycle with empty release notes. The ABI version becomes 24.0. The map files are updated to the new ABI major number (24). The ABI exceptions are dropped and CI ABI checks are disabled because compatibility is not preserved. The telemetry and vhost libraries compat code is cleaned up in next commits. Signed-off-by: David Marchand <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2023-06-09stack: replace legacy atomics with GCC builtin atomicsTyler Retzlaff
Replace the use of rte_atomic.h types and functions, instead use GCC supplied C++11 memory model builtins. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]>
2023-04-25use atomic intrinsics closer to C11Tyler Retzlaff
Use __atomic_fetch_{add,and,or,sub,xor} instead of __atomic_{add,and,or,sub,xor}_fetch when we have no interest in the result of the operation. This change reduces unnecessary code that provided the result of the atomic operation while this result was not used. It also brings us to a closer alignment with atomics available in C11 standard and will reduce review effort when they are integrated. Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Ruifeng Wang <[email protected]> Acked-by: Chengwen Feng <[email protected]> Reviewed-by: Maxime Coquelin <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Pavan Nikhilesh <[email protected]> Reviewed-by: David Marchand <[email protected]>
2022-07-21version: 22.11-rc0David Marchand
Start a new release cycle with empty release notes. The ABI version becomes 23.0. The map files are updated to the new ABI major number (23). The ABI exceptions are dropped and CI ABI checks are disabled because compatibility is not preserved. Special handling of removed drivers is also dropped in check-abi.sh and a note has been added in libabigail.abignore as a reminder. Signed-off-by: David Marchand <[email protected]> Acked-by: Thomas Monjalon <[email protected]>
2022-06-24lib: document free functionsStephen Hemminger
Make sure all functions which use the convention that XXX_free(NULL) is a nop are all documented. The wording is chosen to match the documentation of free(3). "If ptr is NULL, no operation is performed." Signed-off-by: Stephen Hemminger <[email protected]> Acked-by: Chengwen Feng <[email protected]> [David: squashed with other series updates, unified wording]
2022-02-22lib: remove unneeded header includesSean Morrissey
These header includes have been flagged by the iwyu_tool and removed. Signed-off-by: Sean Morrissey <[email protected]>
2022-02-10stack: fix stubs header exportDavid Marchand
The stubs header is included as part of rte_stack.h for architectures other than x86_64 and aarch64 (i.e. x86 32 bits and ppc). Note: chkincs won't catch this issue since it checks headers from within the source directory. Fixes: 7911ba0473e0 ("stack: enable lock-free implementation for aarch64") Cc: [email protected] Signed-off-by: David Marchand <[email protected]>
2021-10-19stack: remove unneeded atomic header includeJoyce Kong
In stack module, remove the header file rte_atomic.h as it is not being used. Signed-off-by: Joyce Kong <[email protected]> Signed-off-by: Dharmik Thakkar <[email protected]> Reviewed-by: Ruifeng Wang <[email protected]> Acked-by: Olivier Matz <[email protected]>
2021-10-01mempool/stack: build on WindowsJie Zhou
Enable build of mempool/stack on Windows. Signed-off-by: Jie Zhou <[email protected]> Acked-by: Dmitry Kozlyuk <[email protected]>
2021-09-27stack: fix reload head when pop failsJulien Meunier
The previous commit 18effad9cfa7 ("stack: reload head when pop fails") only changed C11 implementation, not generic implementation. List head must be loaded right before continue (when failed to find the new head). Without this, one thread might keep trying and failing to pop items without ever loading the new correct head. Fixes: 3340202f5954 ("stack: add lock-free implementation") Cc: [email protected] Signed-off-by: Julien Meunier <[email protected]> Acked-by: Olivier Matz <[email protected]>
2021-09-22lib: remove C++ include guard from private headersThomas Monjalon
The private headers are compiled internally with a C compiler. Thus extern "C" declaration is useless in such files. Signed-off-by: Thomas Monjalon <[email protected]>
2021-08-17version: 21.11-rc0Thomas Monjalon
Start a new release cycle with empty release notes. The ABI version becomes 22.0. The map files are updated to the new ABI major number (22). The ABI exceptions are dropped and CI ABI checks are disabled because compatibility is not preserved. Signed-off-by: Thomas Monjalon <[email protected]> Acked-by: Ferruh Yigit <[email protected]> Acked-by: David Marchand <[email protected]>
2021-05-11log: register with standardized namesDavid Marchand
Let's try to enforce the convention where most drivers use a pmd. logtype with their class reflected in it, and libraries use a lib. logtype. Introduce two new macros: - RTE_LOG_REGISTER_DEFAULT can be used when a single logtype is used in a component. It is associated to the default name provided by the build system, - RTE_LOG_REGISTER_SUFFIX can be used when multiple logtypes are used, and then the passed name is appended to the default name, RTE_LOG_REGISTER is left untouched for existing external users and for components that do not comply with the convention. There is a new Meson variable log_prefix to adapt the default name for baseband (pmd.bb.), bus (no pmd.) and mempool (no pmd.) classes. Note: achieved with below commands + reverted change on net/bonding + edits on crypto/virtio, compress/mlx5, regex/mlx5 $ git grep -l RTE_LOG_REGISTER drivers/ | while read file; do pattern=${file##drivers/}; class=${pattern%%/*}; pattern=${pattern#$class/}; drv=${pattern%%/*}; case "$class" in baseband) pattern=pmd.bb.$drv;; bus) pattern=bus.$drv;; mempool) pattern=mempool.$drv;; *) pattern=pmd.$class.$drv;; esac sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; done $ git grep -l RTE_LOG_REGISTER lib/ | while read file; do pattern=${file##lib/}; pattern=lib.${pattern%%/*}; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern',/RTE_LOG_REGISTER_DEFAULT(\1,/' $file; sed -i -e 's/RTE_LOG_REGISTER(\(.*\), '$pattern'\.\(.*\),/RTE_LOG_REGISTER_SUFFIX(\1, \2,/' $file; done Signed-off-by: David Marchand <[email protected]> Signed-off-by: Thomas Monjalon <[email protected]> Acked-by: Bruce Richardson <[email protected]>
2021-05-03stack: allow lock-free only on relevant architecturesStanislaw Kardach
Since commit 7911ba0473e0 ("stack: enable lock-free implementation for aarch64"), lock-free stack is supported on arm64 but this description was missing from the doxygen for the flag. Currently it is impossible to detect programmatically whether lock-free implementation of rte_stack is supported. One could check whether the header guard for lock-free stubs is defined (_RTE_STACK_LF_STUBS_H_) but that's an unstable implementation detail. Because of that currently all lock-free ring creations silently succeed (as long as the stack header is 16B long) which later leads to push and pop operations being NOPs. The observable effect is that stack_lf_autotest fails on platforms not supporting the lock-free. Instead it should just skip the lock-free test altogether. This commit adds a new errno value (ENOTSUP) that may be returned by rte_stack_create() to indicate that a given combination of flags is not supported on a current platform. This is detected by checking a compile-time flag in the include logic in rte_stack_lf.h which may be used by applications to check the lock-free support at compile time. Use the added RTE_STACK_LF_SUPPORTED flag to disable the lock-free stack tests at the compile time. Perf test doesn't fail because rte_ring_create() succeeds, however marking this test as skipped gives a better indication of what actually was tested. Fixes: 7911ba0473e0 ("stack: enable lock-free implementation for aarch64") Signed-off-by: Stanislaw Kardach <[email protected]> Acked-by: Olivier Matz <[email protected]>
2021-04-21lib: remove librte_ prefix from directory namesBruce Richardson
There is no reason for the DPDK libraries to all have 'librte_' prefix on the directory names. This prefix makes the directory names longer and also makes it awkward to add features referring to individual libraries in the build - should the lib names be specified with or without the prefix. Therefore, we can just remove the library prefix and use the library's unique name as the directory name, i.e. 'eal' rather than 'librte_eal' Signed-off-by: Bruce Richardson <[email protected]>