Test-Label: iol-testing Test-Status: WARNING http://dpdk.org/patch/94528 _apply patch failure_ Submitter: Narcisa Ana Maria Vasile Date: Friday, June 18 2021 21:54:54 Applied on: CommitID:478614ee1f62e172c4d4770f157fc9bbb6563523 Apply patch set 94528-94533 failed: Checking patch lib/eal/common/rte_thread.c... error: lib/eal/common/rte_thread.c: does not exist in index Checking patch lib/eal/include/rte_thread.h... error: while searching for: #include /** * Thread id descriptor. */ error: patch failed: lib/eal/include/rte_thread.h:24 error: while searching for: __rte_experimental int rte_thread_barrier_destroy(rte_thread_barrier *barrier); /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. error: patch failed: lib/eal/include/rte_thread.h:439 Checking patch lib/eal/version.map... error: while searching for: rte_thread_barrier_init; rte_thread_barrier_wait; rte_thread_barrier_destroy; }; INTERNAL { error: patch failed: lib/eal/version.map:443 Checking patch lib/eal/windows/rte_thread.c... error: while searching for: return 0; } int rte_thread_key_create(rte_thread_key *key, __rte_unused void (*destructor)(void *)) error: patch failed: lib/eal/windows/rte_thread.c:556 Applying patch lib/eal/include/rte_thread.h with 2 rejects... Rejected hunk #1. Rejected hunk #2. Applying patch lib/eal/version.map with 1 reject... Rejected hunk #1. Applying patch lib/eal/windows/rte_thread.c with 1 reject... Rejected hunk #1. diff a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h (rejected hunks) @@ -24,6 +24,8 @@ extern "C" { #include +#define RTE_THREAD_MAX_DESCRIPTION_LENGTH 16 + /** * Thread id descriptor. */ @@ -439,6 +441,22 @@ int rte_thread_barrier_wait(rte_thread_barrier *barrier); __rte_experimental int rte_thread_barrier_destroy(rte_thread_barrier *barrier); +/** + * Set the name of the thread represented by 'thread_id'. + * + * @param thread_id + * The id of the thread. + * + * @param name + * Thread name to set. + * + * @return + * On success, return 0. + * On failure, return a positive errno-style error number. + */ +__rte_experimental +int rte_thread_name_set(rte_thread_t thread_id, const char *name); + /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. diff a/lib/eal/version.map b/lib/eal/version.map (rejected hunks) @@ -443,6 +443,7 @@ EXPERIMENTAL { rte_thread_barrier_init; rte_thread_barrier_wait; rte_thread_barrier_destroy; + rte_thread_name_set; }; INTERNAL { diff a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c (rejected hunks) @@ -556,6 +556,66 @@ rte_thread_barrier_destroy(rte_thread_barrier *barrier) return 0; } +typedef HRESULT +(*SetThreadDescription_type)(HANDLE thread_handle, PCWSTR thread_descirption); + +int +rte_thread_name_set(rte_thread_t thread_id, const char *name) +{ + int ret = 0; + size_t count; + HRESULT hr; + HANDLE thread_handle = NULL; + WCHAR w_name[RTE_THREAD_MAX_DESCRIPTION_LENGTH]; + HMODULE kernel_lib = NULL; + SetThreadDescription_type SetThreadDescription_ptr; + + static const char library_name[] = "kernel32.dll"; + static const char function[] = "SetThreadDescription"; + + kernel_lib = LoadLibraryA(library_name); + if (kernel_lib == NULL) { + ret = thread_log_last_error("LoadLibraryA(\"kernel32.dll\")"); + goto cleanup; + } + + SetThreadDescription_ptr = (SetThreadDescription_type)( + (void *)GetProcAddress(kernel_lib, function)); + if (SetThreadDescription_ptr == NULL) { + ret = thread_log_last_error("GetProcAddress(\"kernel32.dll\", \"SetThreadDescription\")"); + goto cleanup; + } + + thread_handle = OpenThread(THREAD_SET_LIMITED_INFORMATION, FALSE, + thread_id.opaque_id); + if (thread_handle == NULL) { + ret = thread_log_last_error("OpenThread()"); + goto cleanup; + } + + count = mbstowcs(w_name, name, RTE_THREAD_MAX_DESCRIPTION_LENGTH); + if (count < 0) { + RTE_LOG(DEBUG, EAL, "Invalid thread name!\n"); + ret = EINVAL; + goto cleanup; + } + + hr = SetThreadDescription_ptr(thread_handle, w_name); + if (FAILED(hr)) { + ret = thread_log_last_error("SetThreadDescription()"); + goto cleanup; + } + +cleanup: + if (kernel_lib != NULL) + FreeLibrary(kernel_lib); + if (thread_handle != NULL) { + CloseHandle(thread_handle); + thread_handle = NULL; + } + return ret; +} + int rte_thread_key_create(rte_thread_key *key, __rte_unused void (*destructor)(void *)) Checking patch lib/eal/common/eal_common_thread.c... Checking patch lib/eal/include/rte_thread.h... error: while searching for: __rte_experimental int rte_thread_name_set(rte_thread_t thread_id, const char *name); /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. error: patch failed: lib/eal/include/rte_thread.h:457 Checking patch lib/eal/version.map... error: while searching for: rte_thread_barrier_wait; rte_thread_barrier_destroy; rte_thread_name_set; }; INTERNAL { error: patch failed: lib/eal/version.map:444 Applied patch lib/eal/common/eal_common_thread.c cleanly. Applying patch lib/eal/include/rte_thread.h with 1 reject... Rejected hunk #1. Applying patch lib/eal/version.map with 1 reject... Rejected hunk #1. diff a/lib/eal/include/rte_thread.h b/lib/eal/include/rte_thread.h (rejected hunks) @@ -457,6 +457,33 @@ int rte_thread_barrier_destroy(rte_thread_barrier *barrier); __rte_experimental int rte_thread_name_set(rte_thread_t thread_id, const char *name); +/** + * Create a control thread. + * + * Set affinity and thread name. The affinity of the new thread is based + * on the CPU affinity retrieved at the time rte_eal_init() was called, + * the dataplane and service lcores are then excluded. + * + * @param thread + * Filled with the thread id of the new created thread. + * + * @param name + * The name of the control thread (max 16 characters including '\0'). + * + * @param start_routine + * Function to be executed by the new thread. + * + * @param arg + * Argument passed to start_routine. + * + * @return + * On success, return 0; + * On failure, return a positive errno-style error number. + */ +__rte_experimental +int rte_thread_ctrl_thread_create(rte_thread_t *thread, const char *name, + rte_thread_func start_routine, void *arg); + /** * Create a TLS data key visible to all threads in the process. * the created key is later used to get/set a value. diff a/lib/eal/version.map b/lib/eal/version.map (rejected hunks) @@ -444,6 +444,7 @@ EXPERIMENTAL { rte_thread_barrier_wait; rte_thread_barrier_destroy; rte_thread_name_set; + rte_thread_ctrl_thread_create; }; INTERNAL { Checking patch lib/eal/common/eal_common_options.c... Hunk #1 succeeded at 1847 (offset -25 lines). Hunk #2 succeeded at 1875 (offset -25 lines). Checking patch lib/eal/common/eal_common_thread.c... error: lib/eal/common/eal_common_thread.c: does not match index Checking patch lib/eal/common/eal_common_trace.c... Checking patch lib/eal/common/eal_private.h... Checking patch lib/eal/common/malloc_mp.c... Checking patch lib/eal/freebsd/eal.c... Checking patch lib/eal/freebsd/eal_alarm.c... Checking patch lib/eal/freebsd/eal_interrupts.c... Checking patch lib/eal/freebsd/eal_thread.c... Checking patch lib/eal/include/rte_lcore.h... Checking patch lib/eal/include/rte_per_lcore.h... Checking patch lib/eal/linux/eal.c... Checking patch lib/eal/linux/eal_alarm.c... Checking patch lib/eal/linux/eal_interrupts.c... Checking patch lib/eal/linux/eal_thread.c... Checking patch lib/eal/linux/eal_timer.c... Checking patch lib/eal/version.map... Checking patch lib/eal/windows/eal.c... Checking patch lib/eal/windows/eal_interrupts.c... Checking patch lib/eal/windows/eal_thread.c... Checking patch lib/eal/windows/eal_windows.h... Checking patch lib/eal/windows/include/rte_windows.h... Checking patch lib/eal/windows/rte_thread.c... error: while searching for: } count = mbstowcs(w_name, name, RTE_THREAD_MAX_DESCRIPTION_LENGTH); if (count < 0) { RTE_LOG(DEBUG, EAL, "Invalid thread name!\n"); ret = EINVAL; goto cleanup; error: patch failed: lib/eal/windows/rte_thread.c:594 Checking patch lib/ethdev/rte_ethdev.c... Checking patch lib/ethdev/rte_ethdev_core.h... Checking patch lib/ethdev/rte_flow.c... Checking patch lib/eventdev/rte_event_eth_rx_adapter.c... Checking patch lib/vhost/vhost.c... Applied patch lib/eal/common/eal_common_options.c cleanly. Applied patch lib/eal/common/eal_common_trace.c cleanly. Applied patch lib/eal/common/eal_private.h cleanly. Applied patch lib/eal/common/malloc_mp.c cleanly. Applied patch lib/eal/freebsd/eal.c cleanly. Applied patch lib/eal/freebsd/eal_alarm.c cleanly. Applied patch lib/eal/freebsd/eal_interrupts.c cleanly. Applied patch lib/eal/freebsd/eal_thread.c cleanly. Applied patch lib/eal/include/rte_lcore.h cleanly. Applied patch lib/eal/include/rte_per_lcore.h cleanly. Applied patch lib/eal/linux/eal.c cleanly. Applied patch lib/eal/linux/eal_alarm.c cleanly. Applied patch lib/eal/linux/eal_interrupts.c cleanly. Applied patch lib/eal/linux/eal_thread.c cleanly. Applied patch lib/eal/linux/eal_timer.c cleanly. Applied patch lib/eal/version.map cleanly. Applied patch lib/eal/windows/eal.c cleanly. Applied patch lib/eal/windows/eal_interrupts.c cleanly. Applied patch lib/eal/windows/eal_thread.c cleanly. Applied patch lib/eal/windows/eal_windows.h cleanly. Applied patch lib/eal/windows/include/rte_windows.h cleanly. Applying patch lib/eal/windows/rte_thread.c with 1 reject... Rejected hunk #1. Applied patch lib/ethdev/rte_ethdev.c cleanly. Applied patch lib/ethdev/rte_ethdev_core.h cleanly. Applied patch lib/ethdev/rte_flow.c cleanly. Applied patch lib/eventdev/rte_event_eth_rx_adapter.c cleanly. Applied patch lib/vhost/vhost.c cleanly. diff a/lib/eal/windows/rte_thread.c b/lib/eal/windows/rte_thread.c (rejected hunks) @@ -594,7 +594,7 @@ rte_thread_name_set(rte_thread_t thread_id, const char *name) } count = mbstowcs(w_name, name, RTE_THREAD_MAX_DESCRIPTION_LENGTH); - if (count < 0) { + if (count == (size_t) (-1)) { RTE_LOG(DEBUG, EAL, "Invalid thread name!\n"); ret = EINVAL; goto cleanup; Checking patch lib/eal/common/eal_common_thread.c... error: lib/eal/common/eal_common_thread.c: does not match index Checking patch lib/eal/common/eal_thread.h... Checking patch lib/eal/freebsd/eal.c... error: lib/eal/freebsd/eal.c: does not match index Checking patch lib/eal/linux/eal.c... error: lib/eal/linux/eal.c: does not match index Checking patch lib/eal/windows/eal.c... error: lib/eal/windows/eal.c: does not match index Applied patch lib/eal/common/eal_thread.h cleanly. https://lab.dpdk.org/results/dashboard/patchsets/17447/ UNH-IOL DPDK Community Lab