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 B59CAA0508; Thu, 14 Apr 2022 14:40:51 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5963840694; Thu, 14 Apr 2022 14:40:51 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 12AE240687 for ; Thu, 14 Apr 2022 14:40:50 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4BEF020C34E7; Thu, 14 Apr 2022 05:40:49 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4BEF020C34E7 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1649940049; bh=C90Ixa/RQljumwyvjMkGW20Rmnxrx6k4AEsIkUKo05A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=W5ODJcICDDDoHCEyxXyaOzMHrnXVXsaYzvATxv1Ae0lECUu7bv/BFa/t+Zc5HdgWM vkNxd3wuYRMzYsAAZtRfjYWDADm/CeBhZrmxot7xSltUb3tvCWgTw0s1gaHCgc/Gwa QY6+x5aTcW02PQLeMCGf4rmfdB4rhy58b9pDCpIU= From: Tyler Retzlaff To: dev@dpdk.org Cc: dmitry.kozliuk@gmail.com, david.marchand@redhat.com, Tyler Retzlaff Subject: [PATCH v2] eal/windows: set Windows main lcore affinitization Date: Thu, 14 Apr 2022 05:40:34 -0700 Message-Id: <1649940034-10695-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 --- 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 ca3c41aaa7..98d8b155c7 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -279,6 +279,7 @@ rte_eal_init(int argc, char **argv) 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 @@ rte_eal_init(int argc, char **argv) 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) { /* -- 2.33.0.vfs.0.0