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 40EF842D48; Sun, 25 Jun 2023 10:46:08 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BC32940ED8; Sun, 25 Jun 2023 10:46:07 +0200 (CEST) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2080.outbound.protection.outlook.com [40.107.7.80]) by mails.dpdk.org (Postfix) with ESMTP id 287FF40A7F for ; Sun, 25 Jun 2023 10:46:06 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lSHf9iW5Q+PPZ9qIcFC3JOgg5c41nnMD2r8ieQ59FG0=; b=YSAGgLq5g8aKretTIg8LMljmuD6B6pfiFld/76L+GCzstzvCmUBFvBiGeARzq5wHmLo+bZvsb6oRn64LcgF4Rs9qqsiQPSVMjW9vc1D9CAelR2iamv5oT3MkvJ1DIRYEPM8+uuPtfM6kBmC9X0vULeYQtgok2u/SCZje9GCdqsE= Received: from DUZPR01CA0302.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b7::19) by AS8PR08MB8491.eurprd08.prod.outlook.com (2603:10a6:20b:566::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.26; Sun, 25 Jun 2023 08:46:03 +0000 Received: from DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com (2603:10a6:10:4b7:cafe::c7) by DUZPR01CA0302.outlook.office365.com (2603:10a6:10:4b7::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.33 via Frontend Transport; Sun, 25 Jun 2023 08:46:03 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by DBAEUR03FT053.mail.protection.outlook.com (100.127.142.121) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6544.14 via Frontend Transport; Sun, 25 Jun 2023 08:46:03 +0000 Received: ("Tessian outbound 7c913606c6e6:v142"); Sun, 25 Jun 2023 08:46:03 +0000 X-CR-MTA-TID: 64aa7808 Received: from efef13addd8d.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 9491CF88-B746-4B52-AC31-6218B3972158.1; Sun, 25 Jun 2023 08:45:57 +0000 Received: from EUR04-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id efef13addd8d.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Sun, 25 Jun 2023 08:45:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=f4OlEZtyG16dxwe4twIKqZH28BQZGyAlfZJjW8evLbNY85sFI7TnEa8RQjvKfP9CKn33vRe51NOhkALEyDtFeD3v32iMpUNAQRKAjpRUFLhOsPgKHkoWRGzzjEpxmadbL6u3Pr4emo3i10MxedHQnVtV3QnOyLNgS87G5vVmt/sZbPB7IntBqw3cd3qs3RsXWfqCVnISIjKXCPRlf3h9HorNfrjKgxNIc5FdFOt89GhgyrihW0PCuo0k4m2Et2oqCnNkeJrNlvCczJJrpLvmwBhPM6RJMrpWP0pvBPKTE0peBhOKULKue+1Xp0MCzuwe3XRjxBBCgiHyJkYarBUbUg== 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=lSHf9iW5Q+PPZ9qIcFC3JOgg5c41nnMD2r8ieQ59FG0=; b=OxBja+wj6TMdXDC+ILVvzTWuidk/0/4uU3RvY7b2xOgchiThR1KwGBW0uI9C+oZZCyVFFxZ3vnKd5V/FGqUiOpNX3t7UtMfhu5EOvnSRDpMJYqI8XjQ8gw8H5stPxYkUZswz+O2ZLlLq/tWZFD/030bukpOIYbAUtquQhpmHE+jNOJJR0jas84/1G2FGz1zIdzEa0CLjDWr+jl33OT9t2YuYeV5CFBoNLzCmdS3AzisSARDiRwEBHEz2NuNe0J0sukZaGXKPxr6kmWlof7uvFMzxn7fH1HcYK8Lb6J1XjPAs181uxVxXGYHpfQaV6PJ7LTNg9pz49iapa0/+eoc/mg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=lSHf9iW5Q+PPZ9qIcFC3JOgg5c41nnMD2r8ieQ59FG0=; b=YSAGgLq5g8aKretTIg8LMljmuD6B6pfiFld/76L+GCzstzvCmUBFvBiGeARzq5wHmLo+bZvsb6oRn64LcgF4Rs9qqsiQPSVMjW9vc1D9CAelR2iamv5oT3MkvJ1DIRYEPM8+uuPtfM6kBmC9X0vULeYQtgok2u/SCZje9GCdqsE= Received: from AS8PR08MB7080.eurprd08.prod.outlook.com (2603:10a6:20b:401::19) by GV2PR08MB9422.eurprd08.prod.outlook.com (2603:10a6:150:dd::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6521.24; Sun, 25 Jun 2023 08:45:47 +0000 Received: from AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::dd71:31fd:80b0:c4e0]) by AS8PR08MB7080.eurprd08.prod.outlook.com ([fe80::dd71:31fd:80b0:c4e0%4]) with mapi id 15.20.6521.026; Sun, 25 Jun 2023 08:45:47 +0000 From: Ruifeng Wang To: Tyler Retzlaff , =?iso-8859-1?Q?Mattias_R=F6nnblom?= CC: "thomas@monjalon.net" , "david.marchand@redhat.com" , "dev@dpdk.org" , "konstantin.v.ananyev@yandex.ru" , Honnappa Nagarahalli , nd , nd Subject: RE: [PATCH] eal: add notes to SMP memory barrier APIs Thread-Topic: [PATCH] eal: add notes to SMP memory barrier APIs Thread-Index: AQHZpAvj8kzdJhMlqUmgKdlh+VjK+a+XJBQAgAHNggCAAkGJ0A== Date: Sun, 25 Jun 2023 08:45:47 +0000 Message-ID: References: <20230621064420.163931-1-ruifeng.wang@arm.com> <4954a01e-53e3-c070-d737-a60c0042c736@lysator.liu.se> <20230623215118.GC14396@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230623215118.GC14396@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: DA4DBD46E1E5C4428B1744784897C40B.0 x-checkrecipientchecked: true Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: AS8PR08MB7080:EE_|GV2PR08MB9422:EE_|DBAEUR03FT053:EE_|AS8PR08MB8491:EE_ X-MS-Office365-Filtering-Correlation-Id: 319d9de4-7cf0-4bf8-0aa6-08db75589bd2 x-ld-processed: f34e5979-57d9-4aaa-ad4d-b122a662184d,ExtAddr x-checkrecipientrouted: true nodisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: TySc5n5LtLnjUwCZcWzAHu/EL3i/WuPa8WUNAhBCyLV/D1ilep+WFCYYYMTjfaji//f7jJMA7fnUueKgquUmhCCs/RHa9hFpwFE0QDDOBgnBQvYWI/pzBXyESUfCPQmoOVeZSOf8TGTwwvXzDg/KPEtVKrptkufnk2EQUT/hkfQi7WN3+A45eZqqnggFS5ov3k0BRj/RUP0P7G66lvEuZMSQn1zYPKpEeVy420j203UIT1p6QWRYEqY7u3+prFkCGzGZVC2aOFi1FV20j0aLRp1R+ERIcnLMZt8EHYTL7AUK/Z5lMb8RZMCcwdBBk6sZol+WX3FQslCaYSUUfD3xE/4KodU0hAAKOBIxxEwXtjpqGnL+KuJGsMwCTLhg4IjbsI+tGWpfVRvEOkFjNPsJIP383cIcAdQGf+mW+pNqPqT0+u5o6wDCvkmto/qzCljh92Qd8CLyelkVuX4t0qUONEVNpKQZwYcqGYSK7iLPyKvQVsiZChrUOjyMgWq0wIcvC001bG9+v2Ka6qBvSaHxtkc8e5lbr8vMNs6feT+ustXKTn/NNhINXoxQvQMJiuR2Uml7Agdf2lGOtFR8vHBZ2jEDhs9N4LyE5oBuOe/o6CvwMsbnAj3e6MTwG54cNi6jy15+DLsOOXoS6bz3RquczQ== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:AS8PR08MB7080.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230028)(4636009)(396003)(39860400002)(376002)(366004)(346002)(136003)(451199021)(5660300002)(52536014)(4326008)(76116006)(66556008)(66446008)(33656002)(64756008)(66946007)(66476007)(478600001)(316002)(8676002)(8936002)(2906002)(55016003)(110136005)(54906003)(38070700005)(86362001)(41300700001)(7696005)(9686003)(53546011)(186003)(66574015)(6506007)(26005)(38100700002)(71200400001)(83380400001)(122000001)(23180200003); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR08MB9422 Original-Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 41180ff2-2290-4eea-c796-08db75589228 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 0i6P4YkO+W5hHjICim4sXWb1X/vCOVzxQWcgbBG6YeZqI53GEJvqrHmKWL0zWF/sLcivV1lxdfnm4CJg1ieoi1X4TdlXiEctVx9XWtv3puqh3yiQqkIY6Q/kWX2nhCsS0XoAOPlrv0wSk2WLKi6cG9DGcMiSpyZW7hFyq/dz65hCzlaGK1iPBiYb9PnV80HCmCcf02lTt7K9dw2cIbiPsRFUxCX8Mq6UwT2L5ICy40eSWmRdzhRBT2n3HszVHBnzL2tQCz/7pTAGEsekquQXPCwNk9Y6WU9L7zxENGsCULei6uCHOe4ito/EhbYDyR4hpiwf4Z8QW/K4X+kUpGhJO3W6nkMndoQQg+H/34MZdi5SEHlQ10p/0dX5B0C8sf3ifr8DNjYxExRo3NyOPjsM/wP0mn09lMs/rH1ncAO4B7mB5jIBMm3B7hdv1Wpu58D3xHgwSiUt0Qnh698vpxiIQ3vQ0AejUBw6pvNyeSnqjyS4E5lPbPbeiPGpni5RZQNk2rA3Z20rakNQZcneyK30Pzq6mIv/t+eR04U2D1JLrzTVCCCGboQrbd6WAjs9YL7vmUuLKjt5W2BpG6D8qbm6+lpGprKKSDe6LFa36p0tFlumWOniYUmBmFTP47r2Rk75fN/WkaV8CcLhpRNsatRAlaXVp+gMtqnRxtN4bAvo8SwrgDgMRx+6C4uxvlt2y/8+snG6ky8u8HcJWog66yvkQob6vILYkZuKjEsQF/o3maU3oPyrd35B4mjekw00xQtg X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230028)(4636009)(376002)(346002)(136003)(396003)(39860400002)(451199021)(46966006)(36840700001)(2906002)(7696005)(82310400005)(82740400003)(356005)(81166007)(83380400001)(47076005)(336012)(66574015)(6506007)(26005)(9686003)(53546011)(186003)(36860700001)(55016003)(40480700001)(41300700001)(110136005)(54906003)(86362001)(478600001)(316002)(70586007)(70206006)(4326008)(33656002)(5660300002)(52536014)(8676002)(8936002)(23180200003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Jun 2023 08:46:03.4862 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 319d9de4-7cf0-4bf8-0aa6-08db75589bd2 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: DBAEUR03FT053.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR08MB8491 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 > -----Original Message----- > From: Tyler Retzlaff > Sent: Saturday, June 24, 2023 5:51 AM > To: Mattias R=F6nnblom > Cc: Ruifeng Wang ; thomas@monjalon.net; david.march= and@redhat.com; > dev@dpdk.org; konstantin.v.ananyev@yandex.ru; Honnappa Nagarahalli > ; nd > Subject: Re: [PATCH] eal: add notes to SMP memory barrier APIs >=20 > On Thu, Jun 22, 2023 at 08:19:30PM +0200, Mattias R=EF=BF=BDnnblom wrote: > > On 2023-06-21 08:44, Ruifeng Wang wrote: > > >The rte_smp_xx() APIs are deprecated. But it is not mentioned in the > > >function header. > > >Added notes in function header for clarification. > > > > > >Signed-off-by: Ruifeng Wang > > >--- > > > lib/eal/include/generic/rte_atomic.h | 15 +++++++++++++++ > > > 1 file changed, 15 insertions(+) > > > > > >diff --git a/lib/eal/include/generic/rte_atomic.h > > >b/lib/eal/include/generic/rte_atomic.h > > >index 58df843c54..542a2c16ff 100644 > > >--- a/lib/eal/include/generic/rte_atomic.h > > >+++ b/lib/eal/include/generic/rte_atomic.h > > >@@ -55,6 +55,11 @@ static inline void rte_rmb(void); > > > * Guarantees that the LOAD and STORE operations that precede the > > > * rte_smp_mb() call are globally visible across the lcores > > > * before the LOAD and STORE operations that follows it. > > >+ * > > >+ * @note > > >+ * This function is deprecated. It adds complexity to the memory > > >+ model > > >+ * used by this project. C11 memory model should always be used. > > >+ * rte_atomic_thread_fence() should be used instead. > > > > It's somewhat confusing to learn I should use the C11 memory model, > > and then in the next sentence that I should call a function which is > > not in C11. >=20 > i wonder if we can just do without the comments until we begin to adopt c= hanges for 23.11 > release because the guidance will be short lived. >=20 > in 23.07 we want to say that only gcc builtins that align with the standa= rd C++ memory > model should be used. >=20 > in 23.11 we want to say that only standard C11 atomics should be used. Good point. The memory order parameter will change in 23.11. >=20 > my suggestion i guess is just adapt the patch to be appropriate for > 23.11 and only merge it after 23.07 release? might be easier to manage. Agree to only merge it after 23.07.=20 I will update the comment for standard C11 atomics. >=20 > > > > I think it would be helpful to say which memory_model parameters > > should be used to replace the rte_smp_*mb() calls, and if there are > > any difference in semantics between the Linux kernel-style barriers > > and their C11 (near-)equivalents. > > > > Is there some particular reason these functions aren't marked > > __rte_deprecated? Too many warnings? > > > > > */ > > > static inline void rte_smp_mb(void); @@ -64,6 +69,11 @@ static > > >inline void rte_smp_mb(void); > > > * Guarantees that the STORE operations that precede the > > > * rte_smp_wmb() call are globally visible across the lcores > > > * before the STORE operations that follows it. > > >+ * > > >+ * @note > > >+ * This function is deprecated. It adds complexity to the memory > > >+ model > > >+ * used by this project. C11 memory model should always be used. > > >+ * rte_atomic_thread_fence() should be used instead. > > > */ > > > static inline void rte_smp_wmb(void); @@ -73,6 +83,11 @@ static > > >inline void rte_smp_wmb(void); > > > * Guarantees that the LOAD operations that precede the > > > * rte_smp_rmb() call are globally visible across the lcores > > > * before the LOAD operations that follows it. > > >+ * > > >+ * @note > > >+ * This function is deprecated. It adds complexity to the memory > > >+ model > > >+ * used by this project. C11 memory model should always be used. > > >+ * rte_atomic_thread_fence() should be used instead. > > > */ > > > static inline void rte_smp_rmb(void); ///@}