| 64fcadea | 03-May-2022 |
Thomas Monjalon <[email protected]> |
avoid AltiVec keyword vector
The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily. As a rule, it is better to use the alternative keyword "__ve
avoid AltiVec keyword vector
The AltiVec header file is defining "vector", except in C++ build. The keyword "vector" may conflict easily. As a rule, it is better to use the alternative keyword "__vector", so we will be able to #undef vector after including AltiVec header.
Later it may become possible to #undef vector in rte_altivec.h with a compatibility breakage.
Signed-off-by: Thomas Monjalon <[email protected]> Reviewed-by: David Christensen <[email protected]>
show more ...
|
| 2f51bc9c | 20-May-2022 |
David Marchand <[email protected]> |
eal/freebsd: fix use of newer cpuset macros
FreeBSD has updated its CPU macros to align more with the definitions used on Linux[1]. Unfortunately, while this makes compatibility better in future, it
eal/freebsd: fix use of newer cpuset macros
FreeBSD has updated its CPU macros to align more with the definitions used on Linux[1]. Unfortunately, while this makes compatibility better in future, it means we need to have both legacy and newer definition support. Use a meson check to determine which set of macros are used.
[1] https://cgit.freebsd.org/src/commit/?id=e2650af157bc
Bugzilla ID: 1014 Fixes: c3568ea37670 ("eal: restrict control threads to startup CPU affinity") Fixes: b6be16acfeb1 ("eal: fix control thread affinity with --lcores") Cc: [email protected]
Signed-off-by: David Marchand <[email protected]> Signed-off-by: Bruce Richardson <[email protected]> Tested-by: Daxue Gao <[email protected]>
show more ...
|
| 26d734b5 | 14-Apr-2022 |
David Marchand <[email protected]> |
devargs: fix leak on hotplug failure
Caught by ASan, if a secondary process tried to attach a device with an incorrect driver name, devargs was leaked.
Fixes: 64051bb1f144 ("devargs: unify scratch
devargs: fix leak on hotplug failure
Caught by ASan, if a secondary process tried to attach a device with an incorrect driver name, devargs was leaked.
Fixes: 64051bb1f144 ("devargs: unify scratch buffer storage") Cc: [email protected]
Signed-off-by: David Marchand <[email protected]>
show more ...
|
| 00901e4d | 25-Feb-2022 |
Luc Pelletier <[email protected]> |
eal/x86: fix unaligned access for small memcpy
Calls to rte_memcpy for 1 < n < 16 could result in unaligned loads/stores, which is undefined behaviour according to the C standard, and strict aliasin
eal/x86: fix unaligned access for small memcpy
Calls to rte_memcpy for 1 < n < 16 could result in unaligned loads/stores, which is undefined behaviour according to the C standard, and strict aliasing violations.
The code was changed to use a packed structure that allows aliasing (using the __may_alias__ attribute) to perform the load/store operations. This results in code that has the same performance as the original code and that is also C standards-compliant.
Fixes: af75078fece3 ("first public release") Cc: [email protected]
Signed-off-by: Luc Pelletier <[email protected]> Acked-by: Konstantin Ananyev <[email protected]> Tested-by: Konstantin Ananyev <[email protected]>
show more ...
|
| b70a9b78 | 12-May-2022 |
Tyler Retzlaff <[email protected]> |
eal: get/set thread affinity per thread identifier
Implement functions for getting/setting thread affinity. Threads can be pinned to specific cores by setting their affinity attribute.
Windows erro
eal: get/set thread affinity per thread identifier
Implement functions for getting/setting thread affinity. Threads can be pinned to specific cores by setting their affinity attribute.
Windows error codes are translated to errno-style error codes. The possible return values are chosen so that we have as much semantic compatibility between platforms as possible.
note: convert_cpuset_to_affinity has a limitation that all cpus of the set belong to the same processor group.
Signed-off-by: Narcisa Vasile <[email protected]> Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Dmitry Kozlyuk <[email protected]>
show more ...
|
| 56539289 | 12-May-2022 |
Tyler Retzlaff <[email protected]> |
eal: provide current thread identifier
Provide a portable type-safe thread identifier. Provide rte_thread_self for obtaining current thread identifier.
Signed-off-by: Narcisa Vasile <navasile@linux
eal: provide current thread identifier
Provide a portable type-safe thread identifier. Provide rte_thread_self for obtaining current thread identifier.
Signed-off-by: Narcisa Vasile <[email protected]> Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Dmitry Kozlyuk <[email protected]> Acked-by: Konstantin Ananyev <[email protected]>
show more ...
|
| 48ff13ef | 05-May-2022 |
David Marchand <[email protected]> |
test/mem: disable ASan when accessing unallocated memory
As described in bugzilla, ASan reports accesses to all memory segment as invalid, since those parts have not been allocated with rte_malloc.
test/mem: disable ASan when accessing unallocated memory
As described in bugzilla, ASan reports accesses to all memory segment as invalid, since those parts have not been allocated with rte_malloc. Move __rte_no_asan to rte_common.h and disable ASan on a part of the test.
Bugzilla ID: 880 Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan") Cc: [email protected]
Signed-off-by: David Marchand <[email protected]> Acked-by: Anatoly Burakov <[email protected]>
show more ...
|
| 28c5d600 | 05-May-2022 |
Tianhao Chai <[email protected]> |
eal: fix C++ include for device event and DMA
Currently the "extern C" section ends right before rte_dev_dma_unmap and other DMA function declarations, causing some C++ compilers to produce C++ mang
eal: fix C++ include for device event and DMA
Currently the "extern C" section ends right before rte_dev_dma_unmap and other DMA function declarations, causing some C++ compilers to produce C++ mangled symbols to rte_dev_dma_unmap instead of C symbols. This leads to build failures later when linking a final executable against this object.
Fixes: a753e53d517b ("eal: add device event monitor framework") Cc: [email protected]
Signed-off-by: Tianhao Chai <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| 4d8bdd8b | 04-May-2022 |
Anatoly Burakov <[email protected]> |
malloc: fix ASan handling for unmapped memory
Currently, when we free previously allocated memory, we mark the area as "freed" for ASan purposes (flag 0xfd). However, sometimes, freeing a malloc ele
malloc: fix ASan handling for unmapped memory
Currently, when we free previously allocated memory, we mark the area as "freed" for ASan purposes (flag 0xfd). However, sometimes, freeing a malloc element will cause pages to be unmapped from memory and re-backed with anonymous memory again. This may cause ASan's "use-after-free" error down the line, because the allocator will try to write into memory areas recently marked as "freed".
To fix this, we need to mark the unmapped memory area as "available", and fixup surrounding malloc element header/trailers to enable later malloc routines to safely write into new malloc elements' headers or trailers.
Bugzilla ID: 994 Fixes: 6cc51b1293ce ("mem: instrument allocator for ASan") Cc: [email protected]
Reported-by: David Marchand <[email protected]> Signed-off-by: Anatoly Burakov <[email protected]>
show more ...
|
| 90bf3f89 | 21-Apr-2022 |
Deepak Khandelwal <[email protected]> |
mem: skip attaching external memory in secondary process
Currently, EAL init in secondary processes will attach all fbarrays in the memconfig to have access to the primary process's page tables. How
mem: skip attaching external memory in secondary process
Currently, EAL init in secondary processes will attach all fbarrays in the memconfig to have access to the primary process's page tables. However, fbarrays corresponding to external memory segments should not be attached at initialization, because this will happen as part of `rte_extmem_attach` [1] or `rte_malloc_heap_memory_attach` [2] calls.
1: https://doc.dpdk.org/api/rte__memory_8h.html#a2796da68de6825f8edf53759f8e4d230 2: https://doc.dpdk.org/api/rte__malloc_8h.html#af6360dea35bdf162feeb2b62cf149fd3
Fixes: ff3619d6244b ("malloc: allow attaching to external memory chunks") Cc: [email protected]
Suggested-by: Anatoly Burakov <[email protected]> Signed-off-by: Deepak Khandelwal <[email protected]> Acked-by: Anatoly Burakov <[email protected]>
show more ...
|
| 8001c0dd | 14-Apr-2022 |
Tyler Retzlaff <[email protected]> |
eal/windows: set main lcore affinity
Add missing code to affinitize main_lcore from lcore configuration.
Signed-off-by: Tyler Retzlaff <[email protected]> Reviewed-by: David Marchand <da
eal/windows: set main lcore affinity
Add missing code to affinitize main_lcore from lcore configuration.
Signed-off-by: Tyler Retzlaff <[email protected]> Reviewed-by: David Marchand <[email protected]>
show more ...
|
| 76076342 | 11-Apr-2022 |
Mattias Rönnblom <[email protected]> |
eal: emit warning for unused trylock return value
Mark the trylock family of spinlock functions with __rte_warn_unused_result.
Signed-off-by: Mattias Rönnblom <[email protected]> Acked-
eal: emit warning for unused trylock return value
Mark the trylock family of spinlock functions with __rte_warn_unused_result.
Signed-off-by: Mattias Rönnblom <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| eb13e558 | 11-Apr-2022 |
Mattias Rönnblom <[email protected]> |
eal: add macro to warn for unused function return values
This patch adds a wrapper macro __rte_warn_unused_result for the warn_unused_result function attribute.
Marking a function __rte_warn_unused
eal: add macro to warn for unused function return values
This patch adds a wrapper macro __rte_warn_unused_result for the warn_unused_result function attribute.
Marking a function __rte_warn_unused_result will make the compiler emit a warning in case the caller does not use the function's return value.
Signed-off-by: Mattias Rönnblom <[email protected]> Acked-by: Bruce Richardson <[email protected]> Reviewed-by: Morten Brørup <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| a95d7054 | 05-Apr-2022 |
David Marchand <[email protected]> |
eal: factorize lcore main loop
All OS implementations provide the same main loop. Introduce helpers (shared for Linux and FreeBSD) to handle synchronisation between main and threads and factorize th
eal: factorize lcore main loop
All OS implementations provide the same main loop. Introduce helpers (shared for Linux and FreeBSD) to handle synchronisation between main and threads and factorize the rest as common code. Thread id are now logged as string in a common format across OS.
Note: - this change also fixes Windows EAL: worker threads cpu affinity was incorrectly reported in log.
- libabigail flags this change as breaking ABI in clang builds: 1 function with some indirect sub-type change:
[C] 'function int rte_eal_remote_launch(int (void*)*, void*, unsigned int)' at eal_common_launch.c:35:1 has some indirect sub-type changes: parameter 1 of type 'int (void*)*' changed: in pointed to type 'function type int (void*)' at rte_launch.h:31:1: entity changed from 'function type int (void*)' to 'typedef lcore_function_t' at rte_launch.h:31:1 type size hasn't changed
This is being investigated on libabigail side. For now, we don't have much choice but to waive reports on this symbol.
Signed-off-by: David Marchand <[email protected]> Acked-by: Morten Brørup <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| 449e7dbc | 05-Apr-2022 |
David Marchand <[email protected]> |
eal: cleanup lcore ID hand-over
So far, a worker thread has been using its thread_id to discover which lcore has been assigned to it.
On the other hand, as noted by Tyler, the pthread API does not
eal: cleanup lcore ID hand-over
So far, a worker thread has been using its thread_id to discover which lcore has been assigned to it.
On the other hand, as noted by Tyler, the pthread API does not strictly guarantee that a new thread won't start running eal_thread_loop before pthread_create writes to &lcore_config[xx].thread_id.
Though all OS implementations supported in DPDK (recently) ensure this property, it is more robust to have the main thread directly pass the worker thread lcore.
Signed-off-by: David Marchand <[email protected]>
show more ...
|
| 1e230b9b | 05-Apr-2022 |
David Marchand <[email protected]> |
eal/windows: add missing C++ include guards
Add missing 'extern "C"' to file.
Fixes: 1db72630da0c ("eal/windows: do not expose private facilities") Cc: [email protected]
Signed-off-by: David Marchan
eal/windows: add missing C++ include guards
Add missing 'extern "C"' to file.
Fixes: 1db72630da0c ("eal/windows: do not expose private facilities") Cc: [email protected]
Signed-off-by: David Marchand <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| e4e983b9 | 10-Mar-2022 |
Tyler Retzlaff <[email protected]> |
eal/windows: fix data race when creating threads
eal_thread_loop() uses lcore_config[i].thread_id, which is stored upon the return from CreateThread(). Per documentation, eal_thread_loop() can start
eal/windows: fix data race when creating threads
eal_thread_loop() uses lcore_config[i].thread_id, which is stored upon the return from CreateThread(). Per documentation, eal_thread_loop() can start before CreateThread() returns and the ID is stored.
Create lcore worker threads suspended and then subsequently resume to allow &lcore_config[i].thread_id be stored before eal_thread_loop execution.
Fixes: 53ffd9f080fc ("eal/windows: add minimum viable code") Cc: [email protected]
Signed-off-by: Tyler Retzlaff <[email protected]> Acked-by: Dmitry Kozlyuk <[email protected]>
show more ...
|
| f6ecec2b | 24-Mar-2022 |
Haiyue Wang <[email protected]> |
eal/x86: remove atomic header include loop
Remove the x86 top atomic header include from the architecture related header file, since this x86 top atomic header file has included them.
Signed-off-by
eal/x86: remove atomic header include loop
Remove the x86 top atomic header include from the architecture related header file, since this x86 top atomic header file has included them.
Signed-off-by: Haiyue Wang <[email protected]>
show more ...
|
| 29fd052d | 11-Mar-2022 |
Bruce Richardson <[email protected]> |
eal/freebsd: add missing C++ include guards
Add missing 'extern "C"' to file.
Fixes: 428eb983f5f7 ("eal: add OS specific header file") Cc: [email protected]
Signed-off-by: Bruce Richardson <bruce.ri
eal/freebsd: add missing C++ include guards
Add missing 'extern "C"' to file.
Fixes: 428eb983f5f7 ("eal: add OS specific header file") Cc: [email protected]
Signed-off-by: Bruce Richardson <[email protected]>
show more ...
|
| 4e3582ab | 11-Feb-2022 |
Wenxuan Wu <[email protected]> |
eal/linux: fix device monitor stop return
The ret value in rte_dev_event_monitor_stop stands for whether the monitor has been successfully closed, and should not bind with rte_intr_callback_unregist
eal/linux: fix device monitor stop return
The ret value in rte_dev_event_monitor_stop stands for whether the monitor has been successfully closed, and should not bind with rte_intr_callback_unregister, so once it goes to the right exit point of rte_dev_event_monitor, the ret value should be set to 0.
Also, the refmonitor count has been carefully evaluated, the value change from 1 to 0, so there is no potential memory leak failure.
Fixes: 1fef6ced07f3 ("eal/linux: allow multiple starts of event monitor") Cc: [email protected]
Signed-off-by: Wenxuan Wu <[email protected]>
show more ...
|
| 356a2aa0 | 14-Feb-2022 |
Madhuker Mythri <[email protected]> |
devargs: fix crash with uninitialized parsing
The function rte_devargs_parse() previously was safe to call with non-initialized devargs structure as parameter.
When adding the support for the globa
devargs: fix crash with uninitialized parsing
The function rte_devargs_parse() previously was safe to call with non-initialized devargs structure as parameter.
When adding the support for the global device syntax, this assumption was broken. Restore it by forcing memset as part of the call itself.
Bugzilla ID: 933 Fixes: b344eb5d941a ("devargs: parse global device syntax") Cc: [email protected]
Signed-off-by: Madhuker Mythri <[email protected]> Signed-off-by: Gaetan Rivet <[email protected]>
show more ...
|
| 1a287fc9 | 23-Feb-2022 |
Steve Yang <[email protected]> |
eal/linux: fix illegal memory access in uevent handler
'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer. But as coverity warns 'recv()' doesn't guarantee that 'buf' is null-
eal/linux: fix illegal memory access in uevent handler
'recv()' fills the 'buf', later 'strlcpy()' used to copy from this buffer. But as coverity warns 'recv()' doesn't guarantee that 'buf' is null-terminated, but 'strlcpy()' requires it.
Enlarge 'buf' size to 'EAL_UEV_MSG_LEN + 1' and ensure the last one can be set to 0 when received buffer size is EAL_UEV_MSG_LEN.
CID 375864: Memory - illegal accesses (STRING_NULL) Passing unterminated string "buf" to "dev_uev_parse", which expects a null-terminated string.
Coverity issue: 375864 Fixes: 0d0f478d0483 ("eal/linux: add uevent parse and process") Cc: [email protected]
Signed-off-by: Steve Yang <[email protected]> Acked-by: Ferruh Yigit <[email protected]>
show more ...
|
| d7e9c02c | 16-Feb-2022 |
Brian Dooley <[email protected]> |
eal: add missing C++ guards
Some public header files were missing 'extern "C"' C++ guards, and couldn't be used by C++ applications. Add the missing guards.
Fixes: af75078fece3 ("first public relea
eal: add missing C++ guards
Some public header files were missing 'extern "C"' C++ guards, and couldn't be used by C++ applications. Add the missing guards.
Fixes: af75078fece3 ("first public release") Fixes: 7f3aa0863903 ("eal: introduce bit operations API") Fixes: 166a743c53fa ("compat: add infrastructure to support symbol versioning") Fixes: 8f40ee0734c8 ("eal/x86: get hypervisor name") Fixes: 75583b0d1efd ("eal: add keep alive monitoring") Fixes: 88701645c98c ("eal: move interrupt type out of igb_uio") Fixes: f04519d8092e ("lib: add missing include dependencies") Fixes: f58880682c81 ("trace: implement register API") Fixes: 428eb983f5f7 ("eal: add OS specific header file") Cc: [email protected]
Signed-off-by: Brian Dooley <[email protected]> Acked-by: Bruce Richardson <[email protected]> Acked-by: Tyler Retzlaff <[email protected]>
show more ...
|
| 30a1de10 | 15-Feb-2022 |
Sean Morrissey <[email protected]> |
lib: remove unneeded header includes
These header includes have been flagged by the iwyu_tool and removed.
Signed-off-by: Sean Morrissey <[email protected]> |
| ed57d08d | 31-Jan-2022 |
Michael Barker <[email protected]> |
eal: ignore gcc-compat warning in clang-only macro
When compiling with clang using -Wpedantic (or -Wgcc-compat) the use of diagnose_if kicks up a warning:
.../include/rte_interrupts.h:623:1: error:
eal: ignore gcc-compat warning in clang-only macro
When compiling with clang using -Wpedantic (or -Wgcc-compat) the use of diagnose_if kicks up a warning:
.../include/rte_interrupts.h:623:1: error: 'diagnose_if' is a clang extension [-Werror,-Wgcc-compat] __rte_internal ^ .../include/rte_compat.h:36:16: note: expanded from macro '__rte_internal' __attribute__((diagnose_if(1, "Symbol is not public ABI", "error"), \
This change ignores the '-Wgcc-compat' warning in the specific location where the warning occurs. It is safe to do in this circumstance as the specific macro is only defined when using the clang compiler.
Signed-off-by: Michael Barker <[email protected]>
show more ...
|