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 32F0A423A1; Tue, 10 Jan 2023 10:11:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C4F1640691; Tue, 10 Jan 2023 10:11:49 +0100 (CET) Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2043.outbound.protection.outlook.com [40.107.237.43]) by mails.dpdk.org (Postfix) with ESMTP id BB6FF40689; Tue, 10 Jan 2023 10:11:48 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=K//y62j3BnRgDc3gC9/QSzSHMPbB3v+3/8Jz72Iu0jeme56warCBnJh3aCuVMd1z85Jm6Za/+6oaAxMSp9E/vPG5VE0TG64EdWtVJi3n3WU24MrxPmPZmKPfmVDQDrSveO9/uLxIFprZ7bBUm4Ccll5T3oRMNDyPeCFYDGBj9PGOK42SUZkN1UShKKMt1KxB1ox/r6TqCqw3F28JLesbIZwdtUdF7Z1q7wdjJ9qsTb6INvaMFFHeixWrZ1M5bMSJYXNSW4eaybUpigxO7kfTR7XeJoccLBUv57J7K/Yls1g/ceb46g7/UYeYEHtRntDDX/3YQG0z1mJ9OGiApCDRRQ== 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=5L3u+q08NnUvAsdK9UH35lsMtOnMYVvQljFToryMre0=; b=Q4t2CJTOQfSOUYEq68O2KBN5YtenK5OrYWBHrg+BBEKL5aBbOSlfBRbVdCSLJz3YNG6esAaovzzXX3po4eocKYgyU1z5Z+8dDOGJ/G6InNFYcJ28fa4UC4dRlemAirxeclgE1DRlo74aB+go8OV7trOvS2N7w9W7W6D+TPJeLgDgH/O0Jm477QgpLRkddLp3SqizgV2WU4k7Q3Onuzp/eQGjPSb2RXTHa7X6SFhmEdfsqXbSWfPE86pEFdQZDbuDatenFfu8uEiBXrt/hs7pnJkK1JJr7FyvmegkcD0LqEqXutP5qMnlTp1fs7wmpcfO1KeDjAG92dL2tdBpc2SSpg== 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=5L3u+q08NnUvAsdK9UH35lsMtOnMYVvQljFToryMre0=; b=pSPS4bF1j9sSoVjgcLAHcWZMEEt/esdLB1Z2wYQroQME15nBizjRw8HeLh0yVg1JrrREz0kE2Pr5IKwthDyzA0JhL4MJG3F0DHVfUCaQ4SgvRRKXyeMLvGmUs5ZorMH1CKHQcUp8CXkXP0cpSAFU8hA7B1ttBMZNMwMFClqLgAo= 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 IA1PR12MB7663.namprd12.prod.outlook.com (2603:10b6:208:424::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Tue, 10 Jan 2023 09:11:46 +0000 Received: from CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a]) by CH2PR12MB4294.namprd12.prod.outlook.com ([fe80::4807:1f44:5e04:e05a%9]) with mapi id 15.20.5986.018; Tue, 10 Jan 2023 09:11:46 +0000 Message-ID: <322ef264-92d1-1534-4570-4353b5a4209f@amd.com> Date: Tue, 10 Jan 2023 09:11:40 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: [RFC PATCH 4/7] telemetry: make array initialization more robust Content-Language: en-US To: Tyler Retzlaff , Bruce Richardson Cc: dev@dpdk.org, "techboard@dpdk.org" References: <20221213182730.97065-1-bruce.richardson@intel.com> <20221213182730.97065-5-bruce.richardson@intel.com> <20221214175033.GD31935@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20230109174912.GA16104@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: Ferruh Yigit In-Reply-To: <20230109174912.GA16104@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: LO4P302CA0039.GBRP302.PROD.OUTLOOK.COM (2603:10a6:600:317::12) To CH2PR12MB4294.namprd12.prod.outlook.com (2603:10b6:610:a9::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH2PR12MB4294:EE_|IA1PR12MB7663:EE_ X-MS-Office365-Filtering-Correlation-Id: 1d260fcc-f7db-4fe7-2e63-08daf2eab2c8 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CyBBwwLQeiHYRz2O8WSIeYP9c6J4Jw0kaZJaxlBymo/6J3AdZSp3N43+GNRGJIBquMt957k7yYc5tKDkw7Z7c7ZacH4luJipl/G8pgepp2JTqTuJhfpPjyjNsvsOHFn90UJrEWFpW0AYX5sT2ZxJEN/w/pF52zZteMxtn/k7/aGPHtKFM070m7eQnpoP52eam4gEtVbjqLRn+pMxYKPwxPYV81r8upt2Q9JNx5dPAUARWQqMMzi1dpD6TltpTjM9B+XEBC5zihzVoaDgBcdtY9icAFubJzvbWHoaY6VhkJvje5fCCNAWQe5JB7OjSKLY/QtK+//GtwBQDc4S3MJ4q0NfuNjFXuvP2kaA6HzZtOPGSMZ5RPmwpluSfvutx8PixWuC6BBnkwN975EQKij/hUiEILPiV7rhb0lvJokye5WE/4i5LH989LK2TXXsOYHQJ+O55e4qm60pA/EJ58ei9CLDegO17NGDWa15hm3JOAmeCRch3s1VzOxQw4S+b/wH/N2d2Jg40/TbJ0Q8WQvxzQiAGBfIDWnPt0k0timOVSe9bYij1rjbxl5hxvgoQQOVBw/WdM5WkizIcEwiKFz5s2S23liQYMlFGBNmdnBDGU+51k9wA/OIGsdv5T7UkCVLOMYoTxQwSGcRurFIkw81izvt1657mci63PNPCPRKR+i3Q98o3nTiFafVIepI5gY6W6JZI2NXR9VNaQT7YthCXQr9MUwcBqnxSZ6pPP78U9E= 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:(13230022)(4636009)(376002)(346002)(136003)(366004)(396003)(39860400002)(451199015)(44832011)(31686004)(2906002)(5660300002)(6666004)(36756003)(8936002)(41300700001)(66476007)(66946007)(8676002)(66556008)(38100700002)(4326008)(83380400001)(31696002)(6512007)(86362001)(316002)(2616005)(110136005)(26005)(186003)(53546011)(478600001)(6506007)(6486002)(43740500002)(45980500001); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?b3YxeFJ5ZVJ3VXFiQWx0d2NwS0U3QnRyVEFjZkJGSXJ5aUdVTFY3NWJWKzhV?= =?utf-8?B?bHN3Y2tZTHdPWjRmRVRDYXg0M3RSREJTd3d1c3BKMGJQRlgwcG5TK1g5QzEr?= =?utf-8?B?NFJQNUh1QmYybit4NWxkOWtaL0g0QUU5Q2tXNDlDdkpkMWI0RXIyY2ZLVzl2?= =?utf-8?B?c2pDUG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iMlFaWnl1?= =?utf-8?B?STFzWGdqSGgwTmdTVlZDemhMM3lFeStrYkp5aVhmVC9ScGxQUVNVM2NiWDMr?= =?utf-8?B?YzBLTnpab0dSdHFBazQyMzc2cFVEWGI4cXJ3SmZMUHhJVDJHdFVDVXIzem9o?= =?utf-8?Q?9+cYTq1dHauhZDwT94+krfzZ2?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1d260fcc-f7db-4fe7-2e63-08daf2eab2c8 X-MS-Exchange-CrossTenant-AuthSource: CH2PR12MB4294.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jan 2023 09:11:46.5047 (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: yz51T1A1LXE4jHr1i5bwr0I2ue5js2zW/6IZcoUxHlQ6FkZNtcZjY2gymFD4eSpL X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB7663 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 1/9/2023 5:49 PM, Tyler Retzlaff wrote: > On Mon, Jan 09, 2023 at 12:16:15PM +0000, Bruce Richardson wrote: >> On Wed, Dec 14, 2022 at 09:50:33AM -0800, Tyler Retzlaff wrote: >>> On Tue, Dec 13, 2022 at 06:27:27PM +0000, Bruce Richardson wrote: >>>> Rather than relying on a specific ordering of elements in the array >>>> matching that of elements in the enum definition, we can explicitly mark >>>> each array entry using the equivalent enum value as an index. >>>> >>>> Signed-off-by: Bruce Richardson >>>> --- >>>> lib/telemetry/telemetry_data.c | 8 ++++---- >>>> 1 file changed, 4 insertions(+), 4 deletions(-) >>>> >>>> diff --git a/lib/telemetry/telemetry_data.c b/lib/telemetry/telemetry_data.c >>>> index d51724e1f5..9a180937fd 100644 >>>> --- a/lib/telemetry/telemetry_data.c >>>> +++ b/lib/telemetry/telemetry_data.c >>>> @@ -16,10 +16,10 @@ int >>>> rte_tel_data_start_array(struct rte_tel_data *d, enum rte_tel_value_type type) >>>> { >>>> enum tel_container_types array_types[] = { >>>> - TEL_ARRAY_STRING, /* RTE_TEL_STRING_VAL = 0 */ >>>> - TEL_ARRAY_INT, /* RTE_TEL_INT_VAL = 1 */ >>>> - TEL_ARRAY_UINT, /* RTE_TEL_UINT_VAL = 2 */ >>>> - TEL_ARRAY_CONTAINER, /* RTE_TEL_CONTAINER = 3 */ >>>> + [RTE_TEL_STRING_VAL] = TEL_ARRAY_STRING, >>>> + [RTE_TEL_INT_VAL] = TEL_ARRAY_INT, >>>> + [RTE_TEL_UINT_VAL] = TEL_ARRAY_UINT, >>>> + [RTE_TEL_CONTAINER] = TEL_ARRAY_CONTAINER, >>>> }; >>> >>> i might be a bit fuzzy and didn't double check but doesn't doing this >>> require C99? >>> >>> though it would be great to move to a minimum of C99/C11 >>> >> Yep, I agree on version bump. >> >> For the specific array init - we actually already use this style of init >> elsewhere in telemetry lib, so I'm going to keep it here in V2, as I >> think it is the clearest way to initialize a lookup array like this. > > sounds good given our other discussion about moving to C99 as a minimum. > There were some drivers requiring C89/90 but as far as I know all updated at this stage, +1 to move C99 support.