From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 54A6B4246C; Mon, 23 Jan 2023 20:39:43 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7E4E640E2D; Mon, 23 Jan 2023 20:39:38 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id DB45540684 for ; Mon, 23 Jan 2023 20:39:36 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 36D2820E2C08; Mon, 23 Jan 2023 11:39:36 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 36D2820E2C08 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1674502776; bh=9rmDbCrh+YjpojsrkPlTXbp4Nh5ceLRvgK6/UToh3qc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ixRYjLHV+5XbiUuE4uhr5kf+2rsveyR+/yy5w+R4f8VFBISLYDs2Aurdmz4Sr4e9X 585Ok8ZTWzpKudGxD+SpdoXW1OpqaaOLFWx0ZL05brqY5vgIl85UXb1DguExL+acAF +aUw+656j2+kuNmY75L8HE0r+ac7m8Hk4u1xy/mQ= From: Tyler Retzlaff To: dev@dpdk.org Cc: thomas@monjalon.net, david.marchand@redhat.com, jerinjacobk@gmail.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v7 3/5] eal: set thread name on Windows worker threads Date: Mon, 23 Jan 2023 11:39:32 -0800 Message-Id: <1674502774-20253-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1674502774-20253-1-git-send-email-roretzla@linux.microsoft.com> References: <1670439617-9054-1-git-send-email-roretzla@linux.microsoft.com> <1674502774-20253-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Bring Windows EAL worker thread initialization in line with linux & freebsd by setting the worker thread name using the new platform agnostic rte_thread_set_name API. Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup --- lib/eal/windows/eal.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index b9f95ed..e561f87 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -282,6 +282,7 @@ enum rte_proc_type_t enum rte_iova_mode iova_mode; int ret; char cpuset[RTE_CPU_AFFINITY_STR_LEN]; + char thread_name[RTE_MAX_THREAD_NAME_LEN]; eal_log_init(NULL, 0); @@ -437,6 +438,12 @@ enum rte_proc_type_t if (rte_thread_create(&lcore_config[i].thread_id, NULL, eal_thread_loop, (void *)(uintptr_t)i) != 0) rte_panic("Cannot create thread\n"); + + /* Set thread_name for aid in debugging. */ + snprintf(thread_name, sizeof(thread_name), + "rte-worker-%d", i); + rte_thread_set_name(lcore_config[i].thread_id, thread_name); + ret = rte_thread_set_affinity_by_id(lcore_config[i].thread_id, &lcore_config[i].cpuset); if (ret != 0) -- 1.8.3.1