From patchwork Tue Jan 24 18:12:20 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Tyler Retzlaff X-Patchwork-Id: 122502 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 87BC44247D; Tue, 24 Jan 2023 19:12:29 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id CF7BE42B8B; Tue, 24 Jan 2023 19:12:25 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6DAB140A89 for ; Tue, 24 Jan 2023 19:12:23 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id C0B9120E34C5; Tue, 24 Jan 2023 10:12:22 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C0B9120E34C5 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1674583942; bh=Ts6NDenqRvm7ePZMbZeV+K+dn2zalCeuMs72+s2dwjY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=L2cC0GdDMfp/WC0+zWc1Zw9zgg+uaBfdJ9MbgcFNdhz5m12l4cdtS1dLwCFmatvgo 56KtnHKlmUkY1P4wo8KKrAwx7tnClsm4X4J5rVFuASyiE47bkn2N27KN7tq+3oS1Hg 7ZyrCa8qSuzQHzzRkIKGbOoVn4LczQNTJn8u9tq0= 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 v10 3/4] eal: set thread name on Windows worker threads Date: Tue, 24 Jan 2023 10:12:20 -0800 Message-Id: <1674583941-16964-4-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1674583941-16964-1-git-send-email-roretzla@linux.microsoft.com> References: <1670439617-9054-1-git-send-email-roretzla@linux.microsoft.com> <1674583941-16964-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 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..e7d405b 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)