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 B8752A04A3; Wed, 26 Jan 2022 19:41:34 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4B8594274D; Wed, 26 Jan 2022 19:41:34 +0100 (CET) Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mails.dpdk.org (Postfix) with ESMTP id E530D4274B for ; Wed, 26 Jan 2022 19:41:31 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1643222493; x=1674758493; h=message-id:date:subject:to:cc:references:from: in-reply-to:mime-version; bh=u5h6P+j7VIgEpq95GkltcK4MaGtqI8uKMkuUyFeBlxY=; b=T5XQ315MdMUTRpQBxU8q6H3wJ0Xxpxb/AC5TC4Feec50YgHXGfF9Wmg5 1h09XGl4BvuMdV4GsvKrWctGlwv7kVVI2S8RlRsBtQkzDceK+eZkunO9S zpS/0aCo5qLSCxNT3nXRfEHT25AIoypFCrhvPCURQY4TDhZ243DabHnX1 OyFtXULrdIaLCCIT7PRikQWD4p9ImxOgxIacN+kBYeaQhK7LY/Djrr91G ILvUHfBdl6eU5t/eZxQtAYRXC0YKatlc9HIPkePuL3CizEjovDaVXgy0K j8qfTUtg6qcIjXZWggFwxNbqOUzVWyBj+rk8wwzDF+1TjLQCtLmwXzuJN A==; X-IronPort-AV: E=McAfee;i="6200,9189,10238"; a="246566345" X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208,217";a="246566345" Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Jan 2022 10:41:30 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,318,1635231600"; d="scan'208,217";a="696331534" Received: from fmsmsx604.amr.corp.intel.com ([10.18.126.84]) by orsmga005.jf.intel.com with ESMTP; 26 Jan 2022 10:41:30 -0800 Received: from fmsmsx609.amr.corp.intel.com (10.18.126.89) by fmsmsx604.amr.corp.intel.com (10.18.126.84) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Wed, 26 Jan 2022 10:41:29 -0800 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx609.amr.corp.intel.com (10.18.126.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Wed, 26 Jan 2022 10:41:29 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.106) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Wed, 26 Jan 2022 10:41:29 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Rt3iuouEpl5bI63ECCXgOmlIJ11ZMFndwbyNYHoWhLxZ39pCqbiGrgzkxN8Rj+xme0jdvITIc4fg//mHCvSwfVDiBrQwVjyhQG+agpo82WAPvRoUsm5XAgTw0DhJOoxfBNFzhx1eVxfvVXS7eBz5Cwf7K2h3vd9kpWa7N/SDpHtET5GJ+fcOoSNjTzdno8l9Rq54PYVBwxhORr+DGLutWPsRR0yXyOiVKnMYxT2YVRxTKMYhMb6ZSjl69YRmosDztMjSTHVonj7yqkIFumHLmixsrRxFGwsMFuSYNFTgMFr1PwiEk5hn/3y1yPwATLVTeNduFqKc5j/UUCXKXoWVfg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=n6XCMIKOps/cLyX7Sw4bupEoPZ+ZRxQJEsNhBy/VDUk=; b=MoJL700DNb3Tbrxjn/HK6uy1msfy14Vy028GjgPs9Um24OrVfJa7g/ytCr1CXAPsNa5B0lZ/WlCE/fIT+wYIzV5ONjrvqzpBw7QQx0Z+FMxHMkom8QmksxwNZiCP/Q2ydTS3V4Oj0OrnSes29d0/cx4iSbwkuwgsMGLG5xV2EgUhyHbsfRTlzHvfBRekC1OUvTFu0TYUigOk2/u52tNeBydUqRoG5x/CD2F2gNzz7BTVy9vxtoBhu2Bz+U/O5TzpX6SRYkMTbu64i7ucyo9B+LIam+t4J+HUNjoFLCHrimyTLadkQcSZEX/0513evVZFudF7/Z/Q+jWnbPMKu0xOBQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from SA2PR11MB5210.namprd11.prod.outlook.com (2603:10b6:806:fa::23) by BY5PR11MB3976.namprd11.prod.outlook.com (2603:10b6:a03:187::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.17; Wed, 26 Jan 2022 18:41:27 +0000 Received: from SA2PR11MB5210.namprd11.prod.outlook.com ([fe80::cc91:9f95:9307:be6c]) by SA2PR11MB5210.namprd11.prod.outlook.com ([fe80::cc91:9f95:9307:be6c%2]) with mapi id 15.20.4888.020; Wed, 26 Jan 2022 18:41:27 +0000 Content-Type: multipart/alternative; boundary="------------CuI8rFsikxKVhdTfSwP5AYKg" Message-ID: <122ce9c2-f34d-9a0a-3b24-88c06c244dab@intel.com> Date: Wed, 26 Jan 2022 10:41:24 -0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Firefox/91.0 Thunderbird/91.4.1 Subject: Re: [PATCH] eal/windows: set pthread affinity Content-Language: en-US To: Pallavi Kadam , CC: , , , References: <20220121001749.458-1-pallavi.kadam@intel.com> From: "Menon, Ranjit" In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com> X-ClientProxiedBy: MW4PR03CA0236.namprd03.prod.outlook.com (2603:10b6:303:b9::31) To SA2PR11MB5210.namprd11.prod.outlook.com (2603:10b6:806:fa::23) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 1462d512-123f-44c5-2d63-08d9e0fb75d1 X-MS-TrafficTypeDiagnostic: BY5PR11MB3976:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3173; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4q9/A1rQdB1r9c/Vcp+ejgEIncW6Yyb5xCZG2OtLhjeOI4gf5nekvmcNM7bK2WZ7yx84xaY7oChB9C27+ccfDZJPLFYZ5pr68+JxpuzC/jyIxySwW8UOBrE4+PfObWm9cxfFSoCdWlWhIdXRRC1TP0LqtSgKYNiNE7z2MXpmhCzvQpi53e0DsUoqB84R/Jp24nt4mXh4iXZ3QWIYaCBQ6yThZ88HYoCc9cVKdcygW1PKGASoTh7meqLrj6SlfQPJMUyGAjeXN+oPZ0tNPI/LGPmCuh/saGGlzlC4TSteddgRaBzXAPfjib+l7ovuso9vB4lKe7ulC04rGc2lWBZ/fdn/zeetyXpoTBq8XPa6ia9qo98U6Nn7TzfgU3v1zSyQV+A7Rgp8qKwybAGrQBbp9LhpSJVnEIxGiBa0XkA/zS/WUvdyBshowdQU8UfOTznHUPK/fnTGA1IgW24pJq5CndZkSYKs14EMpH1Ar57rbnSM1xZch+FtjxCkRDYPUuNPMWO397NOMCVoXzqBc8EZ2/ffSUlLHEzeQmj0t8QxgvHUzOf9XwumboXZrF1S6dIZoC1CVs5VyK5aeBswEBs38xzLKpacQYvaSoIhiKHazadJ5H+bNkT475jYRvh7Cd2jPozWH7KIxFCpTrARYYZBvkZY7DPM6chUKQEIIAG9UrU4uQBKF4rxBrQoUqtDdPeTc27SpLmQ/r3Ia6jAxn3zdi8St1YTzZo/bIo5TUiuhLA= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SA2PR11MB5210.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(366004)(66476007)(26005)(6506007)(82960400001)(316002)(5660300002)(36756003)(66946007)(4326008)(31696002)(8676002)(6512007)(33964004)(31686004)(66556008)(53546011)(186003)(2616005)(8936002)(86362001)(6486002)(38100700002)(2906002)(6666004)(107886003)(508600001)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?c1JQUWg0aDlVZDZlcWlLUHNmV2YyT1lSTFBYc0twLzBxcjY4ZENFYXpMeWZC?= =?utf-8?B?NXQzT2d3VUl5OTVFaEZPRTVreUMyaDZkTFVpTWl3aFNScUk4S1AwM3dXSVln?= =?utf-8?B?dElqTTIxdWhiaUN0Q2UzbThLOCs2R0ZQTGMzN0lsQWM2ekpNbkRWdXZwR0ZQ?= =?utf-8?B?Szdha0V3aUxVWVg4RU9wcGU0VCtPWnFNWlhyazcvLzJwaVRlMjhmUzlwQkFO?= =?utf-8?B?ZENLMGJHZi9Ib0ZRK1JnblBxTzc1ckxXVnJVdnNUajVEUThkbXNzd3JiTVJq?= =?utf-8?B?aXpNRGtsczFyOFFReVJZSU5CRjhMZCthV1BDaWV3cUVsbWhtSnUwbGtYcGU3?= =?utf-8?B?RWhzOFZuL1Q3NHU2ZUQ1VVBLbnpCSTRWUVZVaFovMmRLWlk3c291Wi9FcTAz?= =?utf-8?B?dXN3dmxVZzlSdlNqY3J4dS9QeCtLMzRBVnp0aHdhN3NKTHNnM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75d1 X-MS-Exchange-CrossTenant-AuthSource: SA2PR11MB5210.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jan 2022 18:41:27.3472 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2WoZtT5+E7vrzqJZIdICpwwXYWHlHwmO8QN6UjIjm8cFd0TaGNvuzJ2TQ1h7Ocyrewn2U/VJUFUhwCR2p0AHmw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR11MB3976 X-OriginatorOrg: intel.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 --------------CuI8rFsikxKVhdTfSwP5AYKg Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit On 1/20/2022 4:17 PM, 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"); > } > > /* Initialize services so drivers can register services during probe. */ Acked-by: Ranjit Menon --------------CuI8rFsikxKVhdTfSwP5AYKg Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: 7bit
On 1/20/2022 4:17 PM, 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 <qiao.liu@intel.com>
Signed-off-by: Pallavi Kadam <pallavi.kadam@intel.com>
---
 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. */

Acked-by: Ranjit Menon <ranjit.menon@intel.com>



  


--------------CuI8rFsikxKVhdTfSwP5AYKg--