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 52FDEA00C5; Tue, 1 Feb 2022 07:29:41 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 167B540691; Tue, 1 Feb 2022 07:29:41 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2062.outbound.protection.outlook.com [40.107.212.62]) by mails.dpdk.org (Postfix) with ESMTP id 6553140685 for ; Tue, 1 Feb 2022 07:29:39 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=XqjSi1jEGRGZ2vLBb7LSdu4l4BRnJMa87ztVUdzMaDJye4lB+R48jxfAGwVGaBWgTel0ca3OYvGoEELNKYMuFuUXWMIZ5xqfFK8EW73j5+WuS5laIV++zpq8PM15wylmABUVIR9oO65/A3wnfWz6a6bxAGrgwshqKyrtDAccD7qMNUi2pYlp07FuFnTUWjea/lJQxgjcAQQkbGxgZ/FtFXLyTdhNymso0OsLHliH6FaIZK4pUQmfbLPpzcrxFaAtqJqUyZp9PwHm9ny3oUK2OSnL5Apg2pjDV8KbT3cwrVScfZqE1m1F/nu6sJ34X/zDgVlw1vLjs1qVMotkMyEnZQ== 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=yo2oCVbnuZjAgdFluV/+/ydCOmgGjl9sjIZb4nQxglI=; b=aJjLRdswbS3ktdid1pTraC9PZ8bqiO4to6sAega4M0r6xksAUHhKl6INh1M1uriBn6qvcTNMpoH7PWGraiFp4Zzs7UehN0NspNO74Dzs6WLdsNNEe3LDo8CjRepHB1OY1mHJV0RBknvP8a9+byBF6H60Jts6QHz03ssmxRGOMPRMNRONRhfTdryv7+3s05ZW1RRS/ok3pTAZ6ndygE+7Q5fCQZD/hriiKcRAelcD6dA3qhq4E3cf3fscUB7vSz0dylCbEGF+8P+cJxANIB930ITj935FyWdRlEhFWDkcsgle7t88H1u830dfZTZiVzDJaGxpFqiQGAGk8VIk4bUjkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=yo2oCVbnuZjAgdFluV/+/ydCOmgGjl9sjIZb4nQxglI=; b=KN+2SMeKEnSa/Px8IqKahUr3O61chkGXEXhCRSJJswGZl6Y3FLFRihjflrpuXWKoqgonHhio88Dgf7CwIgGylXMB7cC9kjQ8IjYrR1EU3dkdpDWIbUvsyOPIA1PBC0vLdS5n1WeyTNy3HQFHunNDaJkHPoz1+u5dpFFcIHcbU4v7OCX7WErB2xilhUtRzhq5FpwqCFgZDzMi8HZewpaYFDj27AmkMRLK58Dy4lJHFl7sUy9cIUjq4coGU3b8krZQGtRTVTZUCtgMT/0ftfDteD5SpBJOe8fOY5jSEUYAEnJy9Kz13FdSgtaUlYpEJry3Gz/56fqAy8V/N3fZh0w9ZQ== Received: from BL1PR12MB5380.namprd12.prod.outlook.com (2603:10b6:208:314::7) by BN6PR12MB1316.namprd12.prod.outlook.com (2603:10b6:404:1c::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4930.15; Tue, 1 Feb 2022 06:29:37 +0000 Received: from BL1PR12MB5380.namprd12.prod.outlook.com ([fe80::3538:8a3d:34d7:caa5]) by BL1PR12MB5380.namprd12.prod.outlook.com ([fe80::3538:8a3d:34d7:caa5%4]) with mapi id 15.20.4909.019; Tue, 1 Feb 2022 06:29:37 +0000 From: Tal Shnaiderman To: Pallavi Kadam , "dev@dpdk.org" CC: "NBU-Contact-Thomas Monjalon (EXTERNAL)" , "ranjit.menon@intel.com" , "dmitry.kozliuk@gmail.com" , "Narcisa.Vasile@microsoft.com" , "qiao.liu@intel.com" , Idan Hackmon Subject: RE: [PATCH] eal/windows: set pthread affinity Thread-Topic: [PATCH] eal/windows: set pthread affinity Thread-Index: AQHYDlicdpofEA0b2E6ld6Ni2Ih3xqx+TNOg Date: Tue, 1 Feb 2022 06:29:37 +0000 Message-ID: References: <20220121001749.458-1-pallavi.kadam@intel.com> In-Reply-To: <20220121001749.458-1-pallavi.kadam@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: ef3e2744-d2fa-4066-a0a8-08d9e54c3866 x-ms-traffictypediagnostic: BN6PR12MB1316:EE_ x-ld-processed: 43083d15-7273-40c1-b7db-39efd9ccc17a,ExtAddr 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: wClEczTqsQEhhobJA6NgQMPANjh7LfC9TvOoCEhjf9v6V4knVBy7Yn16nf3h1OTMHS0caEvHbdVR3QkXF/rsThg9Va3VOgNGVtfU4qJ7K7LaSfdLvKicLQ5vm9Uj740ZA/Wuq0NnCqVeYOj3rkW/VP9fyr18CDbGtkVtMgNhqhUM1pSAbuxzQAOF+Z168Wx2vzTZNDyTO92QiQOWBYKaHjBE0dQlpN/a5yncQeAGNXBkFZy0vHW+UKMOcAMc98/nOgxWRf61fpzxGBb1+2vmq2LuIwXPb5J8ZGS1MXjy+bP1IFfIsl/aEDmpCOBYDphNRw0HT3u0/GuaaelBegq1ywCH9PVves/oh1YTiamwu3zILfOPuL5HSEfWgfC7SobwgWTVyz5oCHU5+kfe4YcMuB3AidHgi4Q0Dijc0Qa1MM33KjZwg+DI1N+2qvU7IEXjk4sdnfMVQmxR8fs4pe+uFer/Zk8VNl7cbmcMabaPpckBQWJ7+aOwC1Yx756IMzQstkPHcPW/QP3YtBz8AcoCCm0TWNND194I5fPLOguFGN0XQrbwlWAjMpTzGTFllFxkPwYe5Vr5EINMfe9pXgZvUqP5QFni+t38uKxfC6M+52Ru8G24r1hagsUgPuG5zWHk76JQf2cDhFw11AeJlhLhLhnjtvI5vFoHX/0a52J2nQNpTLpPta/EZPX312RG3p1P/TK+XOS0dSZnc7n4PpKOFg== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BL1PR12MB5380.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(4636009)(366004)(38100700002)(122000001)(38070700005)(66556008)(66476007)(316002)(86362001)(4326008)(66946007)(66446008)(8676002)(64756008)(8936002)(76116006)(110136005)(54906003)(508600001)(71200400001)(5660300002)(7696005)(6506007)(9686003)(26005)(52536014)(186003)(55016003)(107886003)(2906002)(33656002)(20210929001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?mMEZGa1F37ZsewWkkFpTE14ar/xrroUQYfankgIJv0TP9CCnnOknXlEmGGti?= =?us-ascii?Q?sx+ISLYmzqXn6KUIwTeFD/gxga4IuGY5lMl49Rpch31elhOI8GwatM50aAPz?= =?us-ascii?Q?K8fivWAROXLwAnZBfTw2/vtQ4DQweyRIPcfb2x46/vwHkgcFLn9bkXoGAfkB?= =?us-ascii?Q?6nEVNcuLqLRBgOEsAXtAGUH41ELRJR7uxb56s8yws/8SPyi1FemZNxQoTfQG?= =?us-ascii?Q?nE6orSJVaAmUy2wd88SQSKIho4KX9KCZhZ44WktgQNtVe+xoBO5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1Rn3q7ew/BM1u3hAdbyUBdtjie4d05H1XysjMCB6/eNsRZw?= =?us-ascii?Q?hhLo1uNdMh+pGZ3iF6pkKrpVlhgCwe7ZVv2cpiJja9vOcvheQPeSiZDqA872?= =?us-ascii?Q?8JCI18Ywgq0vbdx7kKUoLvhfUhBJYosTQlelpts8F48QqdUZigotr+2WTKU2?= =?us-ascii?Q?XQUeJkRIwm+aRDEBF5mBrV7qXylLwcBHjhZrzvOyEp5g1dZNE5HVSlJ3aj76?= =?us-ascii?Q?jsGRubehD+sOUYiWYL5qXb8+LKLv1HOJuZ8uarQd9hzPMCEDtuW9emFkTilO?= =?us-ascii?Q?a/Hqw7ac5+lQN3wJYJ5m+Sv0iLRVfz4GJNIeO8UkOeoo0vGuLJLeQ00agYqk?= =?us-ascii?Q?vbfkgGa3JWSpYhMuP48RJ84cv0ywJ+To5Z4fQis4cyhfHBF/GSLB1hjQK7yE?= =?us-ascii?Q?ith8qxNlcvbBT+eXFbAxNMckQgdFsUQCrMwOJhctihUQQcLySpP3uL38PEDP?= =?us-ascii?Q?3g=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5380.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: ef3e2744-d2fa-4066-a0a8-08d9e54c3866 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Feb 2022 06:29:37.4911 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0Ev+06Nn3UKfvI22P2cIoG6XAX5hYs8k0XEOU2wpeh+FtuJv3hj9dNuQT2g++ZfaFA/ByvzwVG9gApaRligunw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1316 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 > Subject: [PATCH] eal/windows: set pthread affinity >=20 > External email: Use caution opening links or attachments >=20 >=20 > Sometimes OS tries to switch the core. So, bind the lcore thread to a fix= ed > core. > Implement affinity call on Windows similar to Linux. >=20 > Signed-off-by: Qiao Liu > Signed-off-by: Pallavi Kadam > --- > lib/eal/windows/eal.c | 4 ++++ > 1 file changed, 4 insertions(+) >=20 > 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) !=3D 0) > rte_panic("Cannot create thread\n"); > + ret =3D pthread_setaffinity_np(lcore_config[i].thread_id, > + sizeof(rte_cpuset_t), &lcore_config[i].cpuset); > + if (ret !=3D 0) > + RTE_LOG(DEBUG, EAL, "Cannot set affinity\n"); > } >=20 > /* Initialize services so drivers can register services during pr= obe. */ > -- > 2.31.1.windows.1 Acked-by: Tal Shnaiderman