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 468344237E; Mon, 9 Jan 2023 13:16:50 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id DBD4140687; Mon, 9 Jan 2023 13:16:49 +0100 (CET) Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by mails.dpdk.org (Postfix) with ESMTP id 20A684067C for ; Mon, 9 Jan 2023 13:16:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1673266608; x=1704802608; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=P6KbqeFh0CNUZD7N9dEMP5Jd7mWv0eSvJL/egMQ9dbM=; b=DQWp3PeymbXcC5+nz6lE1rzOt3VJDFl8wTfyZ/HBePAjAmrEdmVX8mno 5M6ge6/PfDW86hZV8u1IMiITG5jUk3pGPPyvbUlzJeSTIyPCYY9WDdhbz a3GizOiatC1TgQtAkKoqAyEqf5r0T7q1BnX4k/aaleejY18ODrNFf06yK xtlty335FY/Vhe0WJDvk/RvdHRwd16eOXZP9tV4evdcmjG6qiUJKAuII6 kTsZesj2UvcqsZNQbCbExC9fIepEIlmI6Sgqzkc0BaA5EgHKXnyamH8jw eCIY4uVICvnhOV5JPhvI1dxR4cqELOsFstgjw0/lljjLvmsfPuXXye/GH A==; X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="385160162" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="385160162" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 09 Jan 2023 04:16:23 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10584"; a="725146955" X-IronPort-AV: E=Sophos;i="5.96,311,1665471600"; d="scan'208";a="725146955" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 09 Jan 2023 04:16:23 -0800 Received: from fmsmsx603.amr.corp.intel.com (10.18.126.83) 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; Mon, 9 Jan 2023 04:16:22 -0800 Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) 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; Mon, 9 Jan 2023 04:16:22 -0800 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.57.43) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Mon, 9 Jan 2023 04:16:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LSwb8KU/jq8GrphJxbZ4IrqB0Z1eqn9U1kOrWPOP7UO1Nd/FIkPpV8zcWfHFVjy2joD/R3wifhK9wmqZ8IptNqyyXirLfjHoJq9GCLi15Kd3XWxEMYv12lBiSgi99v/peGQ3/0gHSIiULsVeZ9RdDQMwJEqCOlQJXuuj44WqRMDFlxz8k50PBZ8tmntrznp8XPRDfTUL7XWeCQyuqYv/V8kD7lGxbwUio8iMNVpDB54TGbJX5DNOTxyhQlmLQLt6oig2cTBzafN6z13weY/0FOt4c5t9EAdRsFU30jk+8iyUf+zfZCnFro7jJkgbbjTuZHcW+bguQBE12F3GIZsSLg== 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=nvfrJgBXgRSUhHmmMNFXA61tOoI9/HO2mX46JFhG67E=; b=TcyKwBFZOlAV+Edg7cKuYRSKBLkzWsxMF/aajsCNeF4P9PRF6KS84Ew+Wvo/C5yPxO5PzxxbksjMZl0rFj61uzz4yYxni7P9qnIVQlnsC6n7n6ihsLT0IBzgS8pMwHpH5yhJ289lQjZCcFK1p9zgZIr9Kt6nd45kh1rEtQO/Vf0cG7ATSUPbWAHM5N/Yew2KPQP/0gJNQTO6j3K0wJcsNDxV3tQKX9Bd1jqGIx85Vzt4z0LeBR+L5M/2/KgDgU49S/vUDUii8UeeFUzvLzuXzQuqdDu6gKt8oiEBx5QhlfnWsPC01Dnc3nkVLWqDblGbrdJM/Dh7/8Rc6J+V8dOZ4w== 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 DM6PR11MB4594.namprd11.prod.outlook.com (2603:10b6:5:2a0::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5986.18; Mon, 9 Jan 2023 12:16:21 +0000 Received: from DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee]) by DS0PR11MB7309.namprd11.prod.outlook.com ([fe80::4d9f:6867:2d53:9ee%8]) with mapi id 15.20.5986.018; Mon, 9 Jan 2023 12:16:20 +0000 Date: Mon, 9 Jan 2023 12:16:15 +0000 From: Bruce Richardson To: Tyler Retzlaff CC: Subject: Re: [RFC PATCH 4/7] telemetry: make array initialization more robust Message-ID: References: <20221213182730.97065-1-bruce.richardson@intel.com> <20221213182730.97065-5-bruce.richardson@intel.com> <20221214175033.GD31935@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221214175033.GD31935@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-ClientProxiedBy: LO4P123CA0670.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:351::16) To DS0PR11MB7309.namprd11.prod.outlook.com (2603:10b6:8:13e::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR11MB7309:EE_|DM6PR11MB4594:EE_ X-MS-Office365-Filtering-Correlation-Id: c57c658a-3d7e-4556-9e59-08daf23b5144 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: euV/yhdVwfQrVZv88r+6SjGlEWG5RjipPjSbB0dvJXxUQ5lzc4fGi6TEWsQR+Ig79PPof3fY/dt8xsbnUq2QQEW+7j+xEfHH2UK3H79piXXTDQNuJh+Kg4ZzvtNDROqTX6rw6tJWCNx8hMJiOt88Vt9ncR8P9Q+loVewN8bUfpaCIoURxXK5RP+HgBtww66qQ21yWCykfEqhaT2RrZneny7f7pIGTOG01mNCJcUotcGfrlvcUINfzHN3qrk3Kc2+1+KDCsWK/ThbhRqx1YNjT9vX0axaQf+2VPOmIz8Z7Aow1Y76qQcQX/INbbt6KXO4ZX3Nroa+7T7PXKm/W/dasub+Cl/AP7jQ5imGb2Th+MgXcBf+uE0dnDLbZnxE6V9PAmqXavEjFzHKbGdxj7Rg6QwR4OFHq+0sdIYqldpBt3nU5+57rfX9laNZJq0h+SVq/opPtXYFNmKZdcPdnDE+dXC686hrhL5J1kNRansH1XXViVp7M/SHddpmAa7K1k0mJd+s5q+6mUXDhVibL106xO05QpzrfHbSbCAR9kB/dspDO/eEgO6YPDNUztqjqb/dFZMEbLBdXICiHLtDy8+LAd5iE2108F7K29ny+RIsfFKlU+YVnXiP5S2Sf6efSmRWna10u+ZQJCh3vUurIHiFnw== 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:(13230022)(39860400002)(396003)(136003)(366004)(346002)(376002)(451199015)(83380400001)(82960400001)(86362001)(2906002)(44832011)(41300700001)(8936002)(5660300002)(38100700002)(186003)(6666004)(6506007)(478600001)(6512007)(26005)(6486002)(8676002)(6916009)(66476007)(4326008)(316002)(66946007)(66556008); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?7q50Up29kijkP8q/Z0F8ToTdcUQ+WXOZy/IWs3grkWWSt3nNbhjOXgndl2vZ?= =?us-ascii?Q?ikvlmxGVTaoSjFBDqX4Oblg5h1kIwNkNe+8TrJN5IXrCFtuKEnAX43uUuSfV?= =?us-ascii?Q?3IZITbSPQLHoUu2FnzMXj8yJnyqKfnUkhOTF0hcyKcbif5cFDg64bnTo2rPc?= =?us-ascii?Q?F/oR8+OaL29xgPBzVb1ZqaOjgjr1Mm63OdQLmlIs5FW+EXy3PnCzh6E6D+WN?= =?us-ascii?Q?8glMCvpYoJS7nJ1JuREhRp0O1Lrna21+Ag8f6qALSRBSnnoD01TUikIdjCnk?= =?us-ascii?Q?BaD8nnLf20sGndXvxbaBf/5yVvr4xmBhRKQXpAlBR+tw0UlVc8OKJFefvU5M?= =?us-ascii?Q?Y3qi9o+PMUh1QzvWv9h+Xg39kuZ0Y4G9DTlqOM3PdgQnCChhHjW7ClEVQP0O?= =?us-ascii?Q?B2J8fTw0UxhhgugaPjdnwhwNEfkmaf3c/uqHknAleianJPN99nbtbWRFcXvm?= =?us-ascii?Q?9SRShCPfm3XvOJGArh9bCgA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ii?Q?Hlh7oFR3D3ahn06p8/eZ27+a5bc/+7rlNfZFxENK+ZCyb49p6vvdUsrDroKQ?= =?us-ascii?Q?QDcSmULUVdBdyxMwj6HwKhEgauQZ0ieY4bZ7Ye2k97iERSshIUYIIhPY/Mp9?= =?us-ascii?Q?A3B5/v3PWXWIAVHl+SdiwKiu78uTO3z1v2qpPi7kxhMMjLQxLAAlQF2VDl9i?= =?us-ascii?Q?PE/kUwlwUFJiQPyiCBktrV5PGd+KVfwpWivncWVsv1AhPYhVCl3pFB0TFOcg?= =?us-ascii?Q?qg=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c57c658a-3d7e-4556-9e59-08daf23b5144 X-MS-Exchange-CrossTenant-AuthSource: DS0PR11MB7309.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 09 Jan 2023 12:16:20.8977 (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: OIo/0fT2HPPUSjukhxE1TLzOCdo0Fd6JHPl/qiQrHR+XtXxlC/jCXDNxfVweIgBqIoHx7dY7NF5vXKskkqX5R/UYMlaBee670yfMztDH5Nw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR11MB4594 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 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. /Bruce