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 2B088A00C2; Thu, 8 Dec 2022 12:20:24 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1FD13410D2; Thu, 8 Dec 2022 12:20:24 +0100 (CET) Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) by mails.dpdk.org (Postfix) with ESMTP id 6CE6940A7E for ; Thu, 8 Dec 2022 12:20:22 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670498422; x=1702034422; h=date:from:to:cc:subject:message-id:references: content-transfer-encoding:in-reply-to:mime-version; bh=pGUZ77YS3k29dLAtGxXMBOclFGC9Jovsyg9ry7BCD40=; b=KJzEH3wNxt3QgEd/v2OK54GSkAJc9CXJ7vnJMGRwKvJivn8wqytINj0T PU8uMuKUUQLGU6b+pQK8meM0adk6IFl9pjOB7fDCUCQHQqIzYSzHDpvby 4mr60Dir6TqBnUXWaATmtDfLlWmcdyqteE74Soy+fZf8vEGHmOIwJb0Lp 5Mynyxb//dPIr/vk3GddObwzXTdEPYkbzg0FEGpuyGvu5+gAHAgOLHVTY CLl3JyEyTu8qyArHdov9D1MHbkfoIcX0ZR02zuvj9QFTEwO46DtnxaxXU SHGFmndw6jFPOGFp+64Ss3rBjTzwTFQaKf+RKEeYGfwk5x0fdXNVL3Zf5 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="296837936" X-IronPort-AV: E=Sophos;i="5.96,227,1665471600"; d="scan'208";a="296837936" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Dec 2022 03:20:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10554"; a="679495318" X-IronPort-AV: E=Sophos;i="5.96,227,1665471600"; d="scan'208";a="679495318" Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga001.jf.intel.com with ESMTP; 08 Dec 2022 03:20:19 -0800 Received: from orsmsx610.amr.corp.intel.com (10.22.229.23) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Thu, 8 Dec 2022 03:20:18 -0800 Received: from orsedg603.ED.cps.intel.com (10.7.248.4) by orsmsx610.amr.corp.intel.com (10.22.229.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Thu, 8 Dec 2022 03:20:18 -0800 Received: from NAM02-DM3-obe.outbound.protection.outlook.com (104.47.56.41) by edgegateway.intel.com (134.134.137.100) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Thu, 8 Dec 2022 03:20:18 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ebv5bl3HWfwJuGHCgOMJmHaHZTJbeinjClOe/LjUkJVSeeazvKWKagDn5QiXgDrw2QNn7SQ7wICrNYBf03QQtDLYwAUreannldbBqWjCWeJXjelNt6RLqMaK5Q9wPjUJzzoF1sgahr+HrGHHF53ELjGQtMwY75SWXomtXgInrHu/tQztXKk8Lpw6UYiYwXJ2VwVN+loT1PRQYYHf/v9hYFTpWlD+maLWa6l3XXG4sftwI8XANpKXZU8NpSCaQzeWdoRXw8gbWQXyGzwGevozUDD0XRosRW61hKO6+u5sT0xYtuUJAAYMiMRNl9NeKx0I1AoiF3f6PPffu1l2QV7qTw== 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=8p+vyOU9RinDZuw7dXJZEAoSfz//WATSjtnq/rLM1fg=; b=PMLy470eP3i2gxycPBnqfe+Nhzy0aKMnEoVOkQJDPLXSnq3fpL0YAm+KG2YUudNr0zqLM56RlBxokIuZDOD2mkAt2rwXCIgRe+jO10GIB0DGGbTo5xc8KpztCzq0IZV1dSvVheP2qP5O+7WT6LN/z8gLulbyyLqWO05yiVhMo7gHVL3vvAyd6CxgOEsKph8ZGmmEaWmmIJJEA5rnpk6f0ApsgbsIqg6ICJVIp0ljjYeQ0te64Mgj7E8/tBy39tC/1yzFyTPp+Fp7sZJ832jGvqbk3g1cIHgFGrS9KA3PfoNgZdDZDsRnIiHU+6MhfcL+ll5fNFUu1AnB6Uud0mla/g== 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 BN9PR11MB5468.namprd11.prod.outlook.com (2603:10b6:408:101::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Thu, 8 Dec 2022 11:20:11 +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.014; Thu, 8 Dec 2022 11:20:10 +0000 Date: Thu, 8 Dec 2022 11:20:03 +0000 From: Bruce Richardson To: Morten =?iso-8859-1?Q?Br=F8rup?= CC: Huisong Li , , , , , , Subject: Re: [PATCH 8/8] ethdev: telemetry convert capability related variable to hex Message-ID: References: <20221208080540.62913-1-lihuisong@huawei.com> <20221208080540.62913-9-lihuisong@huawei.com> <98CBD80474FA8B44BF855DF32C47DC35D87573@smartserver.smartshare.dk> Content-Type: text/plain; charset="iso-8859-1" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35D87573@smartserver.smartshare.dk> X-ClientProxiedBy: LO4P265CA0148.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:2c7::12) To MWHPR11MB1629.namprd11.prod.outlook.com (2603:10b6:301:d::21) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: MWHPR11MB1629:EE_|BN9PR11MB5468:EE_ X-MS-Office365-Filtering-Correlation-Id: c7a09682-2cb3-42c1-4cb2-08dad90e2b0e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u3s96KZ05wVXnUd5ovTwHh/okWYhXz4D8uQiSDXYXvlzzreD6KNnwZ7onri+Xj7/Nd8g+bBUDUr6DFqIhgj374kaq6mh6kZlx3BugZipe6cJHQ9B+mQkEl0sWQUbqymAl3lmvLn00mMuy67FEie3jMiof9lWN0io0Qq7mnw5ckV/HqKAqpCpSsWX1gkFYQDDYxqfqUmW8IRddHRzC6AjaekCrfTLSqKf1R6+Oo6wYsEdwQP+wJOQrB5CSeQ6M4NkXVkK9zel4+TkSrUpMk4YPb5zuebXyBOvYTrGmi/Hri1XgxbfeFoQvda3Pw6jPHnuVRSbrCh0r7lJ0cSzyb/kGLIRqZNc1YlAXwHmWBuiTsimWSWIAXx0kJ9azInBWc4HSqyoaZmqmnJG8SHWDyPYcExHG5NP+sOJJpO5UExO+a1PCgsgIHVwbUycT5pzOb1QGnq8d6IgIbdoE0K3yjYlvvHUqtFskHWxnODh1oXzowjRyJ++Md4i0pFqWwgrw5/x0K1rE+4FztoBCLVlt2A+FQjmcC4rEjzt99no+WhYWth+/wwZs/09GfOHfDfEb/1yJTZLSBEpOIx7EAE4P72nkWLVCZInNfzISsx54yaruVrkJIKaR7FuFeoWbrmNseoKwk6nK0zjC44OJ0yYPpLH4d7WiLbmfM1oA8Y5fGf1y/s= 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)(346002)(136003)(376002)(39860400002)(396003)(366004)(451199015)(66574015)(478600001)(8936002)(86362001)(2906002)(38100700002)(5660300002)(4326008)(44832011)(41300700001)(8676002)(26005)(66476007)(6666004)(6506007)(6512007)(186003)(66556008)(6916009)(966005)(66946007)(6486002)(82960400001)(316002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?iso-8859-1?Q?gHT9Nlr5+tfUf8XNX08oGBkcnp4G4k+gJyVzILml9lyhiiWDohd/CPXHuO?= =?iso-8859-1?Q?PEiDUDYYKzIBVcYsh5uxDYplmEXBp87wSuJu6vELr0XuZAFgqh19NTfrNI?= =?iso-8859-1?Q?BGqDJUDjJFzUMVtFb4quktNn8BYa0vue+o2jon+Y8ZZewcDVNxhShl2Qcz?= =?iso-8859-1?Q?Tgv9jFykPOzCH6/mJ8roCea8ei/pr0mj5lrjkyMyMrXBpo38+R4+T7AVyR?= =?iso-8859-1?Q?n3a1nh7KEQpoZqcxIcmr5YGKoddSxMGximAh5PjJCvcf/ANXkDpOModNRH?= =?iso-8859-1?Q?0F5SdNLscBeIaja0fcdOpZootrI0UYy1ZoLgDdLUmErMV0zj75E3zQliEi?= =?iso-8859-1?Q?x3KHxtHS5aoBlaUOJHkYv2ZSIdqpbyqKk/oc65BnDL/Od9fBqe84hkGRbo?= =?iso-8859-1?Q?2Cbl9M/maXc3pvfxuBmcGLepiozIXJZDo6NNvW8zqaFKk7W/5f1PLuS8gm?= =?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Ge+CSscTsWcvSDAEsIliN?= =?iso-8859-1?Q?UA66uEC1fC6IctScjsCOKc1RvpHkUghPWKXCgZ9Q7IJbjGHiQr5ORsdOfT?= =?iso-8859-1?Q?PG6scS5q3MGCDFpd5zH0XkRbg+BNIQnyqeaxE3HauOhwEnYLJpkOmV+xWt?= =?iso-8859-1?Q?vYIKlth3x/h3JHslpB7I+bTObg8AZxTQ1D4ULzjL+DXqZpHQxXzV5P2Ndw?= =?iso-8859-1?Q?vPWfPyMAgTYL+pfBmdJ1SEi0xgOd479A7vPPj6e8g6Qf0ObN/lzD+8U2QA?= =?iso-8859-1?Q?K4IqDDJhGp3iVeEJx6lmJZhPOboCL1eAi42DHzsAEy4IAMY+rcz3oDxQ?= =?iso-8859-1?Q?=3D=3D?= X-MS-Exchange-CrossTenant-Network-Message-Id: c7a09682-2cb3-42c1-4cb2-08dad90e2b0e X-MS-Exchange-CrossTenant-AuthSource: MWHPR11MB1629.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Dec 2022 11:20:10.3035 (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: DAJpM/mZ0zR2YPY6Dh0JeompgRxblGGk9lUdD9qBZUPDSD4whfW9ZvJ2gkwDgio18AXWgedqTpa0iPM7arcVzGVgeNQXo2QaNTDSjIF6c28= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR11MB5468 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, Dec 08, 2022 at 11:55:16AM +0100, Morten Brørup wrote: > +To: Bruce and Stephen might also have opinions on this. > > > From: Huisong Li [mailto:lihuisong@huawei.com] > > Sent: Thursday, 8 December 2022 09.06 > > > > The 'dev_flags', 'rx_offloads', 'tx_offloads' and 'rss_hf' are suitable > > for hexadecimal display. > > > > Like: > > -->old display by input /ethdev/info,0 > > "dev_flags": 3, > > "rx_offloads": 524288, > > "tx_offloads": 65536, > > "ethdev_rss_hf": 9100 > > > > --> now display > > "dev_flags": "0x3", > > "rx_offloads": "0x80000", > > "tx_offloads": "0x10000", > > "ethdev_rss_hf": "0x238c" > > This is certainly good for human consumption, but perhaps not for machine consumption (where a number type is more appropriate than a string type). > > Unfortunately, the JSON format [RFC7159] does not allow hexadecimal numbers, so hexadecimal values (if supported) have to be passed as strings. > > [RFC7159]: https://www.rfc-editor.org/rfc/rfc7159 > > This leaves us with the key question: > > Do we want to provide integer values like these as hexadecimal encoded strings? > > If we do, then the telemetry library should provide the functions to do it, rather than doing it here (and everywhere else, where relevant). > My initial thought was "no, we shouldn't do that, and just treat numbers as numbers", and let the end-user display software worry about formatting it correctly. However, I have since changed my mind, in that: * Although these are numbers, they are not used for computation, or comparison * Having them as strings makes them more useful for "dumb-client" connections, like that of the telemetry script in DPDK * If display software is aware of the significance of these values and does want to do additional parsing of the flags, e.g. to map them to named flags, converting a string back to a number is not a difficult task. * These values are not changing between polls, so any convertion/processing of the flags to be done before display only needs to be done once (except in very rare circumstances of a port reconfiguration) So overall, I would tend to agree with your proposal, in that it would be good for telemetry lib to provide this functionality. Regards, /Bruce