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 E865B41C56; Thu, 9 Feb 2023 23:13:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7B20340E50; Thu, 9 Feb 2023 23:13:50 +0100 (CET) Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2072.outbound.protection.outlook.com [40.107.92.72]) by mails.dpdk.org (Postfix) with ESMTP id 0AE174067B for ; Thu, 9 Feb 2023 23:13:49 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=hOfN4/4koFQl2Lks+Ed43W/LmSko45qy/2zi8QayUfAFNrXDZa3moX7BVTetqwKwCeLuIU9qregTvz8ZUu1fOE+fWMea5FhIMbOZJ+wpvIznXLS8ATFs94jz8VIIodJByJ3W8esQcZA0aLY05eSkCGi0zbzcceKNOvzumioIvbjYS1XNORB1FMg0MaykyUjz95SJb1iqeAIkccXTmvdC2IFoGfR1BHS4Uzw62ZYvxHsiL+eyHpzOY9joawiOjYVYBqGC7Zb9itqqFTlsXDqXLfcNt/u1RKQ5/vXfKyailbFaewLOI5LHmHG4/nmjwhftduGO1Mc41qsa9YefbxM0Mg== 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=FGcKUTmCNVdhEfGb9CJhsQpHMJwb45ta3KPGjAxTikY=; b=P5yEQoLIrRxTjj54CySQ+9x2iyrWr0ga70sHvhFnvJ4JLXoEiHR0JyFzEiRt7cMpy9V+Ywt7j5gpm49WVjhQyDNlBHxxDBGIWAaJ3MxH7GD1iZWE2hURoBKD646+m1QSrkcEnMf/rsU+lD42yt6cE7IzQKzKXBlMT4DVjeQETJJBG0HA8xLc2BM0UBtNNvbTjjwVdcnebxhjtdSZ9SmC5uLZ0tWUg2rh00W8paRVlADGYUhmGL/ylOB6C+sZz55l8qGdqDx22uE4t+y06xfJDr2Z1td9/QCzQVRVwC3a5fh7lcaaZlvErPg/4uLHWLvdYmNJFH2ULR9WhrQSeiNHYQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=FGcKUTmCNVdhEfGb9CJhsQpHMJwb45ta3KPGjAxTikY=; b=4OXuc1KZPA9h5SX6gW2IUCxg8XrHR7YZF1mjJtzxGVnYAzhNzy2+NnMJkPomjn0+VgOoIrknfT3lHF+xuR/oXoKw8WXwVIJp5XKttv01Ba9rcttrFb2oCiNfjWu/T/AbSHrpeC0b6nWuDuFC0iAmdL8Go1q3+lKzuBmQylv2pkE= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) by PH8PR12MB6842.namprd12.prod.outlook.com (2603:10b6:510:1c9::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6086.19; Thu, 9 Feb 2023 22:13:47 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::3614:22ed:ed5:5b48%6]) with mapi id 15.20.6086.017; Thu, 9 Feb 2023 22:13:46 +0000 Message-ID: <0b711951-b982-d984-60f2-2a7be272dd69@amd.com> Date: Thu, 9 Feb 2023 22:13:41 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.7.1 Subject: Re: [PATCH v2] eal: introduce atomics abstraction Content-Language: en-US To: Tyler Retzlaff Cc: Bruce Richardson , dev@dpdk.org, david.marchand@redhat.com, thomas@monjalon.net, mb@smartsharesystems.com, Honnappa.Nagarahalli@arm.com References: <1673558785-24992-1-git-send-email-roretzla@linux.microsoft.com> <1675892618-31755-1-git-send-email-roretzla@linux.microsoft.com> <1675892618-31755-2-git-send-email-roretzla@linux.microsoft.com> <20230209174009.GC21854@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: Ferruh Yigit In-Reply-To: <20230209174009.GC21854@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P265CA0260.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:37c::11) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|PH8PR12MB6842:EE_ X-MS-Office365-Filtering-Correlation-Id: b9580917-a07b-4052-7290-08db0aeae9e4 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: k1xvOS5ncWyzRFqKJ5Wo2apgoqgirzc9TaGzE7kpWE4ZaKfFUsQLOelPo6dUAKowE7URRxmMpgl9bPRAeDHpqEggdIFNUanYvQM72Q/S0RAhjDc9yPv6wDN3KvApiQMfLfyoo5v1j5HYpAk2UiysdNd/qCEPxJj5hBI2C14HhbByRT9yrul/QvWXisDBogsWKKiI3EkN77bzHB5OS3X2C9M3/aV9AAF+HsqPAsh037+p1AhO4RE66C/ZFS8O1Hpygk6di/1pZvqkiAAF7ff2jtzbzXjm1FzeuOmGAp/rXhUNIqm1R5qzwmfLFqtFSEM43bGe7urEcWn3UeiXs29M02X3cQ2yYoPoTcVn3Xf0/I4SFeES1M8HTy7k3uheBx9XcHr2F8kBUo6RPPFIoAfTHklv80LLa9UYo+n+OQty/uWo81YQqdbeffsgRGN9/q10ALJKh2WUiqCYKDVNf89X8xAYQNvAhFUNvLqyKv9K+FKlWKGEXGaC3WvS4XMl62Pvx4YMDg4eUphTLf3bu83Fj/Pgs/IwSrs5DQ4VAHDyD8P8qjpCbTtJAk3l6jF2m7mWWFSiShO13J5l2gzXzawTt/2Xs7hq8mj8saNPibaWldKnCtsYKDLv9iUEbbfMLw1pwBVve6CBsruEZbKw9lOtWTtrEWfy0G19eqXVvjpCGrqPnbhTzZNzF34+ldtDQkV7KxDeYgkJ+kdZvNhpb7flCa1tMipfeQCZSy5+C+YIYsM= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CH2PR12MB4294.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230025)(4636009)(39860400002)(346002)(366004)(396003)(376002)(136003)(451199018)(31686004)(66476007)(6666004)(31696002)(26005)(6506007)(186003)(6512007)(53546011)(86362001)(36756003)(66556008)(8676002)(316002)(66946007)(38100700002)(44832011)(83380400001)(478600001)(6486002)(4326008)(6916009)(41300700001)(2906002)(2616005)(8936002)(5660300002)(45980500001)(43740500002); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?VXRWWHR5cmZnVjVYbWRuTitMWmoyTDh2VGc3djQzK0ZHQktVZDdoZE9NTmta?= =?utf-8?B?dEpBRzdQd0Vsd1JqY2lvbXlyMFNGdzBrWlI0S1M0SkZHeVVJa0p0ZWdqZjJD?= =?utf-8?B?czk1NkVjM0E1Yi9OL0cvUWVGYTM4UHNSdTVRb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?= =?utf-8?B?c2R0cGJ3d3dCdXRsa3FsRjFtY2NZNUt3TjYzYlBaZ2dPZ0hBTzl3Q0IydjEw?= =?utf-8?B?L2Z0YTBrNUdVQ2tReDVweUtQK2JSQnZZZHEyVVhsMXZoMnh6THZEZys2OHhK?= =?utf-8?B?SFloRjg3RjV4LzFSaFNkaEJVZDg1R2Q1TWVHN2JwVDN3cG0zSDUzaktQNHVJ?= =?utf-8?Q?30JXZPuS+HGB340HVJy1usUVG?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: b9580917-a07b-4052-7290-08db0aeae9e4 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Feb 2023 22:13:46.8244 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jOeH/tlDfWMEIV5VJVBpnMfONKVG4A0AvQtVYzF7jb/z2YfRT9tBa5iw7bZC4ldt X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR12MB6842 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 2/9/2023 5:40 PM, Tyler Retzlaff wrote: > On Thu, Feb 09, 2023 at 12:53:41PM +0000, Ferruh Yigit wrote: >> On 2/9/2023 9:04 AM, Bruce Richardson wrote: >>> On Wed, Feb 08, 2023 at 01:43:38PM -0800, Tyler Retzlaff wrote: >>>> Introduce atomics abstraction that permits optional use of standard C11 >>>> atomics when meson is provided the new enable_stdatomics=true option. >>>> >>>> Signed-off-by: Tyler Retzlaff >>>> --- >>>> config/meson.build | 11 ++++ >>>> lib/eal/arm/include/rte_atomic_32.h | 6 ++- >>>> lib/eal/arm/include/rte_atomic_64.h | 6 ++- >>>> lib/eal/include/generic/rte_atomic.h | 96 +++++++++++++++++++++++++++++++++- >>>> lib/eal/loongarch/include/rte_atomic.h | 6 ++- >>>> lib/eal/ppc/include/rte_atomic.h | 6 ++- >>>> lib/eal/riscv/include/rte_atomic.h | 6 ++- >>>> lib/eal/x86/include/rte_atomic.h | 8 ++- >>>> meson_options.txt | 2 + >>>> 9 files changed, 139 insertions(+), 8 deletions(-) >>>> >>>> diff --git a/config/meson.build b/config/meson.build >>>> index 26f3168..25dd628 100644 >>>> --- a/config/meson.build >>>> +++ b/config/meson.build >>>> @@ -255,6 +255,17 @@ endif >>>> # add -include rte_config to cflags >>>> add_project_arguments('-include', 'rte_config.h', language: 'c') >>>> >>>> +stdc_atomics_enabled = get_option('enable_stdatomics') >>>> +dpdk_conf.set('RTE_STDC_ATOMICS', stdc_atomics_enabled) >>>> + >>>> +if stdc_atomics_enabled >>>> +if cc.get_id() == 'gcc' or cc.get_id() == 'clang' >>>> + add_project_arguments('-std=gnu11', language: 'c') >>> >>> Is there a reason for using gnu11 on gcc and clang, rather than limiting >>> ourselves to proper c11 support? >>> >> >> +1 to stick to c11 standard instead of relying compiler extensions > > the extensions are already in use. enabling -std=c11 causes warnings > about the extensions to start being emitted. > There is '__extension__' keyword (RTE_STD_C11) which is already used in many places, can it help to remove the warnings? If it helps we can use it, which helps to document where compiler extensions used in the code. > but since i feel encouraged here, i think i will interpret your request > as let's limit the scope of enablement of extensions to where they are > already used instead of enabling them over the whole build. > > i will submit a new revision patch to get rid of -std=gnu11 here. > > thanks!