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 7377CA04A5; Wed, 26 Jan 2022 07:45:03 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41972426F1; Wed, 26 Jan 2022 07:45:03 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id CD5DC4069D for ; Wed, 26 Jan 2022 07:45:01 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1059) id 2490820B6C61; Tue, 25 Jan 2022 22:45:01 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 2490820B6C61 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1643179501; bh=YYMh7nLs4vj8vmfa98Tz4rzuUK1vfExvLVdQPSiuJX0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=N+uwp4fZQ3IJpAzEydWcdRJGJVFVMkBR5Rh5TQBP4OxsXVBlknLJnny3APynfJ5ez 5ipAg7CBFxtUnin9D9j64+qpFSsxVYgqf5v5d2xR+eerXjtz05i3/aXR4WRydxFB2u vdnx8CFvZXST4Srod+OF4mMMUVQXzqY0J9JR9VP0= Date: Tue, 25 Jan 2022 22:45:01 -0800 From: Narcisa Ana Maria Vasile To: Pallavi Kadam Cc: dev@dpdk.org, thomas@monjalon.net, ranjit.menon@intel.com, dmitry.kozliuk@gmail.com, Narcisa.Vasile@microsoft.com, qiao.liu@intel.com Subject: Re: [PATCH] eal/windows: set pthread affinity Message-ID: <20220126064501.GA7862@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <20220121001749.458-1-pallavi.kadam@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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 On Thu, Jan 20, 2022 at 04:17:49PM -0800, Pallavi Kadam wrote: > 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"); > } > Acked-by: Narcisa Vasile