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 5069BA034C; Mon, 12 Dec 2022 11:32:09 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E62474021D; Mon, 12 Dec 2022 11:32:08 +0100 (CET) Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by mails.dpdk.org (Postfix) with ESMTP id 9FCED40151 for ; Mon, 12 Dec 2022 11:32:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670841128; x=1702377128; h=date:from:to:cc:subject:message-id:references: in-reply-to:mime-version; bh=qWD7yCyMApTK/1KUHfe+ObMTMVQRcUFimhs3TaWe1zk=; b=ZsBvC1ktUNfiqLnT9ZKUaWlGXcTBFcyhoK2v3ly21tpndhYwJ96PfzPw Mtkxg3oOIUb2L+W7QAwPw+xWNDdFtzxZui5DaUtgVjih8lxaZfZmDTKQq vQS1HvEdX1Gaei9D8PQeiWQi/JjwoEwSHX44yNlFx4FNdlLTHys6+OoZo pfkwc4s4qy+znvYU4iDPNZdl1siPiuXO7lyrHcZvsdWAucLdrD05NnNdb IrZqnlqzxGf7+6xio/YwKe6YHtZ2Wb9eRmUTjLW4F5bJ6BRuQ5FTsZud8 sm596cSXOlDea1c+40U4WofTxPs1rqbYUzzX2QdyHbPzxYdyRwoapWooQ Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="315456054" X-IronPort-AV: E=Sophos;i="5.96,238,1665471600"; d="scan'208";a="315456054" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Dec 2022 02:31:59 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10558"; a="716746816" X-IronPort-AV: E=Sophos;i="5.96,238,1665471600"; d="scan'208";a="716746816" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by fmsmga004.fm.intel.com with ESMTP; 12 Dec 2022 02:31:59 -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; Mon, 12 Dec 2022 02:31:58 -0800 Received: from fmsmsx602.amr.corp.intel.com (10.18.126.82) 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; Mon, 12 Dec 2022 02:31:58 -0800 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx602.amr.corp.intel.com (10.18.126.82) 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, 12 Dec 2022 02:31:58 -0800 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (104.47.73.45) 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; Mon, 12 Dec 2022 02:31:58 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MjbsKsF2EBJ/weGFP+AzDigWxhN9GfXPu3MN8g9yHWnzYIcLTFZM8cBEu/IX2JY1oIgLH88QHshokkf3/KLLc2p0JWsztgsVhVbMGJOmdFOkUeH7mDne64Ngms4Yk1yi/78Un12nQCG6oFbF4neFaB1UdaFEpZGfdG1UlbNB8k7UQUUPnrEYJZyKiq6HC9HvQR1+Do449CK9MICnFFjK2FoYAefdMrNXJpjeqRmaFpdvq01AuqCrqY01r7oit+fQjT452kaUBDOElvOjV/gNIU7VK1KGetf41mmWeMGXSRpLXDqr0SabH4RzCUmY+n9yN4/lTxgkQNMm2viah9RIDg== 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=jR+6u+cVlIoaQfwHP/AcIpS51kgQ0mrtADE4Pz5TftM=; b=Zk4CwsTzkCcKMQbqRDlU/+Lyn/syECKvFO4Ba928a2MhyEEYufyE5qREIut49DvXaVvF932kk/TItAleyaLSZC6YJpdyZUqykSCEk/lwZPjpJM53kVhMxCC/R8xW/AikVZmXwkeCAPAWtuX3eezuaNiNlu3IY2A+ZuU9FhemS5zrsWeuDxxQPt/lTrBlrIc4iN924StdW9eG6L4GIcTGZYg1fE4recBDJgB48n0ntQSeg0A3bT0Oo5m74WUqijlxPRWW/Viwwoh4PaPGjgu/YtN+wIkbu2fl742FN4WLLFWaX28RYeG9WFas8PnwMViABgmjGA8KiohKHeDv2gcdzA== 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 MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) by BL1PR11MB5480.namprd11.prod.outlook.com (2603:10b6:208:314::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.19; Mon, 12 Dec 2022 10:31:56 +0000 Received: from MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::18bd:edae:ad31:a228]) by MWHPR11MB1629.namprd11.prod.outlook.com ([fe80::18bd:edae:ad31:a228%3]) with mapi id 15.20.5880.019; Mon, 12 Dec 2022 10:31:56 +0000 Date: Mon, 12 Dec 2022 10:31:48 +0000 From: Bruce Richardson To: Huisong Li CC: , , , , , Subject: Re: [PATCH V3 00/11] telemetry: add u32 value type and hex integer string API Message-ID: References: <20221208080540.62913-1-lihuisong@huawei.com> <20221212064306.39232-1-lihuisong@huawei.com> Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <20221212064306.39232-1-lihuisong@huawei.com> X-ClientProxiedBy: LO4P123CA0643.GBRP123.PROD.OUTLOOK.COM (2603:10a6:600:296::10) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|BL1PR11MB5480:EE_ X-MS-Office365-Filtering-Correlation-Id: 70439cee-4c1a-498d-e161-08dadc2c1704 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fEV5hhhu0PCtLppUUGoFz4qmKhpaCFXf72E4bIyE3EC7A44t07F+LXQRnDiciahK89T/WyYPTjwZ4gLmZIk4eXjl+IXdvDMZbUF6209rGWwLru3IGN+6gDlTI4ftx/G4KBNC+aUDw/wSEpmHxRkkyFl95r3Zjq2lf6LwOUWwJI/+JlPGqcU3vl24avRWEsui5HNWNr3ijAnZJyJ6ZSVWDQdhBpfFWnb3MBMv9U6U5gkLrmo/zrsydy3YTVRTZyXT42AQdGbS71tO018MRfiYu0gm9Du2dQdGbkRSPF4oWp4ZW5fWEa90AlYuApmHOv2/WV6EDzJF4T6LWf0UlFHTEN4kjUXP2mjzHkqdeqAKafDKhyetwrAXj2D4SN72TBfqYXsHpEPCbHV5de0SYsVpEff6hnp9S8U2p1HvMInGGvRmQJ3L4cUA27ks50wyH9mLPrnBfMhiQqKhTsQ5SmGY1zhBdOPMznObW6PcpkVq4E7Ths80rTS/p+sauV+pjQSf6bPDklukMXyYZsUZWd/z44WVmnoefQkLALiVZHeD1M0iX7MeFwpej1QZypE9pKuEH2IUMGJyXxdkOW9oltSs3eTrY3aWwMGk5gFmIN8kp3Z84/Nh9gMlyRTHWMMkDmOVFTSIIjojTHNbgj07JLR6fQ== X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1629.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(396003)(376002)(346002)(136003)(39860400002)(366004)(451199015)(316002)(6666004)(6916009)(2906002)(6486002)(83380400001)(8936002)(478600001)(38100700002)(82960400001)(44832011)(6506007)(5660300002)(4326008)(66946007)(8676002)(86362001)(186003)(41300700001)(6512007)(66556008)(66476007)(26005); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?EkjLWlFjAfkcKPIFVKrBsLdBjL/4D/0XNgJHfVwBNWZ58E3gaA9ax6vcSOYm?= =?us-ascii?Q?goMXg4ti7oSZgnFdQJF4xRI/JYIJHXLJJo7cOLwaH63k4R5B3td8R+sU9MTg?= =?us-ascii?Q?NVak8MfqmAJ3VUMBda+qVeBVzN7Dfmf+jEG0A1HY2jYC14gGyHJC58ntEljH?= =?us-ascii?Q?/NnBH1RbZFV2niIMcg1rE9iP1IC1EsJgzjYgbe5K8qN/Qfvvn/OZAOgYklpT?= =?us-ascii?Q?vLkTZ6rcu2b3IkrDCDcnW5OwMC336WhG9kLrWCan0TlGksf5t7Nz9BoS7O+h?= =?us-ascii?Q?AZZnzPQVkvp2A6fnnm7oSZXtxcCXBaQ5r7iPMpVaCk9SWY+QG/A5dKybXLZ8?= =?us-ascii?Q?ksgZ0jezPCL2gvA9he2U1Gf1w2ry41zxojxnBAx/BdrT7piUyo2lqWSh9AgF?= =?us-ascii?Q?J1kYnCe0Ua6/51xEVDUs5Tmbg/7nHpAfOa7gz9YLpULP28Vx33e3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jhQ18wrOtwA8BHJdusgcb22vAG5iawFn521rsuy8pkhcP?= =?us-ascii?Q?mbk1KfpKDOCYl0sx9F1VP+dBqJx9/9Ww28pk2+MS1emZ8IkBNz3I/fsGU0QJ?= =?us-ascii?Q?5DFeby8hPUJOmaZgtSGRdrLbfZPJKggDqyJsN+LYaE6EJvVLAXo0Vpuooqg6?= =?us-ascii?Q?ZhNP1GK6d0MYcCsSJpmOKymxKX9GVc3uYkfx1B+SQ48l8eV9UW1/YuqEUN+e?= =?us-ascii?Q?JmVBaRADlDgtKXoQfUuSEsxRNCoHWh9VhzYlAJYwhlfEa34xphzB2AF4GT2N?= =?us-ascii?Q?lA=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: 70439cee-4c1a-498d-e161-08dadc2c1704 X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Dec 2022 10:31:56.4837 (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: 8smjvRJ7DwKQSiL2xX23RzeIc3GWAK7pSA4rsVczgN7OlruDOqhPjWGdSfzPOGPewU59ouDI5bdqlCDX+og7g1r4rNbn9oBPyQ6i4hrBZQI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL1PR11MB5480 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 Mon, Dec 12, 2022 at 02:42:55PM +0800, Huisong Li wrote: > Some lib telemetry interfaces add the 'u32' and 'u64' data by the > rte_tel_data_add_dict/array_int API. This may cause data conversion error > or data truncation. > > The 'u32' data can not be assigned to signed 32-bit integer. However, > assigning to u64 is very wasteful, after all, the buffer capacity of each > transfer is limited. So it is necessary for 'u32' data to add usigned > 32-bit integer type and a series of 'u32' operation APIs. > > This patchset uses the new 'u32' API to resolve the problem of data > conversion error, and use the 'u64' API to add 'u64' data. > > In addition, this patchset introduces two APIs to store u32 and u64 > values as hexadecimal encoded strings in telemetry library. > > --- -v3: fix a misspelling mistake in commit log. -v2: - fix ABI break > warning. - introduce two APIs to store u32 and u64 values as hexadecimal > encoded strings. > I'm not convinced about adding the u32 value generically to the telemetry lib - except in the case of having explicit function calls for u32 vs u64 hex strings. Having a u32 type doesn't gain us any space internally over a u64 value, since all values are in a union type. Also, for output as json, the numeric values are all output as decimal values, meaning that the value 1 appears as the same size in the output string whether it is a u32 or u64 type. Now, it may save space in a future binary output format, but even then it still may not do so. Therefore, I'd tend to keep the existing u64 type as-is, and instead only add the functions for outputting hex values. Those hex output functions could take an additional parameter indicating the desired hex output length, as there could well be cases where we want just 16-bit hex value too. /Bruce