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 3EBFCA0C4B; Thu, 14 Oct 2021 17:23:01 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C3B884112E; Thu, 14 Oct 2021 17:23:00 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 55BE540E50 for ; Thu, 14 Oct 2021 17:22:59 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19E89HNG018497 for ; Thu, 14 Oct 2021 08:22:58 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2168.outbound.protection.outlook.com [104.47.59.168]) by mx0a-0016f401.pphosted.com with ESMTP id 3bpgsra2gt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Oct 2021 08:22:58 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mAsTWyOFcX6maZEr61CNkAr04VxMyDX1fchKLhXdFn10Xjb/V8vPAKxh7RvA3DD50KBrFJcYKNhGqH7dpfyz37Yr6ZhHoYzfTWwrJ0MWkCCHYFHnmhu094J4Ezm2fGrtXilMUMRwg30hX+W/8yZKR5GXqC99MdUfDJnXceimR0kV2xZHItobddOrJ+9JhsV3ByS/JRB/NpVIdmiTXhtVfLbEdw7aLOA12+vYopBFol1EZznjMMdj3sWtmr/6t3WLmAcB1aJVoyHR+s24Wk9xXA35dFF8fQjafn7oVf7S1ZerMuznbxcJR6mYctQL5i/AgnCq9+elCVkr+9MFc8Cx/w== 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=OzxiuZfu3FZM80WISh0FVFzcrqkOkHcFS/mAnlgMxwU=; b=I5Ja5Tt+yjgJHTnRKeKlzyT0gbDMZjWSNW7NvufEl7NPowEbs4NKCCy4WkaJd/Rckzf+B19TkZ30EJamcklCpqJpIxwIw8+OzXnjDGEZ8/i2NgRg+00EKSKNCUGtcYlyHYWQNZIvz7s524tntSNpLo1/w2o8PgBtEf7D3Z3btdjSn6JLlNm3nsYlSGNf1O1ZXCgCI8GyGAjhjRMqAizOaIEXFygMXlUanZlXGHAnLyxF4u2CFFHobR0b8RDOHrPHJff3L9eqVR2Jd41RNSitpouzawoENVDIXahTqs4BCXS4iIMbPixE+FVbXMVo/oITBeJhXwB2ifadywO0LNt9Dg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=marvell.com; dmarc=pass action=none header.from=marvell.com; dkim=pass header.d=marvell.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector1-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=OzxiuZfu3FZM80WISh0FVFzcrqkOkHcFS/mAnlgMxwU=; b=lseqCqU5hEAEffnDpDY40ljzKEhCKP17n2OHVLPE00QinNtjwEN5lvZY4PjY8mstI8RKDP89+Tarriq42nOl+aAbfYFT439kDZIi542R+WRRG2e6bc5VJtGLo7Wp++tFyHuY12g/kavhu5W7LPwesew+CsD/IvhHdBM483+ib7I= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN9PR18MB4203.namprd18.prod.outlook.com (2603:10b6:408:118::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.15; Thu, 14 Oct 2021 15:22:56 +0000 Received: from BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1]) by BN9PR18MB4204.namprd18.prod.outlook.com ([fe80::29f4:8e3d:264f:26b1%8]) with mapi id 15.20.4608.016; Thu, 14 Oct 2021 15:22:56 +0000 From: Harman Kalra To: Gowrishankar Muthukrishnan , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Kiran Kumar Kokkilagadda , Nithin Kumar Dabilpuram , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Ashwin Sekhar Thalakalath Kottilveetil , Pavan Nikhilesh Bhagavatula , Gowrishankar Muthukrishnan Thread-Topic: [EXT] [dpdk-dev] [v9 1/4] common/cnxk: add telemetry endpoints to npa Thread-Index: AQHXtP76/dD6HO+hI0KqkO+/OSkj56vSpnZg Date: Thu, 14 Oct 2021 15:22:56 +0000 Message-ID: References: <5d1c668f5a7cc941c12f4ec377dfce0fee2be548.1632896495.git.gmuthukrishn@marvell.com> In-Reply-To: <5d1c668f5a7cc941c12f4ec377dfce0fee2be548.1632896495.git.gmuthukrishn@marvell.com> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f25a534a-4865-4267-4508-08d98f267fd4 x-ms-traffictypediagnostic: BN9PR18MB4203: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7219; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1V0ZmVOyIuCYUeNuK102YQwRu/tSg/ny2a3TwllF09v03PBrUnLHxvd2UqQq7OwBZhxRKcY/Wom2GbKPlad61frq1FC0IFN9uoIb9ZY19fMmpgNmTGATITIcpEVCJb4O2IZ+8YgDkvpQC7boPGU8x56Qn3D4xW/EEgMNWeAsOPJhzoUFoQWOhv//DhjzdcvGC2Jo8zpXHhMUJBlmVdA0E+uge4AM3yilQhWS+rAzVfGTm6RkoMTN53ZkPBiM94MYoTGNJgpJghdD8keP9B/3p3RsoaSSCkMmR9ZIX7D3g5+8yq/fQOyC+S5IoYi/HQDCK5WLPJxXvegn8GjrVLreLG7zzFlAtrzVVb0tBx904RFwqGWmdFBEM69j85O42C94UqNETGgZAFPahUJouFGtTYQZ7vzuElptXPw1XVNzkh/zq2+Pq5q4WkAVo1SmwHX0NXjLH43+vfK6Tu9gDgHRUqPlBDZ9A5pJxfAYLQSda6SejR9Jz7LgoJHABM1/8XJeAxdf6eXWU87JS5q+TbLpuzhNgBEimojhT59TJ10j6IE6dChLoztiGeMmMfopRLdczRbrwJb43R/PZ6lzl/0vUGj6wRS8ohWmp3HdvikYRhcYoHBpKAAmcKD+VKUjTj12zOUPR4TR8mPnxnACTwujjKnXTgQUkWgEQ7vSmvCYAmb3fraqHjNZOohrj8fBfb+fKv1D3MKIaaEBl6qf8oSbuA== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:BN9PR18MB4204.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(71200400001)(64756008)(33656002)(86362001)(122000001)(5660300002)(38100700002)(66446008)(54906003)(7696005)(6506007)(4326008)(66556008)(8936002)(52536014)(83380400001)(38070700005)(53546011)(2906002)(66476007)(9686003)(55016002)(316002)(26005)(66946007)(186003)(110136005)(107886003)(76116006)(508600001)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?J1AcDsWAz2Xyyimi0VjYOkpE3ak1Dzp+mU556v162DF92tJm8xBc0ux71O1S?= =?us-ascii?Q?hGlhJ4XGsRvbDVk7XuMTNplOhReVjbV6OKACBvoVhvo9rIC36DJ5pG6Luwq5?= =?us-ascii?Q?MIu7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rjDz5YAU?= =?us-ascii?Q?Q29PLKKtXaO8dyFOEugL69j083IWL/rbkcvEp1f6WAZZbdLIIX0lADJdNi71?= =?us-ascii?Q?CWfg8fsrekBUwIq4Ar6tn4yJeeXt/m84lT0WoIPRFNUjtbVy2SCOB8dZwHIk?= =?us-ascii?Q?JBMyNXB1dNbKLeTVOFNAIcj4mjOkEF1yUyzmA1xEZrSDmyMdsqFl3wDso9VU?= =?us-ascii?Q?w/+Y4gN6LmZVR8w4V6zj5/RGdzvh7vUrrEDf7VwczLOSDnicDcBLyJC5Whoi?= =?us-ascii?Q?qV2pDPpCiYUS7uUMgk6QxHSgqRc91MvyrNkTt7nDG67yoSUMt1bCsJUGYIFF?= =?us-ascii?Q?2WujZIJcRLfNGSv/KwtWp/Mf?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: marvell.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR18MB4204.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f25a534a-4865-4267-4508-08d98f267fd4 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2021 15:22:56.4209 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: tUj+071GnxO4yAVN7LILsAe24mMU24dZ3Ya1mqlu+X3tpaBo1//P5RkU8NNx10eaxycpVB7ZYi0ptqx7NbZBoA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN9PR18MB4203 X-Proofpoint-GUID: wcWWggbv8bXxBV3wM4b_gNuTZ8PicefC X-Proofpoint-ORIG-GUID: wcWWggbv8bXxBV3wM4b_gNuTZ8PicefC X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-10-14_08,2021-10-14_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [v9 1/4] common/cnxk: add telemetry endpoints to npa 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 Gowrishankar, Some comments inline. > -----Original Message----- > From: dev On Behalf Of Gowrishankar > Muthukrishnan > Sent: Wednesday, September 29, 2021 12:25 PM > To: dev@dpdk.org > Cc: Jerin Jacob Kollanukkaran ; Kiran Kumar > Kokkilagadda ; Nithin Kumar Dabilpuram > ; Sunil Kumar Kori ; Satha > Koteswara Rao Kottidi ; Ashwin Sekhar > Thalakalath Kottilveetil ; Pavan Nikhilesh > Bhagavatula ; Gowrishankar Muthukrishnan > > Subject: [EXT] [dpdk-dev] [v9 1/4] common/cnxk: add telemetry endpoints t= o > npa >=20 > External Email >=20 > ---------------------------------------------------------------------- > Add telemetry endpoints to npa. >=20 > Signed-off-by: Gowrishankar Muthukrishnan > --- > drivers/common/cnxk/cnxk_telemetry.h | 26 +++ > drivers/common/cnxk/cnxk_telemetry_npa.c | 224 > +++++++++++++++++++++++ > drivers/common/cnxk/meson.build | 6 +- > drivers/common/cnxk/roc_platform.h | 12 ++ > 4 files changed, 266 insertions(+), 2 deletions(-) create mode 100644 > drivers/common/cnxk/cnxk_telemetry.h > create mode 100644 drivers/common/cnxk/cnxk_telemetry_npa.c >=20 [...] > +static int > +cnxk_tel_npa(struct plt_tel_data *d) > +{ > + struct npa_lf *lf; > + int aura_cnt =3D 0; > + uint32_t i; > + > + lf =3D idev_npa_obj_get(); > + if (lf =3D=3D NULL) > + return NPA_ERR_DEVICE_NOT_BOUNDED; > + > + for (i =3D 0; i < lf->nr_pools; i++) { > + if (plt_bitmap_get(lf->npa_bmp, i)) > + continue; > + aura_cnt++; > + } > + > + plt_tel_data_add_dict_ptr(d, "npa", lf); > + plt_tel_data_add_dict_int(d, "pf", dev_get_pf(lf->pf_func)); > + plt_tel_data_add_dict_int(d, "vf", dev_get_vf(lf->pf_func)); > + plt_tel_data_add_dict_int(d, "aura_cnt", aura_cnt); > + > + CNXK_TEL_DICT_PTR(d, lf, pci_dev); Can we print PCI BDF string in place of its handle. > + CNXK_TEL_DICT_PTR(d, lf, npa_bmp); > + CNXK_TEL_DICT_PTR(d, lf, npa_bmp_mem); > + CNXK_TEL_DICT_PTR(d, lf, npa_qint_mem); > + CNXK_TEL_DICT_PTR(d, lf, intr_handle); Handles can be avoided, just a suggestion no strong objection against it. > + CNXK_TEL_DICT_PTR(d, lf, mbox); > + CNXK_TEL_DICT_PTR(d, lf, base); > + CNXK_TEL_DICT_INT(d, lf, stack_pg_ptrs); > + CNXK_TEL_DICT_INT(d, lf, stack_pg_bytes); > + CNXK_TEL_DICT_INT(d, lf, npa_msixoff); > + CNXK_TEL_DICT_INT(d, lf, nr_pools); > + CNXK_TEL_DICT_INT(d, lf, pf_func); > + CNXK_TEL_DICT_INT(d, lf, aura_sz); > + CNXK_TEL_DICT_INT(d, lf, qints); > + > + return 0; > + [...] > +static int > +cnxk_npa_tel_handle_info(const char *cmd __plt_unused, > + const char *params __plt_unused, > + struct plt_tel_data *d) > +{ > + plt_tel_data_start_dict(d); > + return cnxk_tel_npa(d); > +} > + > +static int > +cnxk_npa_tel_handle_info_x(const char *cmd, const char *params, > + struct plt_tel_data *d) > +{ > + int id, rc; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) > + return -1; > + > + id =3D atoi(params); Please avoid using atoi as it obsolete. atoi() function is subsumed by strt= ol(), problem with atoi is it does not perform any error checking. > + plt_tel_data_start_dict(d); > + > + if (strstr(cmd, "aura/info")) > + rc =3D cnxk_tel_npa_aura(id, d); > + else > + rc =3D cnxk_tel_npa_pool(id, d); > + > + return rc; > +} > + > +PLT_INIT(cnxk_telemetry_npa_init) > +{ > + plt_telemetry_register_cmd( > + "/cnxk/npa/info", cnxk_npa_tel_handle_info, > + "Returns npa information. Takes no parameters"); > + > + plt_telemetry_register_cmd( > + "/cnxk/npa/aura/info", cnxk_npa_tel_handle_info_x, > + "Returns npa aura information. Parameters: aura_id"); Can we also add a list command "/cnxk/npa/aura/list" something similar to "/ethdev/list" so its easy to know for what all aura ids "/cnxk/npa/aura/i= nfo" can be used. > + > + plt_telemetry_register_cmd( > + "/cnxk/npa/pool/info", cnxk_npa_tel_handle_info_x, Same, pool/list if possible. > + "Returns npa pool information. Parameters: pool_id"); } > diff --git a/drivers/common/cnxk/meson.build Thanks Harman