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 7F8AF41C34; Wed, 8 Feb 2023 00:34:31 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EA1040E6E; Wed, 8 Feb 2023 00:34:29 +0100 (CET) Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-he1eur04on2041.outbound.protection.outlook.com [40.107.7.41]) by mails.dpdk.org (Postfix) with ESMTP id A5DA940DDB for ; Wed, 8 Feb 2023 00:34:28 +0100 (CET) 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=AkgFKEUShJKAM3Mmn4Ko45MxLv4dliSVTzryBWN1OJA=; b=r23q//8+uo5TPgVNUwqeIVxJz1dRYxOxabvpJiIvZMscRRLawlqgFtXNJOLJRd6/GgWlB9Bb5QJ/2Q/49rFVqTPU9FKKr1r13Cq62eIPvnwAwG49Hi/IpT4CK/Jk0UnRhtXrInrynowP0HOYJcaENs1b96W7TN80g2LHTKW/lH4= Received: from DB6PR0301CA0025.eurprd03.prod.outlook.com (2603:10a6:4:3e::35) by AM7PR08MB5432.eurprd08.prod.outlook.com (2603:10a6:20b:10b::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.36; Tue, 7 Feb 2023 23:34:25 +0000 Received: from DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com (2603:10a6:4:3e:cafe::17) by DB6PR0301CA0025.outlook.office365.com (2603:10a6:4:3e::35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32 via Frontend Transport; Tue, 7 Feb 2023 23:34:25 +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 DBAEUR03FT044.mail.protection.outlook.com (100.127.142.189) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.17 via Frontend Transport; Tue, 7 Feb 2023 23:34:24 +0000 Received: ("Tessian outbound b1d3ffe56e73:v132"); Tue, 07 Feb 2023 23:34:24 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2643dadee2936359 X-CR-MTA-TID: 64aa7808 Received: from 5090f0f2c5a7.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 29B54622-D425-4DDB-B5E8-F99BFBF8828F.1; Tue, 07 Feb 2023 23:34:17 +0000 Received: from EUR02-DB5-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 5090f0f2c5a7.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Tue, 07 Feb 2023 23:34:17 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gUCgqaFRb4CPyoR0LJXAskY3RYo7rGp6JAH68YMAnNZb4yZukkVG9Y73W/L5mZ/VHEzilhNBoNlQp/cq/vKbE6qcqBD/If9SRwrdGA8moJ8MShhWcLs1OpYDkYe0QaZ17Aa6NZuQqJYQA6/jeobhqkU+qXGiUC7vxHrkdXqzZmGWu45tGNyu+bMJlkgdpA08jFAxrQZ7UTeZcKLqhq3j4gL/AaqHHvPY8kB3ywH+8E3/rU01ym0ArxrnVvUPwSqG+9gp2wK4R0NjNPlQFRk9S0iLqwAK4KhsGr0vNig9ftLSt6/tG/BfC9RXzy7cKjFVDXizXq2DUSXET/p+Dtsv+g== 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=AkgFKEUShJKAM3Mmn4Ko45MxLv4dliSVTzryBWN1OJA=; b=KQbQVtZCHT4qFI4NDK0aw+B0e9Zm9dotzUEbnjHZsqgrhiFw3OgJy/ddQOg2W7F/zZp4Ffdj1Llims3DtvyVlxB8s7Z31d4aI9CDpi63Xu8zcrukbhV/cti1ZXklE40ZfCk+7lV8xaKEwMNZB/s82EH3oaI1TfgSf0WluAho7UOlwtGHdTnS+nEcVaktlbrXiIrbJWn7iZY2XaqPSiQFZ5KVPAdtug/Cb1kowzQ4F7RBUoO0XYkGQWrktPl85pcZVaJu8JRf4F5INB46BG1mi00eQW5V6bvDR8+uswLGOzUDlc+7ZrYRf+Grz+qM+QdSy/9Y+8t1xTw/LXnLEWMytw== 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=AkgFKEUShJKAM3Mmn4Ko45MxLv4dliSVTzryBWN1OJA=; b=r23q//8+uo5TPgVNUwqeIVxJz1dRYxOxabvpJiIvZMscRRLawlqgFtXNJOLJRd6/GgWlB9Bb5QJ/2Q/49rFVqTPU9FKKr1r13Cq62eIPvnwAwG49Hi/IpT4CK/Jk0UnRhtXrInrynowP0HOYJcaENs1b96W7TN80g2LHTKW/lH4= Received: from DBAPR08MB5814.eurprd08.prod.outlook.com (2603:10a6:10:1b1::6) by DU0PR08MB8711.eurprd08.prod.outlook.com (2603:10a6:10:401::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.32; Tue, 7 Feb 2023 23:34:15 +0000 Received: from DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f8c8:b4b6:c041:ac9d]) by DBAPR08MB5814.eurprd08.prod.outlook.com ([fe80::f8c8:b4b6:c041:ac9d%7]) with mapi id 15.20.6064.034; Tue, 7 Feb 2023 23:34:15 +0000 From: Honnappa Nagarahalli To: Tyler Retzlaff CC: "thomas@monjalon.net" , "dev@dpdk.org" , "bruce.richardson@intel.com" , "mb@smartsharesystems.com" , "david.marchand@redhat.com" , "jerinj@marvell.com" , "konstantin.ananyev@huawei.com" , "ferruh.yigit@amd.com" , nd , nd Subject: RE: [PATCH] eal: introduce atomics abstraction Thread-Topic: [PATCH] eal: introduce atomics abstraction Thread-Index: AQHZNcVOKaGjm++r5EuVscptDtirzq65Kg2ggAF2NYCAAAyiAA== Date: Tue, 7 Feb 2023 23:34:14 +0000 Message-ID: References: <1673558785-24992-1-git-send-email-roretzla@linux.microsoft.com> <1673558785-24992-2-git-send-email-roretzla@linux.microsoft.com> <1844463.CQOukoFCf9@thomas> <20230201214111.GA30564@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> In-Reply-To: <20230201214111.GA30564@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: 0D4D37CB2D44BA4E805779B90CA20FF0.0 Authentication-Results-Original: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=arm.com; x-ms-traffictypediagnostic: DBAPR08MB5814:EE_|DU0PR08MB8711:EE_|DBAEUR03FT044:EE_|AM7PR08MB5432:EE_ X-MS-Office365-Filtering-Correlation-Id: 83f31313-80ef-42d0-e0f3-08db0963d8d4 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: EnGW3kSWLzTvuO/ug0nYLfQBKME921SJWD/s+vShhXFe6vjH0Cxx3lEaAoZPv0qOu+4DtWZdQ00BjZTIPYNJewma7+erbGNrn0NbUtDMJF8lFZZ0XPpGUOtjArheDxgwUvFm37hi6kSzTpeBQXukg9LFV6T6Y0pu+2nYG7cygC2bcqWyISLH1rF89ZRC9QTyPzERpzHs7b+ju8nmVpVhNn34lzhxLdvX7d9TLQjygR7/PcNnhNX3UzyUobxyH1QYC0Rb94XBxehPQY+HZEY+dcYG8eoFsLQugRShbmCCTCcjZ/Rgs6ihv3Kn1sXjbnq61ue6J1xvtxqrbTspYsKaX2J7myvbwzsVvD4qcQN6iFehIaY3j7YLP+jlHIv3bvz8HCLrM3sMlZaKUQ4XdmpC/mhDSxjBaO+8EUcMdZymE5SU4Z5swCt4GCAGmoyneWBrTVhZ2RpEK4771tnwMu9MR4MYvH9dXgjlBb2K+wKnJGNa6wZBod7QMroJuib6VhwrvdOLmY6+LVpKjBRb5tAkdr+JEq5cLmY3oWSWcBZ9PEMOIk8p8G0Ey1kpUvyIpx1DjZo7GDm8oSf/zywGGqosUPn8C9QrGsOx2djhawb+tqBum4KwvAosW3+1ZCzsB/4HwEuTiTG2loBl5veHeHk3SbDkhxm8vqvoKc5b0NYIFh3g/fva18MYUE+o/Kismp7XZY3FH/C2PJhXsxgkd0ntXMq3vU5bV2ZIL6ZEuoVldqTDMMFM8FODi/NhYBe8M/0Q X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DBAPR08MB5814.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(396003)(366004)(136003)(346002)(376002)(451199018)(86362001)(33656002)(478600001)(4326008)(38100700002)(122000001)(316002)(38070700005)(55016003)(71200400001)(7696005)(2906002)(966005)(54906003)(66476007)(8936002)(5660300002)(76116006)(66946007)(6916009)(83380400001)(64756008)(41300700001)(66446008)(52536014)(66556008)(6506007)(9686003)(26005)(8676002)(186003)(21314003); DIR:OUT; SFP:1101; Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8711 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: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: 9ef79947-3cff-457e-eba7-08db0963d2dd X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XEnK7ozJ4W68LGkDI/cBeD5i/sKxhtn2lXKcAMki06+ds/k33Alo29CM23ZobPqcyv743ulrh83cAq2cJjUkhWjihdURgmPbRZS62kCIHtc5IAy4S60yg4M6i3R1o0IxPr6YsjEnK0OJr28umkWL5R1NieqCg1/Tmq5kzD7t3l/yywpkN6XeGG+EBXYk8RF2tuAI8dfpcNbwKwlzyIQJSc1BYSWOviJp11o5b0JHF2wvxYduFWpxqggXRY59srQfo7bc8sh1tP+NlchPUwBjZPyIGMAXBF3PNN1BYLowyPHb7ydy5usCFm4Bjc5QwlEhqvq2aQjiMEpRY8NDrC21LJN71Jdj8n2LAo0RWyeg/NTJ5x9laBd1hvY7JSlgEFtWOX0NfuvBbHHfSFVtj5OeIDSBa5jnLzwtv5L55waQotsIjpAGlL5+vQ/JZ+kU/EOz8be276IC52cMfvYhncgmkLjPa1yrVf+sAHK3Pw8jdWe4U3VRc6KSb+I14+2zPSQ7QxPVWl+j+XzjuU04o1HfozKtsOwoU7t/g40MsDbzATU1hLitMY9HkYtV/OnJ1sy6fjYVY2Bv9zlIO5CU5pzP41buaWdGITTf60EYEk7GZ81pT8lCR1GPYiHfA1yQu4p9x2hV0RmJWx0WNSUjuaxmCGwBASzZMplXUiIJusdUDqxUkieY9ZJuRBD2mxspl6i/o8/ipZiqohCmVyKd1gFORnZWN5FSBVGuzVwO7+emaRer6wK8bGymvoQpN0ceKSYF 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:(13230025)(4636009)(346002)(136003)(396003)(39860400002)(376002)(451199018)(40470700004)(46966006)(36840700001)(36860700001)(2906002)(33656002)(82740400003)(81166007)(86362001)(82310400005)(40460700003)(7696005)(336012)(966005)(186003)(9686003)(26005)(40480700001)(55016003)(356005)(316002)(70586007)(70206006)(54906003)(83380400001)(47076005)(8676002)(4326008)(41300700001)(6506007)(8936002)(478600001)(5660300002)(52536014)(6862004)(21314003); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Feb 2023 23:34:24.7143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 83f31313-80ef-42d0-e0f3-08db0963d8d4 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: DBAEUR03FT044.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM7PR08MB5432 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 > > > > > > Honnappa, please could you give your view on the future of atomics in > DPDK? > > Thanks Thomas, apologies it has taken me a while to get to this discuss= ion. > > > > IMO, we do not need DPDK's own abstractions. APIs from stdatomic.h > (stdatomics as is called here) already serve the purpose. These APIs are = well > understood and documented. >=20 > i agree that whatever atomics APIs we advocate for should align with the > standard C atomics for the reasons you state including implied semantics. Another point I want to make is, we need 'xxx_explicit' APIs only, as we wa= nt memory ordering explicitly provided at each call site. (This can be disc= ussed later). >=20 > > > > For environments where stdatomics are not supported, we could have a > stdatomic.h in DPDK implementing the same APIs (we have to support only > _explicit APIs). This allows the code to use stdatomics APIs and when we = move > to minimum supported standard C11, we just need to get rid of the file in= DPDK > repo. >=20 > my concern with this is that if we provide a stdatomic.h or introduce nam= es > from stdatomic.h it's a violation of the C standard. >=20 > references: > * ISO/IEC 9899:2011 sections 7.1.2, 7.1.3. > * GNU libc manual > https://www.gnu.org/software/libc/manual/html_node/Reserved- > Names.html >=20 > in effect the header, the names and in some instances namespaces introduc= ed > are reserved by the implementation. there are several reasons in the GNU = libc Wouldn't this apply only after the particular APIs were introduced? i.e. it= should not apply if the compiler does not support stdatomics. > manual that explain the justification for these reservations and if if we= think > about ODR and ABI compatibility we can conceive of others. >=20 > i'll also remark that the inter-mingling of names from the POSIX standard > implicitly exposed as a part of the EAL public API has been problematic f= or > portability. These should be exposed as EAL APIs only when compiled with a compiler that= does not support stdatomics. >=20 > let's discuss this from here. if there's still overwhelming desire to go = this route > then we'll just do our best. >=20 > ty