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 D80E041BBC; Fri, 3 Feb 2023 13:19:26 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 696594067B; Fri, 3 Feb 2023 13:19:26 +0100 (CET) Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by mails.dpdk.org (Postfix) with ESMTP id 40D914021E for ; Fri, 3 Feb 2023 13:19:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675426764; x=1706962764; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=awNlMrg1MGAXgIjt+Hm1hE/eOsA5lsZfKgiygKHYpeQ=; b=BMsUOVfEhX6yMX6zQAUnLxcElj02ZUm5cek28XG2UIfjmzu6xFawVLKh rdXaEGAQuzk5HMGaHAGO0iqQz95fOh2XQaq7vnQxhR9mp4hzy7ZjqEA3h Y3PgUugSymEBfsFVJYOMfql9TPI/I3kSR8ISBIKhLZ9eQgQSCV8i2HNS7 z6rr4YVzVpkEmd8iPQRWakEbFk4eKSEuR20YTDz0ovpvf7udVbsVz1jbi 8nwOJg+9OM2myKHxSP2rsanxtDKVSLMNzbC24mQ3qZEFRvaZjcpbkN+w6 1Ufy+4iRTwvWc2jyF7IMRX193OgZGEGPJUisJzk2hncDFJzhugLVd0fnd A==; X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="328750135" X-IronPort-AV: E=Sophos;i="5.97,270,1669104000"; d="scan'208";a="328750135" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga103.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Feb 2023 04:19:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10609"; a="665702029" X-IronPort-AV: E=Sophos;i="5.97,270,1669104000"; d="scan'208";a="665702029" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 03 Feb 2023 04:19:22 -0800 Received: from fmsmsx612.amr.corp.intel.com (10.18.126.92) 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.2507.16; Fri, 3 Feb 2023 04:19:21 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) by fmsmsx612.amr.corp.intel.com (10.18.126.92) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Fri, 3 Feb 2023 04:19:21 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx603.amr.corp.intel.com (10.18.126.83) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Fri, 3 Feb 2023 04:19:21 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.49) by edgegateway.intel.com (192.55.55.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Fri, 3 Feb 2023 04:19:20 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VT8+YvpBcbD2fqRr2E6+ZR67/dGWjjbEUitG9gls/zRMdRy1cTs2xmABkIlx5Gd+nAdaJEEVe3dkbrT/WuZ77mV+2PmrM8VMKDKyZ3qrOzkrny2OKKsAYyRamhqrG7iTZ+nuOqX7r0bRnL+OfaIa8mE54jMoYkfM5s/yq6VFRp+bLmJZK3Fzoon1Ai6+Msl4m0SYXrf0wx25qwTKmBE8lZNoMv2Pj7ykPzCFmfGsRfF/1dBrQ1XHybkHFr4xA8Qv9+HqfORIAGYaQ+roOxmgGMVIOs7LmuVhR2LP/exJmlolCfy18+wqLbWVsQdo2AXBJu5jm7jEQPKlTbEvchtbPA== 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=cBjNVYQpGHZQfEM6GP/Vt6kVjOGu99lhfqvsmmPqvKc=; b=Q41o7D5njt1IGzUmd1ksujs8geUcf45fu9ysQg4iwA+/L/ChLn6RtSUBzhTwVvo71E6apmq1ExXiZZISzT30/GtmH5kY4JBusXxAtRtKJt8xJg9xb9zCdjfKCF3vlCNYxOxRpbdLSjbwJFvXfXgCX6WukHhRPz1XKxx8T9JaUhMrCR9TSYZq9oIgqzChhZoS6/UIaJv/evY5HjOZVchXH5T+mSDVXHGorT3OvOnBZQ/cffp8HLCNbK0lxHR31GQ+Xyag55AJHQfTdymLYyB/OwkwB+MM2uKQHIKRKxa646DQ99kUOtq0qWyiLonSG8i3Dv3alxSZrqMsUl0o6RtMwg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; Received: from DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) by SA2PR11MB4857.namprd11.prod.outlook.com (2603:10b6:806:fa::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6064.31; Fri, 3 Feb 2023 12:19:19 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::aaba:abb7:8794:def%7]) with mapi id 15.20.6064.024; Fri, 3 Feb 2023 12:19:19 +0000 Date: Fri, 3 Feb 2023 12:19:13 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: Morten =?iso-8859-1?Q?Br=F8rup?= , "Honnappa Nagarahalli" , , , , , , , nd Subject: Re: [PATCH] eal: introduce atomics abstraction 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> <98CBD80474FA8B44BF855DF32C47DC35D876EE@smartserver.smartshare.dk> <20230202190023.GA32597@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230202190023.GA32597@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: LO4P123CA0073.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:190::6) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|SA2PR11MB4857:EE_ X-MS-Office365-Filtering-Correlation-Id: cb16ee54-277c-49e1-a8f7-08db05e0dfcc X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: s8n9abOktdqsLOtkLV10oH1Tl8uhyurS1M21dq+Le3lSUhcvUSRoMEn8EQMaQuBC7ZGBGZ+voWwREoQxoTh0fbbYWnlM4exBtjyRWL+KAwj9RKIqQiX8CE4NdxJ8NTxGl+6QBiKOUhLM+7yCcE2s7xozF3iAPfGqTKwyYYLB2SrhG/trvNv2yQXfWl0eRE3N2GjUkk/2CENyYpICgVFYIw+fUI5GHj07d2ZLfeVSC8n6tRzJCjlk6rU5UDECu6fGcX+g1y9xjkyp8Jlgk96pWNhq2cIUVDuCacemj9T9DH2bk+TL85im2FnA8SaROyKK5SFDsteLRjPD1zdlkgVBds/i6sz5UmP3t1hWlPlXyKsqevtseZcOZh40yRe7SQeMXbn3VUWpCf5aM9PF+5/OTnCLbiDqE7AbepdSzRJBl/rxY3bs9vBXBk73T+bK6+bT9If1HMzGF0of1MyvZPmnm80Y3rMjVaJpvZU9cVv/3ZqMvgFQNFYCS86Ljw8L3i29fJpch+Lh2Bc3gj3St/i7xevhPpZqwo83HywagByMuNnEWW2KL6hzhQhgG/DpnTLTUKDuluRY2JBPRo9gnCuQrjHmsej7Q4DWV5RWIdgJzPznuT6XPtGK3+w7Phv/+HFFf/F+/vGxN9BUu6JFiI0OYvukx8lNHUip4MnmhempojilUVsiNYtKvaj/N9ZhNQAVwBU1gVW+VobKx0CqM6ja2w== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DS0PR11MB7309.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(136003)(376002)(346002)(366004)(396003)(39860400002)(451199018)(86362001)(6506007)(186003)(26005)(6512007)(54906003)(966005)(478600001)(6666004)(6486002)(44832011)(41300700001)(2906002)(5660300002)(7416002)(316002)(8936002)(4326008)(66946007)(66476007)(6916009)(8676002)(38100700002)(66556008)(82960400001)(66574015)(83380400001); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?qk5BPlSACnj1Cg02T4nc2ctC41H337AEjNs9fqYJBRuOwPxrtgfkOucPjJ?= =?iso-8859-1?Q?a0mSuIR4QwD6oJtRGJA1NpTnLWF2b9U8aOzBqlTrXeNlaJi3jKWKv4LQJw?= =?iso-8859-1?Q?BhSTFFRh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O1HNM32XpfW8LVkUhb5Wd2oT?= =?iso-8859-1?Q?/JrQu64r+x0WB6GLMlBKcvG8fU00PuHn8T+piI2TejJGxs7s/YmZNAdd4L?= =?iso-8859-1?Q?C7BDwOP0w+xKmRfnLYwqWlc5gKxiaSsZwn6TLkcYAKf8pAoKOYdO+7y1jb?= =?iso-8859-1?Q?C2G5hU4wLltV7s5AgSxlSMDU9ui/144tk8fmkbrT1vfnJzoRvGClhz1WMT?= =?iso-8859-1?Q?BbksD1gKkM+gNe4oUcWkpnal+dHVchhbeXNGf7NR2uvi7uynX/mtrh1gco?= =?iso-8859-1?Q?woXFwzwVvVIIWsEA4oQ7HBTtmVnD+pn0P4uqe5VhlkrDhLEMMekfnRk57/?= =?iso-8859-1?Q?WGbiDQadg9XF413yz6gk3YsH4qkvQVhwIaJhT7o10EAk3Yeujg0gJgI06n?= =?iso-8859-1?Q?T8MwppYrdhGwuiA63NFgP6NEp3Se9QFN742HJbotY2uKEuSrPk9eYW6hrt?= =?iso-8859-1?Q?H8z4lL4Dycdh5s1S189BOioMvlKXeypjh1wYWLtS98WcIqwEN4PGtyweN2?= =?iso-8859-1?Q?AFX2vtJphmFUjSr1/mYRcaPSRvv2sg4nWJ8o45tWaYXXVmOjyT+lGpuXLi?= =?iso-8859-1?Q?t6iE9Au61KCmhGBQkJnyf7zjBC0wTln89gqZ9YBL0wmSpw877s64szYBQj?= =?iso-8859-1?Q?0teBAdmzTiWGvGXZ32EFHVPwAzvvr8h20DJTGqw6KFJqzMeti+StU8Rw?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: cb16ee54-277c-49e1-a8f7-08db05e0dfcc X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Feb 2023 12:19:19.1258 (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: ArUOzpkxV12JeJiSiq8R9tx6Rgn9rQx0yTcp7feuRWyrkWGCqT1MGyU/E/01ujUUeB5ZxKcR7Ev6BIdtdk/e5cPxhiCpUrL77ij8rkHfQuw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA2PR11MB4857 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 On Thu, Feb 02, 2023 at 11:00:23AM -0800, Tyler Retzlaff wrote: > On Thu, Feb 02, 2023 at 09:43:58AM +0100, Morten Brørup wrote: > > > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > > > Sent: Wednesday, 1 February 2023 22.41 > > > > > > On Wed, Feb 01, 2023 at 01:07:59AM +0000, Honnappa Nagarahalli wrote: > > > > > > > > > From: Thomas Monjalon > > > > > Sent: Tuesday, January 31, 2023 4:42 PM > > > > > > > > > > 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 > > > discussion. > > > > > > > > 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. > > > > > > i agree that whatever atomics APIs we advocate for should align with > > > the > > > standard C atomics for the reasons you state including implied > > > semantics. > > > > > > > > > > > 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. > > > > Perhaps we can use something already existing, such as this: > > https://android.googlesource.com/platform/bionic/+/lollipop-release/libc/include/stdatomic.h > > > > > > > > my concern with this is that if we provide a stdatomic.h or introduce > > > names > > > from stdatomic.h it's a violation of the C standard. > > > > > > 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 > > > > > > in effect the header, the names and in some instances namespaces > > > introduced > > > are reserved by the implementation. there are several reasons in the > > > GNU libc > > > manual that explain the justification for these reservations and if > > > if we think about ODR and ABI compatibility we can conceive of others. > > > > I we are going to move to C11 soon, I consider the shim interim, and am inclined to ignore these warning factors. > > > > If we are not moving to C11 soon, I would consider these disadvantages more seriously. > > I think it's reasonable to assume that we are talking years here. > > We've had a few discussions about minimum C standard. I think my first > mailing list exchanges about C99 was almost 2 years ago. Given that we > still aren't on C99 now (though i know Bruce has a series up) indicates > that progression to C11 isn't going to happen any time soon and even if > it was the baseline we still can't just use it (reasons described > later). > > Also, i'll point out that we seem to have accepted moving to C99 with > one of the holdback compilers technically being non-conformant but it > isn't blocking us because it provides the subset of C99 features without > being conforming that we happen to be using. > What compiler is this? As far as I know, all our currently support compilers claim to support C99 fully. All should support C11 also, except for GCC 4.8 on RHEL/CentOS 7. Once we drop support for Centos 7, I think we can require at minimum a c11 compiler for building DPDK itself. I'm still a little uncertain about requiring that users build their own code with -std=c11, though. /Bruce