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 D3B71A0C43; Tue, 14 Sep 2021 17:45:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 99F7A4068F; Tue, 14 Sep 2021 17:45:11 +0200 (CEST) Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mails.dpdk.org (Postfix) with ESMTP id C1C164003C for ; Tue, 14 Sep 2021 17:45:09 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10106"; a="244377164" X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="244377164" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 14 Sep 2021 08:41:45 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,292,1624345200"; d="scan'208";a="452101517" Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga002.jf.intel.com with ESMTP; 14 Sep 2021 08:41:44 -0700 Received: from fmsmsx611.amr.corp.intel.com (10.18.126.91) 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.2242.12; Tue, 14 Sep 2021 08:41:44 -0700 Received: from fmsedg602.ED.cps.intel.com (10.1.192.136) by fmsmsx611.amr.corp.intel.com (10.18.126.91) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 14 Sep 2021 08:41:44 -0700 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (104.47.57.170) 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.2242.12; Tue, 14 Sep 2021 08:41:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=dd8+oCFB4mK6qdLj6Kly3n4XBR+e8hoz2t2RNGnsf/x6sZDOpZ3wRYZd974dG22W9vxNRNU1k1dZJmONYwNe3reLdVnb86nsQ+PXo30aO2H9zVwnT90Liaad9yhiY6DlQOZO77B3mv/lUIyvtvUyvSCnU+DRPxDiLVMLzVT1EYmzwxol6qm7CqvHL3HG9ZERkk+BUX6NagPmP4rfcqzJnoPZT/AIdRtnUTMmLQsugT0kEZVk1SR52lNe4wW9nVxG+Y/HxGMx7r10qBsuXwsTvVkiCGyevDDz+CWfMp+wf4NT2TDh1n86OP4tGAXsmpad21I7JzAMtnZArLohI0oCbQ== 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; bh=hctOMEHIqI5EmrP2xV788X94MxSlziuWxxjk5H+rQKA=; b=A2SUO++A4bLddcKGtfNCxKnU5P1JF7hHEw9gSk2lja9hpt8zlxzW6jSqRnpRUNzIS84Er/gta9HH94nemIghYJ5iRK3GjJu+gUXtQ8c8lLyc3UB1tKhgg7tCfKX/xRUgTC5KRwN35MMdNSTTueSvMw9T4/i5/3p5F9Gm8aLYmiYZH4c3nOompOZ5Ex9IevjxKjeSqf1teS1uZWulVqnQU55k0gDdm3GzK545ISv8UBZn3LY+At4s4PBMC03lkatm+zEnUKIO1LFQwjJwW02PCIqGv05LuhwSfLmIKYbDFSVQDhzmsfV0eVLq1Pfp8nB7zcVkR8ZcDw8wes1GzMW/Zg== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hctOMEHIqI5EmrP2xV788X94MxSlziuWxxjk5H+rQKA=; b=Mth9twJtfrwCBFWwAUD/UJH1y2EhWgwoBuZfSap152bgnH9+kFVsaxOzlV7csexppCP3J5mzoLEOMHEuuXVlgON3WOpQZKqMfQYI3eMn9j5GLgOWQphZTP1JotcTaRar70msZc0XKLXi46GjXEnLbnEjDw1IsxMn9SW6VVoTKTM= Received: from MN2PR11MB3821.namprd11.prod.outlook.com (2603:10b6:208:f7::24) by MN2PR11MB3854.namprd11.prod.outlook.com (2603:10b6:208:f0::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4523.14; Tue, 14 Sep 2021 15:41:40 +0000 Received: from MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::ec2a:14c6:a7de:bcb3]) by MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::ec2a:14c6:a7de:bcb3%6]) with mapi id 15.20.4500.019; Tue, 14 Sep 2021 15:41:40 +0000 From: "Power, Ciara" To: "Nicolau, Radu" CC: "dev@dpdk.org" , "Richardson, Bruce" , "Doherty, Declan" Thread-Topic: [PATCH v2] telemetry: add support for dicts of dicts Thread-Index: AQHXpjfjUmXoWnOjTUKw1+EhiZd/bqujqslA Date: Tue, 14 Sep 2021 15:41:40 +0000 Message-ID: References: <20210903105725.243477-1-radu.nicolau@intel.com> <20210910112752.872337-1-radu.nicolau@intel.com> In-Reply-To: <20210910112752.872337-1-radu.nicolau@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 12fd0b08-f159-4e0b-32e9-08d977962525 x-ms-traffictypediagnostic: MN2PR11MB3854: x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:8273; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: GRbEpWmcaAQAoUpO3StmFLMbgAnr4zwWyNCn8iSlmBtqxcM1QtuPPIPjVZhld5PU9AyeePlS6OHZGgDctz+WvoOk26VL4entfX+an5+F3Tnrr5UU2CinpKApKnYCapy2fJakWBmV9bqLpd6ySQnnFBjgbzn1GDUAAEjqs1HUqv/mWVckdWc4JWHddnGKC/eYCG90qnw1gCjfFVyxiAquGaUFzel1+/kiBcMaO5iDHnyenV02QsqYxWYDIAR2KLBh4N+jQmjfYcXUdoEi2ggguSvruHTzK0OpZRXQfIjElHjZw8gQ38DwusBtMTkV/ct4q/GjpY5wNTozhEid2oruW2EkSOmtHi4v4LCDYvrT82Nkyt8hFD4nldqoirNqoRI/RGgfkqn1LIh7Gm/hxSt03NhRvIbq6tA8+rITqMvpTARFnttjkNfE40jnrK7lYCQvdiPSWTVKoe/xKUg3qfniihRulMLq0tlpuLC55BQuKnGUgtfpjs7EzK27E5Ltwh4Vviv3f1YknNnESH/J4IwxrXAhh78wgTfNafesKiSjGUywAdyktUlYlS7peMZb2KytE9T/VD9Xjd/VOusdgcF+NfqQO4n1Z2L4LpwTRVXyUI1m3/X3xCWQmIBx9mwe05vuZ+wejGUfR8XmH6InDH/jZmO0W4G4/84gzelmh/uWn1XkJnnUXiz0wKArnLkMNyElXq1GvyiZZOd6Nzi6kg+INQ== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3821.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(346002)(366004)(136003)(396003)(376002)(39860400002)(66476007)(66946007)(54906003)(26005)(66556008)(64756008)(66446008)(6862004)(7696005)(316002)(5660300002)(52536014)(6636002)(8936002)(76116006)(186003)(8676002)(6506007)(38100700002)(38070700005)(33656002)(122000001)(55016002)(71200400001)(9686003)(107886003)(83380400001)(4326008)(478600001)(86362001)(2906002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?pWgK9FWvd2uhr7yJ/Hiptvpm0sX57sB1qGTS/nKcm735gqtIh7gMwKCnScfo?= =?us-ascii?Q?Z8RhHWxmXF0Nkqx3jutWXAK9xSlA83u3pYmOCz52I5dZX6GufjFpGuVeuzsG?= =?us-ascii?Q?k6V9ajO6eJPEJPkWFtfFVq6z0G+2GtFFwCr2dsGVqPUEbc/hsdIL5FLIlru1?= =?us-ascii?Q?foh7OClJJiF0fYfvd94Hs2NY0LCvMJGJw0FtzpxxswPjcO0JTq2O9pWbPmNM?= =?us-ascii?Q?m3t6Wha+6HYO2H/tv+/sVAvpupRT/ncLIVAT8IBkbqHDjSta9nJA7RatVF7v?= =?us-ascii?Q?vqa4ocJLBJf1ctkA/1MyhMP2V3oIVgkudrilq5NBcNdHEaLAq7cqUUB/31+/?= =?us-ascii?Q?CaU0bT3+XVYm47K+4fGYUtTSHPfgvQ4Rt7d1zFuyoIRzQCIwDMx2FeUrG6Nx?= =?us-ascii?Q?EHfiXhc8ByVXtMWjlvqU+XfN7fDYWD7cWeMr+RplUHt/rgJmKr+FqaBM3Mcs?= =?us-ascii?Q?mPL3Qr1etryfrwNcURyNWbGHYaIHzqVvqnHROLnSqgS4T2JgxDp+nsYkPwIh?= =?us-ascii?Q?w+FzbZgU4ycDbou1S1GHwXVEntjR12mczgil4V68NvWm3TDq1JP8Lg1/h0Vp?= =?us-ascii?Q?TylBvZb1rxR/HoPdzOjxh2o8exFEi4GNcol3wjhOkcpcIMe/cYp4Iw/Decc7?= =?us-ascii?Q?Cf/MNJbjWFs/tqfOOiOnLhpz0X1asmoLeiCM8H4EXexM2dw+XGRNNjVobFTd?= =?us-ascii?Q?XtkrmJlR/0NcU5k1Cj1IPRoqvyvm7RF0xSMeK31zqOCgVyKGomm6TdHYYly+?= =?us-ascii?Q?bdn8y/4cuBlyhfmDq+zfebJ1sBQOYnRhadkD+SiQYWAVyLSyPVFXveX2oFpa?= =?us-ascii?Q?adNhqgl60xAC6YOSm3KRhL+pdHQO7EU2vpa//4YAxxy2ssrIQsqlF6n48eps?= =?us-ascii?Q?6e7Ebj1SGFQ2lP7PDk/Bd8E2ZcAwgx9ghZFnfKYyou6tfiuavC4pbwutTXXf?= =?us-ascii?Q?OoM9pHbI8WnKIl6YAkn+QzUK/w0QOWp7238+4o4ufy84OaUTDlKvezfeEhb2?= =?us-ascii?Q?0KnKknfhDMET8RVJ5Y61wA4Km44Hsihv9rw9EL8G8tvDkAopM+Qr61vDRwYE?= =?us-ascii?Q?TQ2i1HEhuM5aV66Ej1UFuqcU8/5wxqVhz1NyjW8I8CYxpWkkJmfLNrNPUKB7?= =?us-ascii?Q?oWj45cjdh7VMk5jzY5mEJS+VyWb1DZYuuQK7NohxVbb8BIumaVephhsY4e8B?= =?us-ascii?Q?DCw36LASpq8JymZktCQepSjZsV++E1X0h+2Yok8ZsFx3d9z9GDfmLNE7Wgpd?= =?us-ascii?Q?w01JsD7nscoyTpjpPz2iEiII/SYjZBhP1MYtr95gFT4fJxd+HOh1nhvyNdfk?= =?us-ascii?Q?W/LZb2cus50cOPCbBZ9dZbQT?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB3821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 12fd0b08-f159-4e0b-32e9-08d977962525 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Sep 2021 15:41:40.0900 (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: WpLdlQMQLiaydPIsvUb+/Or4D6KHV2tHDMYZHdOZazstDMAZscJuIsHpNVDUaIID1O81ABDZ7EZcLiENOt5aNQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3854 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v2] telemetry: add support for dicts of dicts 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 Sender: "dev" Hi Radu, Thanks for adding the test, one more comment inline that I have just notice= d. >-----Original Message----- >From: Nicolau, Radu >Sent: Friday 10 September 2021 12:28 >To: Power, Ciara >Cc: dev@dpdk.org; Richardson, Bruce ; Nicolau, >Radu ; Doherty, Declan > >Subject: [PATCH v2] telemetry: add support for dicts of dicts > >Add support for dicts of dicts to telemetry library. > >Signed-off-by: Declan Doherty >Signed-off-by: Radu Nicolau >--- > app/test/test_telemetry_data.c | 29 +++++++++++++++++++++++ > lib/telemetry/telemetry.c | 43 +++++++++++++++++++++++++++++++--- > lib/telemetry/telemetry_data.c | 3 ++- > 3 files changed, 71 insertions(+), 4 deletions(-) > >diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data= .c >index f34d691265..18b93db8ef 100644 >--- a/app/test/test_telemetry_data.c >+++ b/app/test/test_telemetry_data.c >@@ -200,6 +200,34 @@ test_dict_with_array_string_values(void) > "[\"bbbb\"]}}"); > } > >+static int >+test_dict_with_dict_values(void) >+{ >+ struct rte_tel_data *dict_of_dicts =3D rte_tel_data_alloc(); >+ rte_tel_data_start_dict(dict_of_dicts); >+ >+ struct rte_tel_data *child_data =3D rte_tel_data_alloc(); >+ rte_tel_data_start_array(child_data, RTE_TEL_STRING_VAL); >+ >+ struct rte_tel_data *child_data2 =3D rte_tel_data_alloc(); >+ rte_tel_data_start_array(child_data2, RTE_TEL_STRING_VAL); >+ >+ memset(&response_data, 0, sizeof(response_data)); >+ rte_tel_data_start_dict(&response_data); >+ >+ rte_tel_data_add_array_string(child_data, "aaaa"); >+ rte_tel_data_add_array_string(child_data2, "bbbb"); >+ rte_tel_data_add_dict_container(dict_of_dicts, "dict_0", >+ child_data, 0); >+ rte_tel_data_add_dict_container(dict_of_dicts, "dict_1", >+ child_data2, 0); >+ rte_tel_data_add_dict_container(&response_data, "dict_of_dicts", >+ dict_of_dicts, 0); >+ >+ return TEST_OUTPUT("{\"/test\":{\"dict_of_dicts\":{\"dict_0\":" >+ "[\"aaaa\"],\"dict_1\":[\"bbbb\"]}}}"); >+} >+ > static int > test_array_with_array_string_values(void) > { >@@ -355,6 +383,7 @@ test_telemetry_data(void) > test_dict_with_array_int_values, > test_dict_with_array_u64_values, > test_dict_with_array_string_values, >+ test_dict_with_dict_values, > test_array_with_array_int_values, > test_array_with_array_u64_values, > test_array_with_array_string_values }; diff --git >a/lib/telemetry/telemetry.c b/lib/telemetry/telemetry.c index >8665db8d03..3f83476112 100644 >--- a/lib/telemetry/telemetry.c >+++ b/lib/telemetry/telemetry.c >@@ -24,7 +24,7 @@ > #include "telemetry_internal.h" > > #define MAX_CMD_LEN 56 >-#define MAX_HELP_LEN 64 >+#define MAX_HELP_LEN 128 This change will not do much - it will allow a longer help text to be given= for the command on registration, but when the user actually asks for help text for a command, there is a res= triction on the size of the string value that is added to the dict reply, which will truncate the help text: In telemetry_data.c/rte_tel_data_add_dict_string: vbytes =3D strlcpy(e->value.sval, val, RTE_TEL_MAX_STRING_LEN); where RTE_TEL_MAX_STRING_LEN is 64 Maybe we could just increase RTE_TEL_MAX_STRING_LEN to 128 and replace use = of MAX_HELP_LEN with that, to keep them aligned. Thanks,=20 Ciara