#
64f27886 |
| 02-Nov-2024 |
David Marchand <david.marchand@redhat.com> |
eal/unix: optimize thread creation
Setting the cpu affinity of the child thread from the parent thread is racy when using pthread_setaffinity_np, as the child thread may start running and initialize
eal/unix: optimize thread creation
Setting the cpu affinity of the child thread from the parent thread is racy when using pthread_setaffinity_np, as the child thread may start running and initialize before affinity is set.
On the other hand, setting the cpu affinity from the child thread itself may fail, so the parent thread waits for the child thread to report whether this call succeeded.
This synchronisation point resulted in a significant slow down of rte_thread_create() (as seen in the lcores_autotest unit tests, in OBS for some ARM systems).
Another option for setting cpu affinity is to use the not portable pthread_attr_setaffinity_np available in FreeBSD and glibc, but not available in musl.
Fixes: b28c6196b132 ("eal/unix: fix thread creation") Cc: stable@dpdk.org
Signed-off-by: David Marchand <david.marchand@redhat.com> Acked-by: Luca Boccassi <bluca@debian.org> Acked-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
#
0efcd352 |
| 14-Apr-2022 |
Stephen Hemminger <stephen@networkplumber.org> |
eal/unix: make stack dump signal safe
rte_dump_stack() needs to be usable in situations when a bug is encountered and from signal handlers (such as SEGV).
Glibc backtrace_symbols() calls malloc whi
eal/unix: make stack dump signal safe
rte_dump_stack() needs to be usable in situations when a bug is encountered and from signal handlers (such as SEGV).
Glibc backtrace_symbols() calls malloc which makes it dangerous in a signal handler that is handling errors that maybe due to memory corruption. Additionally, rte_log() is unsafe because syslog() is not signal safe; printf() is also documented as not being safe.
This version formats message and uses writev for each line in a manner similar to what glibc version of backtrace_symbols_fd() does. The FreeBSD version of backtrace_symbols_fd() is not signal safe.
Sample output:
0: ./build/app/dpdk-testpmd (rte_dump_stack+0x2b) [560a6e9c002b] 1: ./build/app/dpdk-testpmd (main+0xad) [560a6decd5ad] 2: /lib/x86_64-linux-gnu/libc.so.6 (__libc_start_main+0xcd) [7fd43d3e27fd] 3: ./build/app/dpdk-testpmd (_start+0x2a) [560a6e83628a]
Bugzilla ID: 929
Acked-by: Morten Brørup <mb@smartsharesystems.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Reviewed-by: David Marchand <david.marchand@redhat.com>
show more ...
|
#
a95d7054 |
| 05-Apr-2022 |
David Marchand <david.marchand@redhat.com> |
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 <david.marchand@redhat.com> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
#
6e97b5fc |
| 09-Feb-2022 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: move Unix filesystem functions into one file
Both Linux and FreeBSD have same code for creating runtime directory and reading sysfs files. Put them in the new lib/eal/unix subdirectory.
Signed
eal: move Unix filesystem functions into one file
Both Linux and FreeBSD have same code for creating runtime directory and reading sysfs files. Put them in the new lib/eal/unix subdirectory.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
show more ...
|
#
40edb9c0 |
| 07-Jul-2021 |
David Marchand <david.marchand@redhat.com> |
eal: handle compressed firmware
Introduce an internal firmware loading helper to remove code duplication in our drivers and handle xz compressed firmware by calling libarchive.
This helper tries to
eal: handle compressed firmware
Introduce an internal firmware loading helper to remove code duplication in our drivers and handle xz compressed firmware by calling libarchive.
This helper tries to look for .xz suffixes so that drivers are not aware the firmware has been compressed.
libarchive is set as an optional dependency: without libarchive, a runtime warning is emitted so that users know there is a compressed firmware.
Windows implementation is left as an empty stub.
Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Igor Russkikh <irusskikh@marvell.com> Acked-by: Aaron Conole <aconole@redhat.com> Tested-by: Haiyue Wang <haiyue.wang@intel.com>
show more ...
|
#
99a2dd95 |
| 20-Apr-2021 |
Bruce Richardson <bruce.richardson@intel.com> |
lib: remove librte_ prefix from directory names
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 m
lib: remove librte_ prefix from directory names
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 <bruce.richardson@intel.com>
show more ...
|