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 6E9AEA00C2; Fri, 4 Feb 2022 20:21:17 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 425864013F; Fri, 4 Feb 2022 20:21:17 +0100 (CET) Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mails.dpdk.org (Postfix) with ESMTP id 6160340041 for ; Fri, 4 Feb 2022 20:21:15 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644002475; x=1675538475; h=from:to:cc:subject:date:message-id: content-transfer-encoding:mime-version; bh=xURYE8THhnGUy8/gTJcd5h5StclLELuypcsbQt38l2M=; b=aNqbZ2Hgr67rg3TX4DZLszluJHpVOs/KJUE+bGodFYmXMzKE77pNiRYp p9S9m6Iedy5Fj0/LJQ0LJB3nqX6B8wkCW2YEWZkCM8BEDbI8x27ZyBcpe jGYsvkRwI0E7PHRB0rOXZ7XPd3+fA5CMu8p4pN6dS4uMGqmON0jvlZSxJ zsGRLB6qsNpr7tVV9Ez8WegQIh0n6Alc7FADnJQcFu1jBovNwYF6hKOL4 sbPiUqjiZmEYRFNTfn6k6QX0xsVjm30Rf2Jb5ql8oyjt6o4T9TqKe3H2V fVo1bj2Xjbt7H0tqhgfXvo9TzyKsNNi6n+12llSl7ztIXxktmZV+CUWn8 g==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="235828121" X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="235828121" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Feb 2022 11:21:14 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,343,1635231600"; d="scan'208";a="631795650" Received: from fmsmsx602.amr.corp.intel.com ([10.18.126.82]) by orsmga004.jf.intel.com with ESMTP; 04 Feb 2022 11:21:14 -0800 Received: from fmsmsx601.amr.corp.intel.com (10.18.126.81) by fmsmsx602.amr.corp.intel.com (10.18.126.82) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Fri, 4 Feb 2022 11:21:13 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Fri, 4 Feb 2022 11:21:13 -0800 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (104.47.70.109) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Fri, 4 Feb 2022 11:21:13 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=M1Pa5py8TnVrIekdiP/p2rwBnWIxq6O4FM7x7u9LhCjdUukYwFP73x/rwJkq2ghZDYSnXIpLkBIq+3ot7TPF20tvOHXgYXnL8/wM9J+4YWS/nTMGI5DuysVfEy2NzkcK+KFHCOx5QsrUNz6ogJyWUZRkJvXq1uc4d6VjfQzdG8aseeGitVkJDx1AbbV8p/fiBU/RjHIbUMatfmKMxDCBW0x3oeUU/v31JzzjwXJhg9VfFBnGtTXIp7tNo0JM1wb7MKjMyP1KY9n7zmhqIS+AlauZ4p7yzE7Ne8Gwy7l2j8Kt9dK65YXzL8q7xyq+LVqlcJ8FkoinQbsJKsydfdTmCQ== 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=AuAmB1Z6YwB64V+l3m62rzaB2mnNuIB6VM1JcoYAxRg=; b=JND52wgfh3ZAMkQEGHGCF/VzaWOe0QoNfMp29+EcPTlYeB6jsXrcbWLWAbb6SLdrJHJo2wv0D4hzK8jZcI48x+0FJvD3XapI61MnNTVdIB3VBX2d5WIS1a3vYNeCM8y4BjFbX15QJkLYny8tpK2xa8nOG8V+h5XOwzSQol2xOduNkCQEpnr7O2alVSEzFzg6NirR56KxIjbJ1C0Zk+lLnjg5EjxozTCNcYp1KUdc8xdJTqqM+C8F0gxaK3n26uk6objaeJwfX0V4hvMoueDh6q7Ab0aBI+GRTPoH2oSxOnGs0U+/+YEWJ70Ii3rXHlJMRTyshVAdBkpB6Jqjyp8UqA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none Received: from DM6PR11MB4491.namprd11.prod.outlook.com (2603:10b6:5:204::19) by MN2PR11MB3838.namprd11.prod.outlook.com (2603:10b6:208:f3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.14; Fri, 4 Feb 2022 19:21:10 +0000 Received: from DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::8ccc:ed65:78fa:1b07]) by DM6PR11MB4491.namprd11.prod.outlook.com ([fe80::8ccc:ed65:78fa:1b07%4]) with mapi id 15.20.4951.012; Fri, 4 Feb 2022 19:21:10 +0000 From: "Ananyev, Konstantin" To: "navasile@linux.microsoft.com" CC: "Richardson, Bruce" , "david.marchand@redhat.com" , "dev@dpdk.org" , "dmitry.kozliuk@gmail.com" , "dmitrym@microsoft.com" , "khot@microsoft.com" , "navasile@microsoft.com" , "ocardona@microsoft.com" , "Kadam, Pallavi" , "roretzla@microsoft.com" , "talshn@nvidia.com" , "thomas@monjalon.net" Subject: Re: [PATCH v18 2/8] eal: add thread attributes Thread-Topic: Re: [PATCH v18 2/8] eal: add thread attributes Thread-Index: AdgZ+0wutXKD25X/TSuHBxsfhvendA== Date: Fri, 4 Feb 2022 19:21:10 +0000 Message-ID: Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-product: dlpe-windows dlp-reaction: no-action dlp-version: 11.6.200.16 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 276d5d93-bf01-4ff8-ee07-08d9e813806b x-ms-traffictypediagnostic: MN2PR11MB3838:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6430; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: p16wNQF0/O89SQPaQ6NK9NxOiIBNWOXYsCcUet5scDPz+XYWr8nrHoW977s1jkRz51uU1DnBVZAYMF9SAEYLuwhQ3DvagaXaedadw8e9qwfHxIoGvauO6FdhsugAKrZDgnpL+DCyrhDtA6q7GYjKAlPFASQIqnmayo8j2RYM3bW7xAwl8p3lL0hpo9Xfrvva1458NgmgBPIsx/2Mjgu7/6EE19iDYS07FSaqlxeZMXLPvr6lBrzZoEEDBpQAsbfUgWp0FXyI+Toim4ZAalJSgTjva3RyGpjQbCLJid5FcEtrqZXD17vOXxAiUr/Zlxhi/dvX8cq933HrGY1ZQWe/HBdYHrKmIflUZ+cJm2ttBxohgt+jIMBgn3TSVx6hxxQv49aPUS5zSfd2CKH4rhQR5YNLAkGQ4jevyFV0oX1e+xBbAJY0T6+c5t9GsTVDtN6Jx7AaGJ7YG3VitZqhlP+HCmDXggBoQRJ8cXm+EggVcKVomAJrxBHU8gkkDqHFiLo0lAbhAgpd+OCpV9uvd4Ij6TT6B0w/GgesS309wtJDGQ4PW/0gSV6idNTXR9GhVoUl0NPS67yDUBHtdvu9/I02VWcK8Tbnjkax2paaR8k5Ghna6TIhK6p4zRU2Q/wYe0pOeJwdMN38DjRx1MJ6pSpjqg2lOcKah9bnRP4pS/QhnFEPfkgdiHy00HOQq4fbduiRGvO4cEqCqX/Otrs1VZInmA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR11MB4491.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230001)(366004)(4326008)(2906002)(71200400001)(6506007)(8676002)(7696005)(66476007)(64756008)(66446008)(86362001)(66556008)(8936002)(186003)(26005)(7416002)(76116006)(66946007)(5660300002)(9686003)(33656002)(38100700002)(122000001)(52536014)(83380400001)(55016003)(38070700005)(54906003)(82960400001)(316002)(6916009)(508600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Tl9/QFLsW3iINNMvm1hHWh1+Y9GFz6KLcWDccJXvLom0zQTFRRESp86R7xPz?= =?us-ascii?Q?u2VX6K90DyN9eSd0PAbI/Geurqf31WLfWpdk5l5XNxkbuBkKgGAPen7GWTba?= =?us-ascii?Q?VApm851CfZyptQzgUa8xsDCRQc6qHYiBkNDOcwWQWl7oJxHtSgPjlq8nmLIe?= =?us-ascii?Q?puvWns+kVjPEN01mMygJCEaEOcTnTuAq0RQ0tVXpEQVKjS2Kp8M3gReFxwdh?= =?us-ascii?Q?bZ/r4VS5eFOMRwwK06Z1MF9eA+O5M9wagVS6Xf8/FTJIOHwkitmxo0TXz44V?= =?us-ascii?Q?dSEwiJ6o7kfCVB3vMx5QfPO23MA3ZpIT9b4SG3me3uJA8PobujQ3GdlyHY50?= =?us-ascii?Q?cIcQZxzk5FTPuR23I/UO58xlkQh2A6YU7rfpLk0G/hNQp2mIH0CwFSPTqTlo?= =?us-ascii?Q?s9LK8uN63n4QORrbfDYGrf2wzsbsaw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9NxSUrUkun3Nna3ry5mUOUG26rOhFw7IfajtUhoE9f79B?= =?us-ascii?Q?ImSvf8CzOy77bkJ9Kb9YE6lcUFw8tTgNq7/tFWI7xKCr21j8c9hiLKLgFAw8?= =?us-ascii?Q?5y4uG0QpT33awfgTKbllhXqoZcG6LFUmt+oo4f2HFzjKauWxqCxtUUS83nnP?= =?us-ascii?Q?7W0HCMY9SdpGJKAADPVBpZ5/SKPhWM9iumGu9dD/7lY9KK7GMQbPdZweJVyp?= =?us-ascii?Q?dG+/5XA5g2Hm5qTDtxEem+gQAstkNNFNX/k0KdAcAFq0XvJy9CZBFZQJTshO?= =?us-ascii?Q?5ocX3QRrXVoinSepdOUGgodK8jQmukbKQ1lSxEG8UdEYm3a7ZMcN2vdMB4SO?= =?us-ascii?Q?/ZLqkw=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR11MB4491.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 276d5d93-bf01-4ff8-ee07-08d9e813806b X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Feb 2022 19:21:10.5434 (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: VZ4yeVtWbz45FWdHX9RLr1Aip44T+c9dYcOvAyiITFi+1kwQ3PB/qZtAfSrFncqYkvxRjHewEMq5JgnnZZ2ncy5ZsNUm0TQLRIAgLxuGstA= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3838 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 > Implement thread attributes for: > * thread affinity > * thread priority > Implement functions for managing thread attributes. >=20 > Priority is represented through an enum that allows for two levels: > - RTE_THREAD_PRIORITY_NORMAL > - RTE_THREAD_PRIORITY_REALTIME_CRITICAL >=20 > Affinity is described by the rte_cpuset_t type. >=20 > An rte_thread_attr_t object can be set to the default values > by calling rte_thread_attr_init(). >=20 > Signed-off-by: Narcisa Vasile > --- > lib/eal/common/rte_thread.c | 46 ++++++++++++++++++ > lib/eal/include/rte_thread.h | 91 ++++++++++++++++++++++++++++++++++++ > lib/eal/version.map | 4 ++ > lib/eal/windows/rte_thread.c | 44 +++++++++++++++++ > 4 files changed, 185 insertions(+) >=20 > diff --git a/lib/eal/common/rte_thread.c b/lib/eal/common/rte_thread.c > index 92a7451b0a..27ad1c7eb0 100644 > --- a/lib/eal/common/rte_thread.c > +++ b/lib/eal/common/rte_thread.c > @@ -9,6 +9,7 @@ > #include >=20 > #include > +#include > #include > #include > #include > @@ -33,6 +34,51 @@ rte_thread_equal(rte_thread_t t1, rte_thread_t t2) > return pthread_equal((pthread_t)t1.opaque_id, (pthread_t)t2.opaque_id); > } >=20 > +int > +rte_thread_attr_init(rte_thread_attr_t *attr) > +{ > + RTE_VERIFY(attr !=3D NULL); As a generic one, here and everywhere: Please don't use RTE_VERIFY() for checking input function parameters. We don't want to panic in case of just invalid parameter from user. > + > + CPU_ZERO(&attr->cpuset); > + attr->priority =3D RTE_THREAD_PRIORITY_NORMAL; > + > + return 0; > +} > +