Re: [dpdk-dev] [PATCH v14 9/9] Add unit tests for thread API
From: Dmitry Kozlyuk <hidden>
Date: 2021-08-20 16:54:23
2021-08-20 09:10 (UTC-0700), Narcisa Ana Maria Vasile:
On Thu, Aug 19, 2021 at 02:31:34PM -0700, Narcisa Ana Maria Vasile wrote:quoted
From: Narcisa Vasile <redacted> As a new API for threading is introduced, a set of unit tests have been added to test the new interface. Signed-off-by: Narcisa Vasile <redacted> --- app/test/meson.build | 2 + app/test/test_threads.c | 419 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 421 insertions(+) create mode 100644 app/test/test_threads.cThere's a failure here on Alpine Linux: "error: implicit declaration of function 'pthread_attr_setaffinity_np'; did you mean 'pthread_setaffinity_np'? [-Werror=implicit-function-declaration]" It looks like "pthread_attr_setaffinity_np" is not available on Alpine Linux. However, other affinity functions such as "pthread_setaffinity_np" are present. Is there a guard that I can use here to check if the pthread_*_np functions are available, similar to RTE_HAS_CPUSET for cpuset?
Even if there is one, you still need to handle the Alpine case.
41b5a7a8494e ("vdpa/mlx5: replace pthread functions unavailable in musl")
is an example how to solve this particular case.
It's also what that rte_ctrl_thread_create() does.