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 B28E5A00C5; Sat, 5 Feb 2022 13:52:05 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 41152406A2; Sat, 5 Feb 2022 13:52:05 +0100 (CET) Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by mails.dpdk.org (Postfix) with ESMTP id E939A40143 for ; Sat, 5 Feb 2022 13:52:02 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1644065523; x=1675601523; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=W1LhFmGmmZ+u94ko/Lf1Q5yfMn0cZB71DQMUds9o204=; b=fywyEDdV6fLl8//eyLW5cOR0AMyvlgLhZlyUJKXPj96iGUYZNW0LiQ8M RGFRTLAV5KMnurDy83Gxt0e0N1qHsKeaBCqNARGvG2OHzz5DKleAUGnel xsynENhqVNtaWQgl9N3WZL/dvGGz0o2EAu1F/HUFfsCjU9mzZM0MI90+J fmqUHqMsrsTa7lrmEZj1ET9BZQxci63LtHUYVO8K6c6NAILTcoKU+rDGQ hywBxgXYcgfLwjK4F1vCL4kT5GduFSvUdQTXvY2UVLwHixEN0nfKoiCzY 5/rw/Cf9+k/04olmN5tJDrYuIkV6YP4KHTS/hnBoJVyHDmN20eLORDhI4 Q==; X-IronPort-AV: E=McAfee;i="6200,9189,10248"; a="232076311" X-IronPort-AV: E=Sophos;i="5.88,345,1635231600"; d="scan'208";a="232076311" Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Feb 2022 04:52:01 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,345,1635231600"; d="scan'208";a="539501414" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by orsmga008.jf.intel.com with ESMTP; 05 Feb 2022 04:52:01 -0800 Received: from orsmsx608.amr.corp.intel.com (10.22.229.21) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Sat, 5 Feb 2022 04:52:01 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx608.amr.corp.intel.com (10.22.229.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Sat, 5 Feb 2022 04:52:01 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.48) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Sat, 5 Feb 2022 04:51:59 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Hvbqp8GuFEhKNJ1WgbDABGvEKrV2QZWCQ8VAoFPlZLSHsOiRCjZXZEQXiZg/dPxhy0W32BvmNhwvO35Rj/0whBrxbvkOGIxUZ9Qf7kx5wU20oWs4yL1ypqqpHzw0pdqYGGFtqGOkg4Hu4hEQIKQYioRIXsesuMAAfNsJp0HiFPbQWe2d2aP/ABvHNafwFiQrfdwmOVNonJDsVFT7pWo5httLhcU9JlsF5Own/plubWUZi1D4KQecQJYqiamKmTSiGle1tMb8udfdllw7+wTwLq1JAFRYjKSmwLB9JTQTMgjVDGqBHGEx9InGqPM8bY0yHntOQ4UAl1Zm+M70rng4ng== 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=0PI9uRd+cpSNI0eR2BFDRrWRWntnOFdH3B2T9GSqGHY=; b=RCuuqwXy/Qzo+eG5GjN9Wqkk6IR8kucyaNkO6zUjeJz85B/vClzw2Ml98Dn4iVTH5Hts8JHDX3jQOaMeq+P3LZQEqiliufGryPJOlm4ZxlsH8Pwq6hSAfktAn4rqAanQ+wnEzw+Bzs2g0z4jJSUxIh42YtwXnBCmxXF8t7Eob0WjyDdUjxtAwcnkrf/CtObdjqZ1e3oP5uNqYPK/AM4QXwuzZPPSE3J2jGivZsLDFYOyuYzuhpcpAY+Edfpd69yaZFivYc8jKPPGe39i3n3ekGLR2k0LNhLgS1AC/9/ay4CP8U/NJgP1175tWOoFKv59oKCB6hdgQR1eiGw7cQSd5Q== 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 BL0PR11MB2932.namprd11.prod.outlook.com (2603:10b6:208:78::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4951.17; Sat, 5 Feb 2022 12:51:54 +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.018; Sat, 5 Feb 2022 12:51:53 +0000 From: "Ananyev, Konstantin" To: Tyler Retzlaff CC: "navasile@linux.microsoft.com" , "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: [PATCH v18 2/8] eal: add thread attributes Thread-Index: AQHYGkqyAbwbJkWjhkqaLtnA22f1J6yE6RGA Date: Sat, 5 Feb 2022 12:51:53 +0000 Message-ID: References: <20220205044140.GA7734@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20220205044140.GA7734@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> 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: 8c1c4f5f-b915-45ae-1e36-08d9e8a64932 x-ms-traffictypediagnostic: BL0PR11MB2932:EE_ x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: Uh5oli33oSViYKZXYvYLYqf4qfXcNsyrIdHgDs9H5Wd1ioJi3Dn7YR5NifcLXyv4pZgqHC3VeWTXxsEFjQ+bDbIo1uC8ZM5zoXBQYHLP10JjtYv3a2d7BIFH+H0WPZjeUBQ1LVjG7/A97p92i3EZ+1TTcu58rcbiIEjMZAg662pkvHdHwF8WoMCvdI8rXcsK57rvPtbpoKRrhFHRgpujyPSsGo5p/ioBHKg+AAFvdBX+R5bYMGljhaAbHsj6LligFu1oY7msWbmDnnjJOJ7dXQCWphsJZ/LswG6YnaEZXxWS2V0w/LDZnWjn+A8JfichCYkAD180ElzlsiYso4p45+ZXUEBs9g0w54YO7FvUlk9vKdHWLbSWZTNEhdjX8WLhBRERZmarAENqyf8RpT2uYdDxN2Xt3EfDpwu9GDEyVUbH1uw3YSad1C/LEQxkHz1ZdBJAkZ4n5VGuaQ2tWJM2Q2sbVtqLbhzeWY0yrtgyInR5T7M4u5/bZGFMl0mjnbskE4+HJJlp4DihnoQ54XDVaqYCMVp0WEKVW2mlpL2csQI6hYWRSoHOPnXvsREnxCvvUEufx9Z/xUagfLSnP5UeI/JIZxPm0ycajDyP8KFY57VzMBPjK/e020KfPDyIJNFPN+teFn45VKgb2279oVMaaohFgaJLNmRMFdzjIXBZt0YYUgqDGMnjquHYJkB8/h0lrAgxczIfq2rCH/MuMUSw1Q== 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)(82960400001)(76116006)(66946007)(86362001)(2906002)(122000001)(52536014)(55016003)(71200400001)(4326008)(7416002)(8936002)(33656002)(8676002)(6506007)(66476007)(66446008)(7696005)(5660300002)(66556008)(9686003)(64756008)(316002)(38100700002)(6916009)(83380400001)(186003)(508600001)(38070700005)(54906003)(26005); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Pgh9LkznKdF5vHg1N3aZQ7g8qUwsC9puJf3ZnaNV5A5uUbqfsot1KmPEuFUe?= =?us-ascii?Q?WF5/jEsNL/MBl1ut5q9nGG+EK1drzLAtgQ6JRSNqnvYbQ9SuWZQqn5J/TgpT?= =?us-ascii?Q?oPvFeCNbQPSGZbSPhN3riOkCjSxBVil/bxSsCEDHWChumeEUXt+8TOhcCxsb?= =?us-ascii?Q?Uq0wYjRoibZhF3tntPKe+FygYamh3/+oz82PS6z0P8rlJLo8lK44zzqiRCUv?= =?us-ascii?Q?M+qL7bhHShfOENvyuNwPBzMOY+jjM+F5yrkvkHHdA80yeq9Z/Mbf5CUZs+s8?= =?us-ascii?Q?Nfl3/oq8ctZ45SsLOnROm1mOD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?= =?us-ascii?Q?PcnfmSJ8SzqYhKv8uoy9gOCgNtIR6AhhCk/dJ9y53c4bVFiGg2EDfWwfSzg9?= =?us-ascii?Q?MEsIMwyh5iCNJUUTRblSEufZ9j/bZRo79n9rApiGys0mNYU2yKyk+etu+z4U?= =?us-ascii?Q?0qp/BQrNgn8O/SPLMuzoj2pztZR17+rzhD9hZbIE0Z4ATP7AON/LTNXTi+hR?= =?us-ascii?Q?fDKYIoLkS+fESeG6wWvMiDcFCJPvZ0FsYK+LRcXpNdnq6XMkSogTE/ykJJKD?= =?us-ascii?Q?42JkVWK6BQ37YG4xwIaI9V9FbPOJhrH+HFHUMFNs0FVvGc1qiCIH+3H7yd95?= =?us-ascii?Q?0RWPJ6o2CbDHQZK1dLDi8Knv95gCJqLOquVCKBiJgarxKOIJwLmjK1l3eRRc?= =?us-ascii?Q?Qq5m1WOfwlqRoS8eSdwtwn66+LoG9vf/tO7B1LWNF1S6M/VPpW/LmChZk8oQ?= =?us-ascii?Q?z74p6EoGx5ZphbZACQvy7+H47GKBqtU0hjZ6Th98Fdgf3TUUckPu2lNR6A/U?= =?us-ascii?Q?Hj0N5g=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: 8c1c4f5f-b915-45ae-1e36-08d9e8a64932 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Feb 2022 12:51:53.8466 (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: VQBIhtGkAAFOkKNXsjCSLJ+kkG35RltUwFGVm88588R3Bb+jB+is8D53Be2sstjecfqLepYjy7GhZxEv5M6eOFypeiolwIV+oipS3xWOnoI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR11MB2932 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 >=20 > On Fri, Feb 04, 2022 at 07:21:10PM +0000, Ananyev, Konstantin wrote: > > > Implement thread attributes for: > > > * thread affinity > > > * thread priority > > > Implement functions for managing thread attributes. > > > > > > Priority is represented through an enum that allows for two levels: > > > - RTE_THREAD_PRIORITY_NORMAL > > > - RTE_THREAD_PRIORITY_REALTIME_CRITICAL > > > > > > Affinity is described by the rte_cpuset_t type. > > > > > > An rte_thread_attr_t object can be set to the default values > > > by calling rte_thread_attr_init(). > > > > > > 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(+) > > > > > > 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 > > > > > > #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); > > > } > > > > > > +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. >=20 > i ask this question again. what useful thing will the user application > do when handling -EINVAL or rte_errno =3D EINVAL is returned for > incorrectly supplied parameters? Let the user application to decide. But inside the lib we shouldn't just crash if user provided invalid paramet= ers for one of our functions. >=20 > again, there should be a mechanism that allows a policy for how these > non-recoverable errors are handled rather than defaulting to tossing > it over the fence and expecting the application to do something > sensible when the only thing it could do is conclusively more > complicated than having passed the correct parameters in the first place. >=20 > more often then not application programmers will ignore superfluous > return values from functions like this resulting in the bug remaining > longer and the state / reason being lost. >=20 > please reconsider.