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 6C454A0508; Thu, 14 Apr 2022 14:43:47 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5F6BE40694; Thu, 14 Apr 2022 14:43:47 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 14A6B40687 for ; Thu, 14 Apr 2022 14:43:46 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 689AE20C34E7; Thu, 14 Apr 2022 05:43:45 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 689AE20C34E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649940225; bh=WTsn6nhqY2vYJ8CbmiZOMs1xsbElXjF9Z1K+f49EtgA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hBuzUqvaZMXU24PsQy0wUeOriOeWRpssup5fEE505DBndDPo1LvgqNfsoris1aEwt E0ybSD3VkJJnxkRW6a7FYzmEHjukwCLynvnBiZdt76y7clg8XA8N5Om1YTENOT+D0Q /bMzYFdRdmjNkdvslsI5xYK/fgXfLNLi83DMSOOA= From: Tyler Retzlaff To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v3] eal/windows: set Windows main lcore affinitization Date: Thu, 14 Apr 2022 05:43:43 -0700 Message-Id: <1649940223-11193-1-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1648630829-4372-1-git-send-email-roretzla@linux.microsoft.com> References: <1648630829-4372-1-git-send-email-roretzla@linux.microsoft.com> 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 Add missing code to affinitize main_lcore from lcore configuration. Signed-off-by: Tyler Retzlaff --- v3: update commit message s/add/Add/ v2: RTE_LOG of eal_thread_dump_current_affinity as linux does lib/eal/windows/eal.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index ca3c41a..98d8b15 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -279,6 +279,7 @@ enum rte_proc_type_t bool has_phys_addr; enum rte_iova_mode iova_mode; int ret; + char cpuset[RTE_CPU_AFFINITY_STR_LEN]; eal_log_init(NULL, 0); @@ -401,9 +402,20 @@ enum rte_proc_type_t return -1; } + if (pthread_setaffinity_np(pthread_self(), sizeof(rte_cpuset_t), + &lcore_config[config->main_lcore].cpuset) != 0) { + rte_eal_init_alert("Cannot set affinity"); + rte_errno = EINVAL; + return -1; + } __rte_thread_init(config->main_lcore, &lcore_config[config->main_lcore].cpuset); + ret = eal_thread_dump_current_affinity(cpuset, sizeof(cpuset)); + RTE_LOG(DEBUG, EAL, "Main lcore %u is ready (tid=%zx;cpuset=[%s%s])\n", + config->main_lcore, (uintptr_t)pthread_self(), cpuset, + ret == 0 ? "" : "..."); + RTE_LCORE_FOREACH_WORKER(i) { /* -- 1.8.3.1