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 2D94BA034C; Fri, 21 Jan 2022 00:51:07 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A9EC94069D; Fri, 21 Jan 2022 00:51:06 +0100 (CET) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 2498040042 for ; Fri, 21 Jan 2022 00:51:04 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1642722665; x=1674258665; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=GjEXNoRASxhvGSO0ZzCxZH06AtbgV6/o8DbV435VNGo=; b=IXQ/j5donn3c9LiaWYSIjKH5J5Z32d9tRFGKBQRADyxtglO/WJV1Gx0P Ulg9FgQo3rW58dH+faFM5pgpI5jXCZfdCBQVrxP1pAF4j1S5DnNq59hwT tiDSJ3B29TDBqQwaQvXOEpOmHV9niEqSvdcL/xS7UOCW7ooJ6k/ilC82p HDiOKnQwA5BRGq3Rc3M0/FZweyyQTM4fPQjcaaOMNCmGx7rZgmjADVgoA L7aURs/aXchqsaYdZRyVeb+Ir5/Q107C7oZL7hEPwWSyoyaZURpwS+fpY miKo5NZp1Nik6dp/xp9cjLAf6JSLpscorB8vSaZcBIsv9THCBN6t1SEN6 Q==; IronPort-Data: A9a23:Dd5yX6KpQ5QJPY1UFE+Rf5clxSXFcZb7ZxGr2PjKsXjdYENS1zcOy zdNWGGHMqzYNmKhfI0iYNiz8RgO65TTz982GwporCE8RH908vbIVI+TRqvS04J+DSFhoGZPt p1GAjUVBJlsFhcwgD/zaOC5xZVb/fjQHOGnYAL8EnktA1ciEU/NsDo78wIDqtcAbeORXkXd6 bsen+WFYAX/g2cuajpPg06+gEgHUMra6WtwUmMWOKgjUG/2zxH527pEfcldh1OhKmVlNrbSq 9TrldlVzUuAl/sZMe5Jp56gGqE8auWLYVXR0Co+t5+K2XCurgRqukoy2WF1hU1/011llPgoo DlBWAfZpa7E8cQglcxEOyS0HR2SMoVt8r79GWCCr/auxmf+QX7h4vc3AGApaNhwFuZfWQmi9 NQfMisIYRnb377wwrz9S+9wi8BlJ87uVG8dkig4i26fV653B8uTK0nJzYYwMDMYnslKGf/AZ owaYDZmaTzBZQFCPhEcD5dWcOKA3CWiKGUE9QPPzUYxy2XM/l1jire9C/v6ZOGDatgMolyor H2TqgwVBTlfbrRz0wGt7nKrg+bUtSb8XoAbELq+sPhnnDWuKnc7DwcNUFSy+aHlzEywHdNZN 0EQvCEpqMDe6XCWczU0ZDXgyFbsg/LWc4E4/zESgO1V9pfp3g== IronPort-HdrOrdr: A9a23:0HxQD66M5nt+cSaetgPXwN/XdLJyesId70hD6qm+c3Jom6uj5q STdZsgtSMc5Ax8ZJhCo6HkBED/ewK+yXcd2+B4UItKNzOGhILHFu5fBMzZqAEIHReVygck79 YDT5RD X-IronPort-AV: E=McAfee;i="6200,9189,10233"; a="245304594" X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="245304594" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 Jan 2022 15:51:03 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,303,1635231600"; d="scan'208";a="626522581" Received: from win-dpdk-pallavi.jf.intel.com (HELO localhost.localdomain) ([10.166.188.111]) by orsmga004.jf.intel.com with ESMTP; 20 Jan 2022 15:51:03 -0800 From: Pallavi Kadam To: dev@dpdk.org Cc: thomas@monjalon.net, ranjit.menon@intel.com, dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com, qiao.liu@intel.com, pallavi.kadam@intel.com Subject: [PATCH] eal/windows: set pthread affinity Date: Thu, 20 Jan 2022 16:17:49 -0800 Message-Id: <20220121001749.458-1-pallavi.kadam@intel.com> X-Mailer: git-send-email 2.31.1.windows.1 MIME-Version: 1.0 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 Sometimes OS tries to switch the core. So, bind the lcore thread to a fixed core. Implement affinity call on Windows similar to Linux. Signed-off-by: Qiao Liu Signed-off-by: Pallavi Kadam --- lib/eal/windows/eal.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/eal/windows/eal.c b/lib/eal/windows/eal.c index 67db7f099a..ca3c41aaa7 100644 --- a/lib/eal/windows/eal.c +++ b/lib/eal/windows/eal.c @@ -422,6 +422,10 @@ rte_eal_init(int argc, char **argv) /* create a thread for each lcore */ if (eal_thread_create(&lcore_config[i].thread_id) != 0) rte_panic("Cannot create thread\n"); + ret = pthread_setaffinity_np(lcore_config[i].thread_id, + sizeof(rte_cpuset_t), &lcore_config[i].cpuset); + if (ret != 0) + RTE_LOG(DEBUG, EAL, "Cannot set affinity\n"); } /* Initialize services so drivers can register services during probe. */ -- 2.31.1.windows.1