Hi, ________________________________ From: Stephen Hemminger Sent: Thursday, September 25, 2025 12:51 AM To: dev@dpdk.org Cc: Stephen Hemminger ; Xu, Rosen Subject: [RFC 5/6] intel/ipn3ke: avoid use of pthread_cancel [CAUTION: This email is from outside your organization. Unless you trust the sender, do not click on links or open attachments as it may be a fraudulent email attempting to steal your information and/or compromise your computer.] Can use the existing reference count (scan_num) to control the thread without using pthread_cancel. Signed-off-by: Stephen Hemminger --- drivers/net/intel/ipn3ke/ipn3ke_representor.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/net/intel/ipn3ke/ipn3ke_representor.c b/drivers/net/intel/ipn3ke/ipn3ke_representor.c index feb57420c3..4e831c6924 100644 --- a/drivers/net/intel/ipn3ke/ipn3ke_representor.c +++ b/drivers/net/intel/ipn3ke/ipn3ke_representor.c @@ -26,7 +26,7 @@ #include "ipn3ke_logs.h" #include "ipn3ke_ethdev.h" -static int ipn3ke_rpst_scan_num; +static volatile int ipn3ke_rpst_scan_num; static rte_thread_t ipn3ke_rpst_scan_thread; /** Double linked list of representor port. */ @@ -2578,7 +2578,7 @@ ipn3ke_rpst_scan_handle_request(__rte_unused void *param) #define MS 1000 #define SCAN_NUM 32 - for (;;) { + while (ipn3ke_rpst_scan_num > 0) { num = 0; TAILQ_FOREACH(rpst, &ipn3ke_rpst_list, next) { if (rpst->i40e_pf_eth && @@ -2612,10 +2612,6 @@ ipn3ke_rpst_scan_check(void) return -1; } } else if (ipn3ke_rpst_scan_num == 0) { - ret = pthread_cancel((pthread_t)ipn3ke_rpst_scan_thread.opaque_id); - if (ret) - IPN3KE_AFU_PMD_ERR("Can't cancel the thread"); - ret = rte_thread_join(ipn3ke_rpst_scan_thread, NULL); if (ret) IPN3KE_AFU_PMD_ERR("Can't join the thread"); -- 2.47.3 Reviewed-by: Rosen Xu