#
ae67895b |
| 08-Dec-2023 |
David Marchand <david.marchand@redhat.com> |
lib: add more logging helpers
Add helpers for logging messages in libraries instead of calling RTE_LOG() directly. Those helpers take care of adding a \n: this will make the transition to RTE_LOG_LI
lib: add more logging helpers
Add helpers for logging messages in libraries instead of calling RTE_LOG() directly. Those helpers take care of adding a \n: this will make the transition to RTE_LOG_LINE trivial.
Note: - for acl and sched libraries that still has some debug multilines messages, a direct call to RTE_LOG is used: this will make it easier to notice such special cases,
Signed-off-by: David Marchand <david.marchand@redhat.com>
show more ...
|
#
2a7a42a5 |
| 26-Oct-2023 |
Tyler Retzlaff <roretzla@linux.microsoft.com> |
eal: use stdatomic API
Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding rte_atomic_xxx optional stdatomic API
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> A
eal: use stdatomic API
Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding rte_atomic_xxx optional stdatomic API
Signed-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: David Marchand <david.marchand@redhat.com>
show more ...
|
#
1c1abf17 |
| 13-Sep-2023 |
Thomas Monjalon <thomas@monjalon.net> |
lib: convert to internal control threads
Calls to rte_ctrl_thread_create() are replaced with rte_thread_create_internal_control(). Other pthread-related functions are replaced with the rte_thread AP
lib: convert to internal control threads
Calls to rte_ctrl_thread_create() are replaced with rte_thread_create_internal_control(). Other pthread-related functions are replaced with the rte_thread API. Only pthread_cancel() has no replacement.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Morten Brørup <mb@smartsharesystems.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com> Acked-by: Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>
show more ...
|
#
62774b78 |
| 03-Jul-2023 |
Thomas Monjalon <thomas@monjalon.net> |
set namespace prefix to threads
When looking at threads in a system, it can be confusing to find some unknown threads without a clue it is started by DPDK.
Let's start all thread names with "dpdk-"
set namespace prefix to threads
When looking at threads in a system, it can be confusing to find some unknown threads without a clue it is started by DPDK.
Let's start all thread names with "dpdk-" plus the driver name if it comes from a driver.
One more constraint: the thread names are generally limited to 16 characters, including the NUL character.
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
show more ...
|
#
971d2b57 |
| 11-Aug-2023 |
Tyler Retzlaff <roretzla@linux.microsoft.com> |
remove C11 compatibility macro
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_
remove C11 compatibility macro
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 <roretzla@linux.microsoft.com> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Morten Brørup <mb@smartsharesystems.com>
show more ...
|
#
a64a4564 |
| 28-Jun-2023 |
Viacheslav Ovsiienko <viacheslavo@nvidia.com> |
ipc: fix file descriptor leakage with unhandled messages
The sendmsg()/recvmsg() API is used to establish communication between the DPDK processes. The API supposes inter-process file descriptors se
ipc: fix file descriptor leakage with unhandled messages
The sendmsg()/recvmsg() API is used to establish communication between the DPDK processes. The API supposes inter-process file descriptors sending and conversion, the recipient sees the resulting descriptors in the received message - the operating systems creates ones in the right context.
The message receiving is performed by EAL in the dedicated thread and it might happen the message is received by EAL and not handled by addressed PMD or application due to some reasons (timeouts, race condition, etc). EAL just dropped unhandled messages causing the file descriptor leakage if these ones were presented in the message.
The patch closes the descriptors (if any) in unhandled messages.
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication") Cc: stable@dpdk.org
Signed-off-by: Viacheslav Ovsiienko <viacheslavo@nvidia.com> Acked-by: Chengwen Feng <fengchengwen@huawei.com> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
b4f0a9bb |
| 14-Jun-2023 |
Thomas Monjalon <thomas@monjalon.net> |
lib: remove blank line ending comment blocks
At the end of a comment, no need for an extra line.
This pattern was fixed with the following command: git ls lib | xargs sed -i '/^ *\* *$/{N;/ *\*\/ *
lib: remove blank line ending comment blocks
At the end of a comment, no need for an extra line.
This pattern was fixed with the following command: git ls lib | xargs sed -i '/^ *\* *$/{N;/ *\*\/ *$/D;}'
Signed-off-by: Thomas Monjalon <thomas@monjalon.net> Acked-by: Bruce Richardson <bruce.richardson@intel.com> Reviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>
show more ...
|
#
668958f3 |
| 06-Sep-2022 |
Stephen Hemminger <stephen@networkplumber.org> |
eal: fix data race in multi-process support
If DPDK is built with thread sanitizer it reports a race in setting of multiprocess file descriptor. The fix is to use atomic operations when updating mp_
eal: fix data race in multi-process support
If DPDK is built with thread sanitizer it reports a race in setting of multiprocess file descriptor. The fix is to use atomic operations when updating mp_fd.
Build: $ meson -Db_sanitize=address build $ ninja -C build
Simple example: $ .build/app/dpdk-testpmd -l 1-3 --no-huge EAL: Detected CPU lcores: 16 EAL: Detected NUMA nodes: 1 EAL: Static memory layout is selected, amount of reserved memory can be adjusted with -m or --socket-mem EAL: Detected static linkage of DPDK EAL: Multi-process socket /run/user/1000/dpdk/rte/mp_socket EAL: Selected IOVA mode 'VA' testpmd: No probed ethernet devices testpmd: create a new mbuf pool <mb_pool_0>: n=163456, size=2176, socket=0 testpmd: preferred mempool ops selected: ring_mp_mc EAL: Error - exiting with code: 1 Cause: Creation of mbuf pool for socket 0 failed: Cannot allocate memory ================== WARNING: ThreadSanitizer: data race (pid=87245) Write of size 4 at 0x558e04d8ff70 by main thread: #0 rte_mp_channel_cleanup <null> (dpdk-testpmd+0x1e7d30c) #1 rte_eal_cleanup <null> (dpdk-testpmd+0x1e85929) #2 rte_exit <null> (dpdk-testpmd+0x1e5bc0a) #3 mbuf_pool_create.cold <null> (dpdk-testpmd+0x274011) #4 main <null> (dpdk-testpmd+0x5cc15d)
Previous read of size 4 at 0x558e04d8ff70 by thread T2: #0 mp_handle <null> (dpdk-testpmd+0x1e7c439) #1 ctrl_thread_init <null> (dpdk-testpmd+0x1e6ee1e)
As if synchronized via sleep: #0 nanosleep libsanitizer/tsan/tsan_interceptors_posix.cpp:366 #1 get_tsc_freq <null> (dpdk-testpmd+0x1e92ff9) #2 set_tsc_freq <null> (dpdk-testpmd+0x1e6f2fc) #3 rte_eal_timer_init <null> (dpdk-testpmd+0x1e931a4) #4 rte_eal_init.cold <null> (dpdk-testpmd+0x29e578) #5 main <null> (dpdk-testpmd+0x5cbc45)
Location is global 'mp_fd' of size 4 at 0x558e04d8ff70 (dpdk-testpmd+0x000003122f70)
Thread T2 'rte_mp_handle' (tid=87248, running) created by main thread at: #0 pthread_create libsanitizer/tsan/tsan_interceptors_posix.cpp:969 #1 rte_ctrl_thread_create <null> (dpdk-testpmd+0x1e6efd0) #2 rte_mp_channel_init.cold <null> (dpdk-testpmd+0x29cb7c) #3 rte_eal_init <null> (dpdk-testpmd+0x1e8662e) #4 main <null> (dpdk-testpmd+0x5cbc45)
SUMMARY: ThreadSanitizer: data race (app/dpdk-testpmd+0x1e7d30c) in rte_mp_channel_cleanup ================== ThreadSanitizer: reported 1 warnings
Fixes: bacaa2754017 ("eal: add channel for multi-process communication") Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com> Reviewed-by: Chengwen Feng <fengchengwen@huawei.com>
show more ...
|
#
30a1de10 |
| 15-Feb-2022 |
Sean Morrissey <sean.morrissey@intel.com> |
lib: remove unneeded header includes
These header includes have been flagged by the iwyu_tool and removed.
Signed-off-by: Sean Morrissey <sean.morrissey@intel.com>
|
#
6e858b4d |
| 13-Nov-2021 |
Stephen Hemminger <stephen@networkplumber.org> |
ipc: end multiprocess thread during cleanup
When rte_eal_cleanup is called, all control threads should exit. For the mp thread, this best handled by closing the mp_socket and letting the thread see
ipc: end multiprocess thread during cleanup
When rte_eal_cleanup is called, all control threads should exit. For the mp thread, this best handled by closing the mp_socket and letting the thread see that.
This also fixes potential problems where the mp_socket gets another hard error, and the thread runs away repeating itself by reading the same error.
Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup") Cc: stable@dpdk.org
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org> Acked-by: Anatoly Burakov <anatoly.burakov@intel.com>
show more ...
|
#
e7885281 |
| 07-Jul-2021 |
David Marchand <david.marchand@redhat.com> |
ipc: stop mp control thread on cleanup
When calling rte_eal_cleanup, the mp channel cleanup routine only sets mp_fd to -1 leaving the rte_mp_handle control thread running. This control thread can sp
ipc: stop mp control thread on cleanup
When calling rte_eal_cleanup, the mp channel cleanup routine only sets mp_fd to -1 leaving the rte_mp_handle control thread running. This control thread can spew warnings on reading on an invalid fd. This is especially noticed with ASAN enabled.
To handle this situation, set mp_fd to -1 to signal the control thread it should exit, but since this thread might be sleeping on the socket, cancel the thread too.
Fixes: 85d6815fa6d0 ("eal: close multi-process socket during cleanup") Cc: stable@dpdk.org
Reported-by: Owen Hilyard <ohilyard@iol.unh.edu> Signed-off-by: David Marchand <david.marchand@redhat.com> Reviewed-by: Maxime Coquelin <maxime.coquelin@redhat.com>
show more ...
|
#
cc994d39 |
| 11-May-2021 |
Chengwen Feng <fengchengwen@huawei.com> |
ipc: use monotonic clock
Currently, the mp uses gettimeofday() API to get the time, and used as timeout parameter.
But the time which gets from gettimeofday() API isn't monotonically increasing. Th
ipc: use monotonic clock
Currently, the mp uses gettimeofday() API to get the time, and used as timeout parameter.
But the time which gets from gettimeofday() API isn't monotonically increasing. The process may fail if the system time is changed.
This fixes it by using clock_gettime() API with monotonic attribution.
Fixes: 783b6e54971d ("eal: add synchronous multi-process communication") Fixes: f05e26051c15 ("eal: add IPC asynchronous request") Cc: stable@dpdk.org
Signed-off-by: Chengwen Feng <fengchengwen@huawei.com> Signed-off-by: Min Hu (Connor) <humin29@huawei.com> Acked-by: Morten Brørup <mb@smartsharesystems.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 ...
|