From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 30A3AA00BE; Mon, 27 Apr 2020 11:53:57 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D378C1C2DB; Mon, 27 Apr 2020 11:53:56 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by dpdk.org (Postfix) with ESMTP id 9A4DA1C20D for ; Mon, 27 Apr 2020 11:53:55 +0200 (CEST) IronPort-SDR: IqT6peqEgzq+gWG5UtlzeU2+HJqV9Kg33vu9opocqKgo9yTAAxOvi5Gv8Z7Rm6vrhBtauh08SG FRXD+jvr+9dg== X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 27 Apr 2020 02:53:54 -0700 IronPort-SDR: VIOZXj+HOyFVoFwG8ULDbH4tMEfAGb7gidds8Z7qjtxf8+9/ZFyygCiJYa+l1DODzkmgMm47r7 ziL42FmP4m8w== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.73,323,1583222400"; d="scan'208";a="458789250" Received: from orsmsx102.amr.corp.intel.com ([10.22.225.129]) by fmsmga006.fm.intel.com with ESMTP; 27 Apr 2020 02:53:52 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX102.amr.corp.intel.com (10.22.225.129) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 02:53:51 -0700 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1713.5; Mon, 27 Apr 2020 02:53:51 -0700 Received: from ORSEDG002.ED.cps.intel.com (10.7.248.5) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256) id 15.1.1713.5 via Frontend Transport; Mon, 27 Apr 2020 02:53:51 -0700 Received: from NAM02-CY1-obe.outbound.protection.outlook.com (104.47.37.50) by edgegateway.intel.com (134.134.137.101) with Microsoft SMTP Server (TLS) id 14.3.439.0; Mon, 27 Apr 2020 02:53:51 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZdtfaPhKWopcK39Z/gulYzSUQTuH2jWnetJQ51oE9Lleg32cgujnF9Qc8ddtRHzr5CI7yqzIIt3Aw52CEmzrfC4TdKlGuXtx6/SzSokYWaVdzMVhBDNTEdK7NDEp7RsSqhgjZA3OSpiCq1uOWd45YQcZF3HMLHFidhE38gp3Bb2WefIIO271k15Udl3mg1fhlr5Y/3uhcHYDi2L0/ZfJmQcHmC2h8/K5mCog1gC4q1+XIp87MNxnqmUgzGt3grxxNH+c3TKwWK+lbeNBDQ57pXOCMVkWuMdVGnF5juf0+8jxuE85Q9BBJ1DU9VZUTy9mrKOVjm5X+A3k7vyzLQ0fNg== 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-SenderADCheck; bh=7H70mhyGWPTinyDCaIAyef4mRDmUpmRxIZxFLYZNeI8=; b=jg1IOd/9XdAakhfTavYs+YgtaAfgkI510XgvTEupD2Sc7eWxiUq+TvI3NgaUcSdaKoZK1GwOAnwp2V0LMu57ncEI0HlA9hv/jgv5gb48rbz6QUrFmXr7Gode5BIGjA5SuEb8xVN+6RPkFGBdJTiMBgzfnCAkcxXcFzXpN4fahKinOuohDz9vFsugmsDPlZy0gR6Tg/xdZ3OnmDJPPP98jETZExgsqoi3ENihbUlXIXKRpMZHEJBmYoyRn2ZmVzBtA3018qpizGsuQ5XIit2vtedMpXPJPcEzy1P6t3tBorzQFMxHYCSK2nYyaoT0BudOQoqmppeAOtGQiIxAnJpV9w== 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=7H70mhyGWPTinyDCaIAyef4mRDmUpmRxIZxFLYZNeI8=; b=IYnYk45CD8OTn5120MbQ/JDBlV+cCZfsP9itSDgGdYB6F9a1wnHAxMgrVN2T29KKjNgt6VUy0HjpwNDy0Fur29u82Xes6zbcwkTgcWZgWaAE784JY9yBhSqqtFBq8XbPCLMtE06fRWeF2mSjpyGwZkFO/73H4nB3BbwUaSvwS9g= Received: from MWHPR11MB1952.namprd11.prod.outlook.com (2603:10b6:300:111::11) by MWHPR11MB1327.namprd11.prod.outlook.com (2603:10b6:300:2a::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2937.22; Mon, 27 Apr 2020 09:53:47 +0000 Received: from MWHPR11MB1952.namprd11.prod.outlook.com ([fe80::b959:b216:62a1:f864]) by MWHPR11MB1952.namprd11.prod.outlook.com ([fe80::b959:b216:62a1:f864%7]) with mapi id 15.20.2937.023; Mon, 27 Apr 2020 09:53:47 +0000 From: "Power, Ciara" To: Stephen Hemminger CC: "dev@dpdk.org" , "Laatz, Kevin" , "Pattan, Reshma" , "jerinjacobk@gmail.com" , "david.marchand@redhat.com" , "Wiles, Keith" , "mb@smartsharesystems.com" , "thomas@monjalon.net" Thread-Topic: [dpdk-dev] [PATCH v4 02/18] telemetry: move code to metrics for later reuse Thread-Index: AQHWGjidI1I96UaIw0mhmhNzksbuJqiIZfWAgARX3LA= Date: Mon, 27 Apr 2020 09:53:47 +0000 Message-ID: References: <20200319171907.60891-1-ciara.power@intel.com> <20200424124159.45989-1-ciara.power@intel.com> <20200424124159.45989-3-ciara.power@intel.com> <20200424082953.4b52ab9e@hermes.lan> In-Reply-To: <20200424082953.4b52ab9e@hermes.lan> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.2.0.6 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: spf=none (sender IP is ) smtp.mailfrom=ciara.power@intel.com; x-originating-ip: [37.228.239.177] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 920bfc6b-8f25-4186-d307-08d7ea90e166 x-ms-traffictypediagnostic: MWHPR11MB1327: 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:1079; x-forefront-prvs: 0386B406AA x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MWHPR11MB1952.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(396003)(136003)(39860400002)(346002)(376002)(366004)(71200400001)(2906002)(6916009)(5660300002)(478600001)(33656002)(8676002)(86362001)(8936002)(81156014)(6506007)(66476007)(64756008)(26005)(186003)(55016002)(4326008)(9686003)(66446008)(52536014)(66556008)(66946007)(316002)(76116006)(7696005)(54906003); DIR:OUT; SFP:1102; x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: E0bNIqddpTpxBwOPUXzVkImJ73/vfu3EqOLlPoCMGvLuzOluqBBcicKpz0jhIAVpGSivaHIZboAl9Tf9wKch2IhrCSASqvvoKUP3eTfdkyxLqoxyJY+DJbGoQs0y4YooOZmlxCegx6SyPBweVHfSMzo0cfv9AzCuWmErZZc5ep5TiV5cYDeX46GLo5wCzmtxD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tvI+lg= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 920bfc6b-8f25-4186-d307-08d7ea90e166 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Apr 2020 09:53:47.2757 (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: aAwi5pRf13cuMn+0KIlOytDyjV6CkW+qZtlSlHjLnXOEImMFyCS/8gICNhICoXSCnOudFPb0x9SJkpHkuP5p9A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1327 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v4 02/18] telemetry: move code to metrics for later reuse X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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 Stephen, =20 Some of your comments are addressed in the next patch, which reduces this c= ode copied from the existing telemetry library.=20 Some others I will fix for v5. >From: Stephen Hemminger >Sent: Friday 24 April 2020 16:30 >To: Power, Ciara >Cc: dev@dpdk.org; Laatz, Kevin ; Pattan, Reshma >; jerinjacobk@gmail.com; >david.marchand@redhat.com; Wiles, Keith ; >mb@smartsharesystems.com; thomas@monjalon.net >Subject: Re: [dpdk-dev] [PATCH v4 02/18] telemetry: move code to metrics f= or >later reuse > >On Fri, 24 Apr 2020 13:41:43 +0100 >Ciara Power wrote: > >> This commit moves some of the telemetry library code to a new file in >> the metrics library. No modifications are made to the moved code, >> except what is needed to allow it to compile and run. The additional >> code in metrics is built only when the Jansson library is present. >> Telemetry functions as normal, using the functions from the >> metrics_telemetry file. This move will enable code be reused by the >> new version of telemetry in a later commit, to support backward >> compatibility with the existing telemetry usage. >> >> Signed-off-by: Ciara Power > > >Minor comments, none of these are show stoppers. >> +static int32_t >> +rte_metrics_tel_update_metrics_ethdev(uint16_t port_id, int >> +reg_start_index) { >> + int ret, num_xstats, i; >> + struct rte_eth_xstat *eth_xstats; >> + >> + if (!rte_eth_dev_is_valid_port(port_id)) { >> + METRICS_LOG_ERR("port_id: %d is invalid", port_id); >> + return -EINVAL; >> + } >> + >> + ret =3D rte_metrics_tel_is_port_active(port_id); >> + if (ret < 1) >> + return -EINVAL; >> + >> + num_xstats =3D rte_eth_xstats_get(port_id, NULL, 0); >> + if (num_xstats < 0) { >> + METRICS_LOG_ERR("rte_eth_xstats_get(%u) failed: %d", >port_id, >> + num_xstats); >> + return -EPERM; >> + } > >The number of metrics on a port should not change (as long as it has not b= een >hot plugged). So you could optimize by knowing number of stats from last >query. > Requerying is safer, this code is for backward compatibility and the existi= ng telemetry=20 requeries the number of stats each time. =20 Thanks, Ciara