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 A383CA0C4B; Thu, 14 Oct 2021 18:37:11 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 43B2B40041; Thu, 14 Oct 2021 18:37:11 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 58C804003C for ; Thu, 14 Oct 2021 18:37:09 +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 19E89Hg7018500 for ; Thu, 14 Oct 2021 09:37:08 -0700 Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by mx0a-0016f401.pphosted.com with ESMTP id 3bpgsraenk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Oct 2021 09:37:08 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=i7oIfwn+cLIQs8HsQ5CvfMIoGY8taZB/p3FZyWhuXGde9krF9e0vCyF4UQZeL/n/bywvznj/5YnmizLEWndVxFGIAjI0JM2gbAjti9NzSvFOafxN5SZPvCFqnyx2hZ2kmRFeNpEsZS8M64vK4kGC6nU0Z08ZdnuZIq0ANuBpXnBFfEqeD6XzMzPCe7FpVVLwOpmzmDpwMOkbvDMpgs0rA57QUFSNY4/Hu27qGahVrkFnY9EC0u+Te0xt05PmBcTFku8k2hl25PEp++n3K2g4mdkUqs1jG+Z11aDZWZ3yJ0EDqnjamyOfTDt91Vfws5mTlzWHqKwePKHB0giG4eOc7g== 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=8QNAWZaiNSFdeURnGGoWFuL+7L1Q2HCPuVoyUm0UI4s=; b=nPmh7tQuJXiqqg0cYrNIvkWNnmj9VENK4Gg3y2vWCWtqLhk2QGdyvF79z7pk3HoA5XVFHve3RAZ4+piBDulT8/TmSE6OgYxnx8yhSN/JMkufMZmrQxHLumJmMr9aCxWWoXhmdrMzUN3RSh1OiZcgMt2FwyVjQTjhJNEC/iuAbVkHe8P7QyS8gw9aE2iTFufNGMU7UCQZxw8TvuzTBUuogZbZ0ZOyvhcViiFKEpl7YKKlh4eV7PlqKl5nixi7/WYrmb8vfqV08gzfUKpZRg/5KW2B+nsiY0s6gqrxMFqKp+iB5BbtH6tUqIjVlVq9FcUlrkX9G22C/KwA7+zorHODGQ== 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=8QNAWZaiNSFdeURnGGoWFuL+7L1Q2HCPuVoyUm0UI4s=; b=hOkHUcD7fuP4NZWvO/TcuaXPpoTF6zpMlXn36Pv31ympLvOll2pUArOneNNmhMdPfillHnbc3sOh2xRl1peL6cnPlogg/07Sk8/6n5jJ3K4MjkCRGJ/cgYnxvP3Iagk1FCf+9D1MtEzQXUEAAJU2mhhZvN2KWWP0vo7e/H4uFQs= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN6PR18MB1458.namprd18.prod.outlook.com (2603:10b6:404:f1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Thu, 14 Oct 2021 16:37:05 +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 16:37:05 +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 2/4] common/cnxk: add telemetry endpoints to nix Thread-Index: AQHXtP7+0mJcCUz81UOszLxISO4Q3qvSyMtw Date: Thu, 14 Oct 2021 16:37:05 +0000 Message-ID: References: <6fb65d36ad31999c2d46fcc84e380402d131303e.1632896495.git.gmuthukrishn@marvell.com> In-Reply-To: <6fb65d36ad31999c2d46fcc84e380402d131303e.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: 3023e22b-42ca-4f14-a96b-08d98f30dba9 x-ms-traffictypediagnostic: BN6PR18MB1458: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:88; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: DOJ49U/QO4K9QfI8jlcIFZw/JL1n7RuhRK7Mt7TRxHO/Jswnfw6HgmnR/GF4SY0th+jB+16lP/PV4CY7EnDc83lMlCuhlPTrCW0JjSn7cxmTwzkLNHUcwkUcZvwy/IU09SERt8LuKjL+ZB+DR2NKYPVZuB2eSnMEd0R7RtZlHnLBY8Y99tGiKiSXzx3D4ha1EJmglH1VIsCYWKujxHTETEKfYPXegsTmU3wbmp4DOhmg4mnCGumGTdYnknyTSRRhPn5OElnrbE0Pj3Fxsr9PDeVxanmZeMop+S62jb1k1+6XWMD8NNDx8vvJiC62LX2OT8MP42CrAbgsYBilKFjdl2PPFuanegCTMeKq1NQYoQzdYUR+fhLGZBRL0eIgmMIv1Tqe/kbp8lq1J3Ab13IL8xnWMMO6NoXrX3KvxXg4be+cy75LMhUYfppTF4+l0UfG+FzSb9gAdNgQfBct0/LFkuVWZ7hRtx/+mVPsAqJEw5GKMNzKiIg1xukA6wCaw4JyuwaotTLBZ3A6b1iE7S+ULlhDrSEiOL1AuQWXDZm9ds0lNeiq4KU42pt+2igwsraiuoV0pjJOr7ZaIjtibNgRrNQVJfrqehMSqOkAVpoiBfNkrOpH8A1cE/N9eViDT13cN6GnIDnah1v2IctU+Q55d59QySUeqtYjpVp34DWf1qw3Y5IeJPumGLi4o2l2s4FkaOuFBt7rZj/O/Up6xbj5zQ== 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)(83380400001)(508600001)(4326008)(33656002)(54906003)(110136005)(316002)(8676002)(5660300002)(38070700005)(6506007)(26005)(107886003)(76116006)(71200400001)(86362001)(53546011)(8936002)(9686003)(64756008)(66556008)(66446008)(66476007)(55016002)(66946007)(122000001)(186003)(52536014)(30864003)(7696005)(2906002)(38100700002)(579004)(559001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?4L8tg/dWAPoU2MThLW/rUB2HICG5Bpbrv9e8MutnlWpKVRD4GPlEkJ4Y8vWD?= =?us-ascii?Q?tmGSlPwzcKIB5bq/Y8aMb4NtKMCfHKkKB7Inzt5p/2d+kM9BteQ+OV1taWuZ?= =?us-ascii?Q?i+ETKr6s6qhcEXcUrrmHIWtv0aAKTx6X5txerYiLoLXoGTbbVBkYYDUsT/Ga?= =?us-ascii?Q?IUg5M6ZO1R4YPIIgyXkEt6bLSUjosa948FGcFYPQ/bOMqSkJm/I5Dwf4Zqo6?= =?us-ascii?Q?ekjBOGo7xU77V0ndnw+EYCjjNFNl8hg97HDCHXmdGdvAplbQwLXb2MSWqO9o?= =?us-ascii?Q?IwqkMjk51HIT2m8O/U+lbQAVV5DoRdWJWts62QqKGrGdLCvOSyZ+TIbwAK4j?= =?us-ascii?Q?mjGGqpeTv264LO/TIPcmeUCblq6oPpD1+RYT3vtP/HipdWtbU71r8MeWKt2C?= =?us-ascii?Q?G2eUVlMvCNs2hp4HWrzRHjgd2d7+MvAS+vsU1tXVRGInrudCCcLayK6QsqPP?= =?us-ascii?Q?uTScmTpfuVE25aZ4Cf6TJ2Fwq6D8NbFYX1d0cEYXthgKy/AUapj1h4zRiY0d?= =?us-ascii?Q?DGKzIMZKcCv8a6fionK0W3E3O8EaHh6Ls0cR3pMEVTFLx11wP+K1CNRmkQv4?= =?us-ascii?Q?th8p3RB3f9h+KKX9MYWgSA+427HZGBoozLVZsQIYe89G345GPLE/616QUy12?= =?us-ascii?Q?5AmGFeHKmeY0BnGksyTgPhfYCCMqJn7CnGrGr1JYPw3CpE7+F1Sx1cnuoAIV?= =?us-ascii?Q?lll3Khl4WyQYvV3NuYNCAGKxE3w6jWA3F0O9KPf5SdM96eLv21o0ievR2auW?= =?us-ascii?Q?hWK/OcteNcAW2hCkId5SGjVSqHXEhm79IzYbCetZrIlNK0CBB4+/4Bg/BfQJ?= =?us-ascii?Q?LhJeX+eqKwXkkl5OQzb3Bf0wxhj6+y8vHxgUFsX+mrEwo23eoeqb8g0wM45o?= =?us-ascii?Q?LPnr6H2jYOe8dP6rO+cQymifrzcc2m1splZtHUeMnyCVsnImPnf8KnMD28ki?= =?us-ascii?Q?2tOhrUhige+Eag5rVcob89bhM9+tX836dCkhgCXv8PX8cS11zQmfEkl6lAOY?= =?us-ascii?Q?xOZ6xtTIfMV7FTICQyyRsl79T+iT7laYf+5J6uWfSGPGZ3OSUfjdcNNghoe0?= =?us-ascii?Q?9rCatVKD3IVsJTBpTg3S89mV6cwSwTWxgZZu4RQ11jBARu17eYfUWoGjz1dO?= =?us-ascii?Q?VuVZooi4CH8a2TySQMQSMrKvTBFyfuajxQ87/AduqDtNhlSQ7bVepMi5EdkF?= =?us-ascii?Q?3EPrmMNtUUWOnVNwpRbW4Vungf7KQZpe4xmr+k0ReZyuXwqXbiEfs4grpQ6t?= =?us-ascii?Q?RN8E4lp/lou/eThQOsVFiEYniXyZUQpsOKOJWx4R7paAmmgq7VIWSw6PJzOi?= =?us-ascii?Q?ws67BNoeBn5HCrbNSoQbs6pd?= 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: 3023e22b-42ca-4f14-a96b-08d98f30dba9 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2021 16:37:05.5101 (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: 7gET4fNAkMJen41HsriNsRyRSVhb4VZDevwKKxAtbyRmHQnWZ9XcZbutotMB8GB45bkO64/JMzGLgz6JxdZLng== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR18MB1458 X-Proofpoint-GUID: pWLohD6wrERvkfi_kp4F4hPKLmSMvOaF X-Proofpoint-ORIG-GUID: pWLohD6wrERvkfi_kp4F4hPKLmSMvOaF 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_09,2021-10-14_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [v9 2/4] common/cnxk: add telemetry endpoints to nix 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" > -----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 2/4] common/cnxk: add telemetry endpoints t= o > nix >=20 > External Email >=20 > ---------------------------------------------------------------------- > Add telemetry endpoints to nix. >=20 > Signed-off-by: Gowrishankar Muthukrishnan Patch looks good to me. Reviewed-by: Harman Kalra Thanks Harman > --- > drivers/common/cnxk/cnxk_telemetry_nix.c | 849 > +++++++++++++++++++++++ > drivers/common/cnxk/meson.build | 3 +- > drivers/common/cnxk/roc_nix.c | 3 + > drivers/common/cnxk/roc_nix_priv.h | 9 + > drivers/common/cnxk/roc_nix_queue.c | 15 +- > drivers/common/cnxk/roc_platform.h | 3 + > 6 files changed, 878 insertions(+), 4 deletions(-) create mode 100644 > drivers/common/cnxk/cnxk_telemetry_nix.c >=20 > diff --git a/drivers/common/cnxk/cnxk_telemetry_nix.c > b/drivers/common/cnxk/cnxk_telemetry_nix.c > new file mode 100644 > index 0000000000..1175f68a51 > --- /dev/null > +++ b/drivers/common/cnxk/cnxk_telemetry_nix.c > @@ -0,0 +1,849 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell. > + */ > + > +#include "cnxk_telemetry.h" > +#include "roc_api.h" > +#include "roc_priv.h" > + > +struct nix_tel_node { > + TAILQ_ENTRY(nix_tel_node) node; > + struct roc_nix *nix; > + uint16_t n_rq; > + uint16_t n_cq; > + uint16_t n_sq; > + struct roc_nix_rq **rqs; > + struct roc_nix_cq **cqs; > + struct roc_nix_sq **sqs; > +}; > + > +TAILQ_HEAD(nix_tel_node_list, nix_tel_node); static struct > +nix_tel_node_list nix_list; > + > +static struct nix_tel_node * > +nix_tel_node_get(struct roc_nix *roc_nix) { > + struct nix_tel_node *node, *roc_node =3D NULL; > + > + TAILQ_FOREACH(node, &nix_list, node) { > + if (node->nix =3D=3D roc_nix) { > + roc_node =3D node; > + break; > + } > + } > + > + return roc_node; > +} > + > +int > +nix_tel_node_add(struct roc_nix *roc_nix) { > + struct nix *nix =3D roc_nix_to_nix_priv(roc_nix); > + struct nix_tel_node *node; > + > + node =3D nix_tel_node_get(roc_nix); > + if (node) { > + if (nix->nb_rx_queues =3D=3D node->n_rq && > + nix->nb_tx_queues =3D=3D node->n_sq) > + return 0; > + > + nix_tel_node_del(roc_nix); > + } > + > + node =3D plt_zmalloc(sizeof(struct nix_tel_node), 0); > + if (!node) > + return -1; > + > + node->nix =3D roc_nix; > + node->rqs =3D > + plt_zmalloc(nix->nb_rx_queues * sizeof(struct roc_nix_rq *), > 0); > + node->cqs =3D > + plt_zmalloc(nix->nb_rx_queues * sizeof(struct roc_nix_cq *), > 0); > + node->sqs =3D > + plt_zmalloc(nix->nb_tx_queues * sizeof(struct roc_nix_sq *), > 0); > + TAILQ_INSERT_TAIL(&nix_list, node, node); > + > + return 0; > +} > + > +void > +nix_tel_node_del(struct roc_nix *roc_nix) { > + struct nix_tel_node *node; > + > + TAILQ_FOREACH(node, &nix_list, node) { > + if (node->nix =3D=3D roc_nix) { > + plt_free(node->rqs); > + plt_free(node->cqs); > + plt_free(node->sqs); > + TAILQ_REMOVE(&nix_list, node, node); > + } > + } > + > + plt_free(node); > +} > + > +static struct nix_tel_node * > +nix_tel_node_get_by_pcidev_name(const char *name) { > + struct nix_tel_node *node, *roc_node =3D NULL; > + > + TAILQ_FOREACH(node, &nix_list, node) { > + if (!strncmp(node->nix->pci_dev->name, name, > + PCI_PRI_STR_SIZE)) { > + roc_node =3D node; > + break; > + } > + } > + > + return roc_node; > +} > + > +int > +nix_tel_node_add_rq(struct roc_nix_rq *rq) { > + struct nix_tel_node *node; > + > + node =3D nix_tel_node_get(rq->roc_nix); > + if (!node) > + return -1; > + > + node->rqs[rq->qid] =3D rq; > + node->n_rq++; > + return 0; > +} > + > +int > +nix_tel_node_add_cq(struct roc_nix_cq *cq) { > + struct nix_tel_node *node; > + > + node =3D nix_tel_node_get(cq->roc_nix); > + if (!node) > + return -1; > + > + node->cqs[cq->qid] =3D cq; > + node->n_cq++; > + return 0; > +} > + > +int > +nix_tel_node_add_sq(struct roc_nix_sq *sq) { > + struct nix_tel_node *node; > + > + node =3D nix_tel_node_get(sq->roc_nix); > + if (!node) > + return -1; > + > + node->sqs[sq->qid] =3D sq; > + node->n_sq++; > + return 0; > +} > + > +static int > +cnxk_tel_nix(struct roc_nix *roc_nix, struct plt_tel_data *d) { > + struct nix *nix =3D roc_nix_to_nix_priv(roc_nix); > + > + struct dev *dev =3D &nix->dev; > + > + plt_tel_data_add_dict_ptr(d, "nix", nix); > + plt_tel_data_add_dict_int(d, "pf_func", dev->pf_func); > + plt_tel_data_add_dict_int(d, "pf", dev_get_pf(dev->pf_func)); > + plt_tel_data_add_dict_int(d, "vf", dev_get_vf(dev->pf_func)); > + > + CNXK_TEL_DICT_PTR(d, dev, bar2); > + CNXK_TEL_DICT_PTR(d, dev, bar4); > + CNXK_TEL_DICT_INT(d, roc_nix, port_id); > + CNXK_TEL_DICT_INT(d, roc_nix, rss_tag_as_xor); > + CNXK_TEL_DICT_INT(d, roc_nix, max_sqb_count); > + CNXK_TEL_DICT_PTR(d, nix, pci_dev); > + CNXK_TEL_DICT_PTR(d, nix, base); > + CNXK_TEL_DICT_PTR(d, nix, lmt_base); > + CNXK_TEL_DICT_INT(d, nix, reta_sz); > + CNXK_TEL_DICT_INT(d, nix, tx_chan_base); > + CNXK_TEL_DICT_INT(d, nix, rx_chan_base); > + CNXK_TEL_DICT_INT(d, nix, nb_tx_queues); > + CNXK_TEL_DICT_INT(d, nix, nb_rx_queues); > + CNXK_TEL_DICT_INT(d, nix, lso_tsov6_idx); > + CNXK_TEL_DICT_INT(d, nix, lso_tsov4_idx); > + > + plt_tel_data_add_dict_int(d, "lso_udp_tun_v4v4", > + nix- > >lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V4]); > + plt_tel_data_add_dict_int(d, "lso_udp_tun_v4v6", > + nix- > >lso_udp_tun_idx[ROC_NIX_LSO_TUN_V4V6]); > + plt_tel_data_add_dict_int(d, "lso_udp_tun_v6v4", > + nix- > >lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V4]); > + plt_tel_data_add_dict_int(d, "lso_udp_tun_v6v6", > + nix- > >lso_udp_tun_idx[ROC_NIX_LSO_TUN_V6V6]); > + plt_tel_data_add_dict_int(d, "lso_tun_v4v4", > + nix- > >lso_tun_idx[ROC_NIX_LSO_TUN_V4V4]); > + plt_tel_data_add_dict_int(d, "lso_tun_v4v6", > + nix- > >lso_tun_idx[ROC_NIX_LSO_TUN_V4V6]); > + plt_tel_data_add_dict_int(d, "lso_tun_v6v4", > + nix- > >lso_tun_idx[ROC_NIX_LSO_TUN_V6V4]); > + plt_tel_data_add_dict_int(d, "lso_tun_v6v6", > + nix- > >lso_tun_idx[ROC_NIX_LSO_TUN_V6V6]); > + > + CNXK_TEL_DICT_INT(d, nix, lf_tx_stats); > + CNXK_TEL_DICT_INT(d, nix, lf_rx_stats); > + CNXK_TEL_DICT_INT(d, nix, cgx_links); > + CNXK_TEL_DICT_INT(d, nix, lbk_links); > + CNXK_TEL_DICT_INT(d, nix, sdp_links); > + CNXK_TEL_DICT_INT(d, nix, tx_link); > + CNXK_TEL_DICT_INT(d, nix, sqb_size); > + CNXK_TEL_DICT_INT(d, nix, msixoff); > + CNXK_TEL_DICT_INT(d, nix, cints); > + CNXK_TEL_DICT_INT(d, nix, qints); > + CNXK_TEL_DICT_INT(d, nix, sdp_link); > + CNXK_TEL_DICT_INT(d, nix, ptp_en); > + CNXK_TEL_DICT_INT(d, nix, rss_alg_idx); > + CNXK_TEL_DICT_INT(d, nix, tx_pause); > + > + return 0; > +} > + > +static int > +cnxk_tel_nix_rq(struct roc_nix_rq *rq, struct plt_tel_data *d) { > + plt_tel_data_add_dict_ptr(d, "nix_rq", rq); > + CNXK_TEL_DICT_INT(d, rq, qid); > + CNXK_TEL_DICT_PTR(d, rq, aura_handle); > + CNXK_TEL_DICT_INT(d, rq, ipsech_ena); > + CNXK_TEL_DICT_INT(d, rq, first_skip); > + CNXK_TEL_DICT_INT(d, rq, later_skip); > + CNXK_TEL_DICT_INT(d, rq, lpb_size); > + CNXK_TEL_DICT_INT(d, rq, sso_ena); > + CNXK_TEL_DICT_INT(d, rq, tag_mask); > + CNXK_TEL_DICT_INT(d, rq, flow_tag_width); > + CNXK_TEL_DICT_INT(d, rq, tt); > + CNXK_TEL_DICT_INT(d, rq, hwgrp); > + CNXK_TEL_DICT_INT(d, rq, vwqe_ena); > + CNXK_TEL_DICT_INT(d, rq, vwqe_first_skip); > + CNXK_TEL_DICT_INT(d, rq, vwqe_max_sz_exp); > + CNXK_TEL_DICT_INT(d, rq, vwqe_wait_tmo); > + CNXK_TEL_DICT_INT(d, rq, vwqe_aura_handle); > + CNXK_TEL_DICT_PTR(d, rq, roc_nix); > + > + return 0; > +} > + > +static int > +cnxk_tel_nix_cq(struct roc_nix_cq *cq, struct plt_tel_data *d) { > + plt_tel_data_add_dict_ptr(d, "nix_cq", cq); > + CNXK_TEL_DICT_INT(d, cq, qid); > + CNXK_TEL_DICT_INT(d, cq, nb_desc); > + CNXK_TEL_DICT_PTR(d, cq, roc_nix); > + CNXK_TEL_DICT_PTR(d, cq, door); > + CNXK_TEL_DICT_PTR(d, cq, status); > + CNXK_TEL_DICT_PTR(d, cq, wdata); > + CNXK_TEL_DICT_PTR(d, cq, desc_base); > + CNXK_TEL_DICT_INT(d, cq, qmask); > + > + return 0; > +} > + > +static int > +cnxk_tel_nix_sq(struct roc_nix_sq *sq, struct plt_tel_data *d) { > + plt_tel_data_add_dict_ptr(d, "nix_sq", sq); > + CNXK_TEL_DICT_INT(d, sq, qid); > + CNXK_TEL_DICT_INT(d, sq, max_sqe_sz); > + CNXK_TEL_DICT_INT(d, sq, nb_desc); > + CNXK_TEL_DICT_INT(d, sq, sqes_per_sqb_log2); > + CNXK_TEL_DICT_PTR(d, sq, roc_nix); > + CNXK_TEL_DICT_PTR(d, sq, aura_handle); > + CNXK_TEL_DICT_INT(d, sq, nb_sqb_bufs_adj); > + CNXK_TEL_DICT_INT(d, sq, nb_sqb_bufs); > + CNXK_TEL_DICT_PTR(d, sq, io_addr); > + CNXK_TEL_DICT_PTR(d, sq, lmt_addr); > + CNXK_TEL_DICT_PTR(d, sq, sqe_mem); > + CNXK_TEL_DICT_PTR(d, sq, fc); > + > + return 0; > +} > + > +static void > +nix_rq_ctx_cn9k(void *qctx, struct plt_tel_data *d) { > + struct nix_rq_ctx_s *ctx =3D (struct nix_rq_ctx_s *)qctx; > + > + /* W0 */ > + CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); > + CNXK_TEL_DICT_BF_PTR(d, ctx, substream, w0_); > + CNXK_TEL_DICT_INT(d, ctx, cq, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ena_wqwd, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ipsech_ena, w0_); > + CNXK_TEL_DICT_INT(d, ctx, sso_ena, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ena, w0_); > + > + /* W1 */ > + CNXK_TEL_DICT_INT(d, ctx, lpb_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, spb_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_caching, w1_); > + CNXK_TEL_DICT_INT(d, ctx, pb_caching, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_tt, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_grp, w1_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura, w1_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura, w1_); > + > + /* W2 */ > + CNXK_TEL_DICT_INT(d, ctx, xqe_hdr_split, w2_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_imm_copy, w2_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_imm_size, w2_); > + CNXK_TEL_DICT_INT(d, ctx, later_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, first_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_sizem1, w2_); > + CNXK_TEL_DICT_INT(d, ctx, spb_ena, w2_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, spb_sizem1, w2_); > + > + /* W3 */ > + CNXK_TEL_DICT_INT(d, ctx, spb_pool_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_pool_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_pool_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_pool_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_drop, w3_); > + > + /* W4 */ > + CNXK_TEL_DICT_INT(d, ctx, qint_idx, w4_); > + CNXK_TEL_DICT_INT(d, ctx, rq_int_ena, w4_); > + CNXK_TEL_DICT_INT(d, ctx, rq_int, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_pool_pass, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_pool_drop, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura_pass, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura_drop, w4_); > + > + /* W5 */ > + CNXK_TEL_DICT_INT(d, ctx, flow_tagw, w5_); > + CNXK_TEL_DICT_INT(d, ctx, bad_utag, w5_); > + CNXK_TEL_DICT_INT(d, ctx, good_utag, w5_); > + CNXK_TEL_DICT_INT(d, ctx, ltag, w5_); > + > + /* W6 */ > + CNXK_TEL_DICT_U64(d, ctx, octs, w6_); > + > + /* W7 */ > + CNXK_TEL_DICT_U64(d, ctx, pkts, w7_); > + > + /* W8 */ > + CNXK_TEL_DICT_U64(d, ctx, drop_octs, w8_); > + > + /* W9 */ > + CNXK_TEL_DICT_U64(d, ctx, drop_pkts, w9_); > + > + /* W10 */ > + CNXK_TEL_DICT_U64(d, ctx, re_pkts, w10_); } > + > +static void > +nix_rq_ctx(void *qctx, struct plt_tel_data *d) { > + struct nix_cn10k_rq_ctx_s *ctx =3D (struct nix_cn10k_rq_ctx_s *)qctx; > + > + /* W0 */ > + CNXK_TEL_DICT_INT(d, ctx, wqe_aura, w0_); > + CNXK_TEL_DICT_INT(d, ctx, len_ol3_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, len_ol4_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, len_il3_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, len_il4_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, csum_ol4_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, lenerr_dis, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ena_wqwd, w0); > + CNXK_TEL_DICT_INT(d, ctx, ipsech_ena, w0); > + CNXK_TEL_DICT_INT(d, ctx, sso_ena, w0); > + CNXK_TEL_DICT_INT(d, ctx, ena, w0); > + > + /* W1 */ > + CNXK_TEL_DICT_INT(d, ctx, chi_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, ipsecd_drop_en, w1_); > + CNXK_TEL_DICT_INT(d, ctx, pb_stashing, w1_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, spb_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_drop_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_caching, w1_); > + CNXK_TEL_DICT_INT(d, ctx, pb_caching, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_tt, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_grp, w1_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura, w1_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura, w1_); > + > + /* W2 */ > + CNXK_TEL_DICT_INT(d, ctx, xqe_hdr_split, w2_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_imm_copy, w2_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_imm_size, w2_); > + CNXK_TEL_DICT_INT(d, ctx, later_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, first_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_sizem1, w2_); > + CNXK_TEL_DICT_INT(d, ctx, spb_ena, w2_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_skip, w2_); > + CNXK_TEL_DICT_INT(d, ctx, spb_sizem1, w2_); > + CNXK_TEL_DICT_INT(d, ctx, policer_ena, w2_); > + CNXK_TEL_DICT_INT(d, ctx, band_prof_id, w2_); > + > + /* W3 */ > + CNXK_TEL_DICT_INT(d, ctx, spb_pool_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_pool_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, spb_aura_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_pool_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, wqe_pool_drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_pass, w3_); > + CNXK_TEL_DICT_INT(d, ctx, xqe_drop, w3_); > + > + /* W4 */ > + CNXK_TEL_DICT_INT(d, ctx, qint_idx, w4_); > + CNXK_TEL_DICT_INT(d, ctx, rq_int_ena, w4_); > + CNXK_TEL_DICT_INT(d, ctx, rq_int, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_pool_pass, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_pool_drop, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura_pass, w4_); > + CNXK_TEL_DICT_INT(d, ctx, lpb_aura_drop, w4_); > + > + /* W5 */ > + CNXK_TEL_DICT_INT(d, ctx, vwqe_skip, w5_); > + CNXK_TEL_DICT_INT(d, ctx, max_vsize_exp, w5_); > + CNXK_TEL_DICT_INT(d, ctx, vtime_wait, w5_); > + CNXK_TEL_DICT_INT(d, ctx, vwqe_ena, w5_); > + CNXK_TEL_DICT_INT(d, ctx, ipsec_vwqe, w5_); > + CNXK_TEL_DICT_INT(d, ctx, flow_tagw, w5_); > + CNXK_TEL_DICT_INT(d, ctx, bad_utag, w5_); > + CNXK_TEL_DICT_INT(d, ctx, good_utag, w5_); > + CNXK_TEL_DICT_INT(d, ctx, ltag, w5_); > + > + /* W6 */ > + CNXK_TEL_DICT_U64(d, ctx, octs, w6_); > + > + /* W7 */ > + CNXK_TEL_DICT_U64(d, ctx, pkts, w7_); > + > + /* W8 */ > + CNXK_TEL_DICT_U64(d, ctx, drop_octs, w8_); > + > + /* W9 */ > + CNXK_TEL_DICT_U64(d, ctx, drop_pkts, w9_); > + > + /* W10 */ > + CNXK_TEL_DICT_U64(d, ctx, re_pkts, w10_); } > + > +static int > +cnxk_tel_nix_rq_ctx(struct roc_nix *roc_nix, uint8_t n, struct > +plt_tel_data *d) { > + struct nix *nix =3D roc_nix_to_nix_priv(roc_nix); > + struct dev *dev =3D &nix->dev; > + struct npa_lf *npa_lf; > + volatile void *qctx; > + int rc =3D -1; > + > + npa_lf =3D idev_npa_obj_get(); > + if (npa_lf =3D=3D NULL) > + return NPA_ERR_DEVICE_NOT_BOUNDED; > + > + rc =3D nix_q_ctx_get(dev, NIX_AQ_CTYPE_RQ, n, &qctx); > + if (rc) { > + plt_err("Failed to get rq context"); > + return rc; > + } > + > + if (roc_model_is_cn9k()) > + nix_rq_ctx_cn9k(&qctx, d); > + else > + nix_rq_ctx(&qctx, d); > + > + return 0; > +} > + > +static int > +cnxk_tel_nix_cq_ctx(struct roc_nix *roc_nix, uint8_t n, struct > +plt_tel_data *d) { > + struct nix *nix =3D roc_nix_to_nix_priv(roc_nix); > + struct dev *dev =3D &nix->dev; > + struct npa_lf *npa_lf; > + volatile struct nix_cq_ctx_s *ctx; > + int rc =3D -1; > + > + npa_lf =3D idev_npa_obj_get(); > + if (npa_lf =3D=3D NULL) > + return NPA_ERR_DEVICE_NOT_BOUNDED; > + > + rc =3D nix_q_ctx_get(dev, NIX_AQ_CTYPE_CQ, n, (void *)&ctx); > + if (rc) { > + plt_err("Failed to get cq context"); > + return rc; > + } > + > + /* W0 */ > + CNXK_TEL_DICT_PTR(d, ctx, base, w0_); > + > + /* W1 */ > + CNXK_TEL_DICT_U64(d, ctx, wrptr, w1_); > + CNXK_TEL_DICT_INT(d, ctx, avg_con, w1_); > + CNXK_TEL_DICT_INT(d, ctx, cint_idx, w1_); > + CNXK_TEL_DICT_INT(d, ctx, cq_err, w1_); > + CNXK_TEL_DICT_INT(d, ctx, qint_idx, w1_); > + CNXK_TEL_DICT_INT(d, ctx, bpid, w1_); > + CNXK_TEL_DICT_INT(d, ctx, bp_ena, w1_); > + > + /* W2 */ > + CNXK_TEL_DICT_INT(d, ctx, update_time, w2_); > + CNXK_TEL_DICT_INT(d, ctx, avg_level, w2_); > + CNXK_TEL_DICT_INT(d, ctx, head, w2_); > + CNXK_TEL_DICT_INT(d, ctx, tail, w2_); > + > + /* W3 */ > + CNXK_TEL_DICT_INT(d, ctx, cq_err_int_ena, w3_); > + CNXK_TEL_DICT_INT(d, ctx, cq_err_int, w3_); > + CNXK_TEL_DICT_INT(d, ctx, qsize, w3_); > + CNXK_TEL_DICT_INT(d, ctx, caching, w3_); > + CNXK_TEL_DICT_INT(d, ctx, substream, w3_); > + CNXK_TEL_DICT_INT(d, ctx, ena, w3_); > + CNXK_TEL_DICT_INT(d, ctx, drop_ena, w3_); > + CNXK_TEL_DICT_INT(d, ctx, drop, w3_); > + CNXK_TEL_DICT_INT(d, ctx, bp, w3_); > + > + return 0; > +} > + > +static void > +nix_sq_ctx_cn9k(void *qctx, struct plt_tel_data *d) { > + struct nix_sq_ctx_s *ctx =3D (struct nix_sq_ctx_s *)qctx; > + > + /* W0 */ > + CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); > + CNXK_TEL_DICT_INT(d, ctx, cq, w0_); > + CNXK_TEL_DICT_INT(d, ctx, sdp_mcast, w0_); > + CNXK_TEL_DICT_INT(d, ctx, substream, w0_); > + CNXK_TEL_DICT_INT(d, ctx, qint_idx, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ena, w0_); > + > + /* W1 */ > + CNXK_TEL_DICT_INT(d, ctx, sqb_count, w1_); > + CNXK_TEL_DICT_INT(d, ctx, default_chan, w1_); > + CNXK_TEL_DICT_INT(d, ctx, smq_rr_quantum, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, xoff, w1_); > + CNXK_TEL_DICT_INT(d, ctx, cq_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, smq, w1_); > + > + /* W2 */ > + CNXK_TEL_DICT_INT(d, ctx, sqe_stype, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sq_int_ena, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sq_int, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sqb_aura, w2_); > + CNXK_TEL_DICT_INT(d, ctx, smq_rr_count, w2_); > + > + /* W3 */ > + CNXK_TEL_DICT_INT(d, ctx, smq_next_sq_vld, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_pend, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smenq_next_sqb_vld, w3_); > + CNXK_TEL_DICT_INT(d, ctx, head_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smenq_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, tail_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_lso_segnum, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_next_sq, w3_); > + CNXK_TEL_DICT_INT(d, ctx, mnq_dis, w3_); > + CNXK_TEL_DICT_INT(d, ctx, lmt_dis, w3_); > + CNXK_TEL_DICT_INT(d, ctx, cq_limit, w3_); > + CNXK_TEL_DICT_INT(d, ctx, max_sqe_size, w3_); > + > + /* W4 */ > + CNXK_TEL_DICT_PTR(d, ctx, next_sqb, w4_); > + > + /* W5 */ > + CNXK_TEL_DICT_PTR(d, ctx, tail_sqb, w5_); > + > + /* W6 */ > + CNXK_TEL_DICT_PTR(d, ctx, smenq_sqb, w6_); > + > + /* W7 */ > + CNXK_TEL_DICT_PTR(d, ctx, smenq_next_sqb, w7_); > + > + /* W8 */ > + CNXK_TEL_DICT_PTR(d, ctx, head_sqb, w8_); > + > + /* W9 */ > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vld, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vlan1_ins_ena, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vlan0_ins_ena, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_mps, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_sb, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_sizem1, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_total, w9_); > + > + /* W10 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, scm_lso_rem, w10_); > + > + /* W11 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, octs, w11_); > + > + /* W12 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, pkts, w12_); > + > + /* W14 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, drop_octs, w14_); > + > + /* W15 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, drop_pkts, w15_); } > + > +static void > +nix_sq_ctx(void *qctx, struct plt_tel_data *d) { > + struct nix_cn10k_sq_ctx_s *ctx =3D (struct nix_cn10k_sq_ctx_s *)qctx; > + > + /* W0 */ > + CNXK_TEL_DICT_INT(d, ctx, sqe_way_mask, w0_); > + CNXK_TEL_DICT_INT(d, ctx, cq, w0_); > + CNXK_TEL_DICT_INT(d, ctx, sdp_mcast, w0_); > + CNXK_TEL_DICT_INT(d, ctx, substream, w0_); > + CNXK_TEL_DICT_INT(d, ctx, qint_idx, w0_); > + CNXK_TEL_DICT_INT(d, ctx, ena, w0_); > + > + /* W1 */ > + CNXK_TEL_DICT_INT(d, ctx, sqb_count, w1_); > + CNXK_TEL_DICT_INT(d, ctx, default_chan, w1_); > + CNXK_TEL_DICT_INT(d, ctx, smq_rr_weight, w1_); > + CNXK_TEL_DICT_INT(d, ctx, sso_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, xoff, w1_); > + CNXK_TEL_DICT_INT(d, ctx, cq_ena, w1_); > + CNXK_TEL_DICT_INT(d, ctx, smq, w1_); > + > + /* W2 */ > + CNXK_TEL_DICT_INT(d, ctx, sqe_stype, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sq_int_ena, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sq_int, w2_); > + CNXK_TEL_DICT_INT(d, ctx, sqb_aura, w2_); > + CNXK_TEL_DICT_INT(d, ctx, smq_rr_count_ub, w2_); > + CNXK_TEL_DICT_INT(d, ctx, smq_rr_count_lb, w2_); > + > + /* W3 */ > + CNXK_TEL_DICT_INT(d, ctx, smq_next_sq_vld, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_pend, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smenq_next_sqb_vld, w3_); > + CNXK_TEL_DICT_INT(d, ctx, head_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smenq_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, tail_offset, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_lso_segnum, w3_); > + CNXK_TEL_DICT_INT(d, ctx, smq_next_sq, w3_); > + CNXK_TEL_DICT_INT(d, ctx, mnq_dis, w3_); > + CNXK_TEL_DICT_INT(d, ctx, lmt_dis, w3_); > + CNXK_TEL_DICT_INT(d, ctx, cq_limit, w3_); > + CNXK_TEL_DICT_INT(d, ctx, max_sqe_size, w3_); > + > + /* W4 */ > + CNXK_TEL_DICT_PTR(d, ctx, next_sqb, w4_); > + > + /* W5 */ > + CNXK_TEL_DICT_PTR(d, ctx, tail_sqb, w5_); > + > + /* W6 */ > + CNXK_TEL_DICT_PTR(d, ctx, smenq_sqb, w6_); > + > + /* W7 */ > + CNXK_TEL_DICT_PTR(d, ctx, smenq_next_sqb, w7_); > + > + /* W8 */ > + CNXK_TEL_DICT_PTR(d, ctx, head_sqb, w8_); > + > + /* W9 */ > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vld, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vlan1_ins_ena, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_vlan0_ins_ena, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_mps, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_sb, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_sizem1, w9_); > + CNXK_TEL_DICT_INT(d, ctx, vfi_lso_total, w9_); > + > + /* W10 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, scm_lso_rem, w10_); > + > + /* W11 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, octs, w11_); > + > + /* W12 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, pkts, w12_); > + > + /* W14 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, drop_octs, w14_); > + > + /* W15 */ > + CNXK_TEL_DICT_BF_PTR(d, ctx, drop_pkts, w15_); } > + > +static int > +cnxk_tel_nix_sq_ctx(struct roc_nix *roc_nix, uint8_t n, struct > +plt_tel_data *d) { > + struct nix *nix =3D roc_nix_to_nix_priv(roc_nix); > + struct dev *dev =3D &nix->dev; > + struct npa_lf *npa_lf; > + volatile void *qctx; > + int rc =3D -1; > + > + npa_lf =3D idev_npa_obj_get(); > + if (npa_lf =3D=3D NULL) > + return NPA_ERR_DEVICE_NOT_BOUNDED; > + > + rc =3D nix_q_ctx_get(dev, NIX_AQ_CTYPE_SQ, n, &qctx); > + if (rc) { > + plt_err("Failed to get rq context"); > + return rc; > + } > + > + if (roc_model_is_cn9k()) > + nix_sq_ctx_cn9k(&qctx, d); > + else > + nix_sq_ctx(&qctx, d); > + > + return 0; > +} > + > +static int > +cnxk_nix_tel_handle_list(const char *cmd __plt_unused, > + const char *params __plt_unused, > + struct plt_tel_data *d) > +{ > + struct nix_tel_node *node; > + struct roc_nix *roc_nix; > + > + plt_tel_data_start_array(d, PLT_TEL_STRING_VAL); > + > + TAILQ_FOREACH(node, &nix_list, node) { > + roc_nix =3D node->nix; > + plt_tel_data_add_array_string(d, roc_nix->pci_dev->name); > + } > + > + return 0; > +} > + > +static int > +cnxk_nix_tel_handle_info(const char *cmd __plt_unused, const char > *params, > + struct plt_tel_data *d) > +{ > + char name[PCI_PRI_STR_SIZE]; > + struct nix_tel_node *node; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) > + return -1; > + > + plt_strlcpy(name, params, PCI_PRI_STR_SIZE); > + > + node =3D nix_tel_node_get_by_pcidev_name(name); > + if (!node) > + return -1; > + > + plt_tel_data_start_dict(d); > + return cnxk_tel_nix(node->nix, d); > +} > + > +static int > +cnxk_nix_tel_handle_info_x(const char *cmd, const char *params, > + struct plt_tel_data *d) > +{ > + struct nix_tel_node *node; > + char *name, *param; > + char buf[1024]; > + int rc =3D -1; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) > + goto exit; > + > + plt_strlcpy(buf, params, PCI_PRI_STR_SIZE + 1); > + name =3D strtok(buf, ","); > + param =3D strtok(NULL, "\0"); > + > + node =3D nix_tel_node_get_by_pcidev_name(name); > + if (!node) > + goto exit; > + > + plt_tel_data_start_dict(d); > + > + if (strstr(cmd, "rq")) { > + char *tok =3D strtok(param, ","); > + int rq; > + > + if (!tok) > + goto exit; > + > + rq =3D strtol(tok, NULL, 10); > + if ((node->n_rq <=3D rq) || (rq < 0)) > + goto exit; > + > + if (strstr(cmd, "ctx")) > + rc =3D cnxk_tel_nix_rq_ctx(node->nix, rq, d); > + else > + rc =3D cnxk_tel_nix_rq(node->rqs[rq], d); > + > + } else if (strstr(cmd, "cq")) { > + char *tok =3D strtok(param, ","); > + int cq; > + > + if (!tok) > + goto exit; > + > + cq =3D strtol(tok, NULL, 10); > + if ((node->n_cq <=3D cq) || (cq < 0)) > + goto exit; > + > + if (strstr(cmd, "ctx")) > + rc =3D cnxk_tel_nix_cq_ctx(node->nix, cq, d); > + else > + rc =3D cnxk_tel_nix_cq(node->cqs[cq], d); > + > + } else if (strstr(cmd, "sq")) { > + char *tok =3D strtok(param, ","); > + int sq; > + > + if (!tok) > + goto exit; > + > + sq =3D strtol(tok, NULL, 10); > + if ((node->n_sq <=3D sq) || (sq < 0)) > + goto exit; > + > + if (strstr(cmd, "ctx")) > + rc =3D cnxk_tel_nix_sq_ctx(node->nix, sq, d); > + else > + rc =3D cnxk_tel_nix_sq(node->sqs[sq], d); > + } > + > +exit: > + return rc; > +} > + > +PLT_INIT(cnxk_telemetry_nix_init) > +{ > + TAILQ_INIT(&nix_list); > + > + plt_telemetry_register_cmd( > + "/cnxk/nix/list", cnxk_nix_tel_handle_list, > + "Returns list of available NIX devices. Takes no parameters"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/info", cnxk_nix_tel_handle_info, > + "Returns nix information. Parameters: pci id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/rq/info", cnxk_nix_tel_handle_info_x, > + "Returns nix rq information. Parameters: pci id, rq id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/rq/ctx", cnxk_nix_tel_handle_info_x, > + "Returns nix rq context. Parameters: pci id, rq id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/cq/info", cnxk_nix_tel_handle_info_x, > + "Returns nix cq information. Parameters: pci id, cq id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/cq/ctx", cnxk_nix_tel_handle_info_x, > + "Returns nix cq context. Parameters: pci id, cq id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/sq/info", cnxk_nix_tel_handle_info_x, > + "Returns nix sq information. Parameters: pci id, sq id"); > + plt_telemetry_register_cmd( > + "/cnxk/nix/sq/ctx", cnxk_nix_tel_handle_info_x, > + "Returns nix sq context. Parameters: pci id, sq id"); } > diff --git a/drivers/common/cnxk/meson.build > b/drivers/common/cnxk/meson.build index f0a1c9f115..fe7a95b526 100644 > --- a/drivers/common/cnxk/meson.build > +++ b/drivers/common/cnxk/meson.build > @@ -65,6 +65,7 @@ sources =3D files( > sources +=3D files('cnxk_security.c') >=20 > # Telemetry common code > -sources +=3D files('cnxk_telemetry_npa.c') > +sources +=3D files('cnxk_telemetry_npa.c', > + 'cnxk_telemetry_nix.c') >=20 > deps +=3D ['bus_pci', 'net', 'telemetry'] diff --git > a/drivers/common/cnxk/roc_nix.c b/drivers/common/cnxk/roc_nix.c index > 3ab954e94d..17beb1a736 100644 > --- a/drivers/common/cnxk/roc_nix.c > +++ b/drivers/common/cnxk/roc_nix.c > @@ -178,6 +178,8 @@ roc_nix_lf_alloc(struct roc_nix *roc_nix, uint32_t > nb_rxq, uint32_t nb_txq, > nix->sqs =3D plt_zmalloc(sizeof(struct roc_nix_sq *) * nb_txq, 0); > if (!nix->sqs) > return -ENOMEM; > + > + nix_tel_node_add(roc_nix); > fail: > return rc; > } > @@ -413,6 +415,7 @@ roc_nix_dev_init(struct roc_nix *roc_nix) > dev_fini: > rc |=3D dev_fini(dev, pci_dev); > fail: > + nix_tel_node_del(roc_nix); > return rc; > } >=20 > diff --git a/drivers/common/cnxk/roc_nix_priv.h > b/drivers/common/cnxk/roc_nix_priv.h > index 2cd5a72347..ba639791ce 100644 > --- a/drivers/common/cnxk/roc_nix_priv.h > +++ b/drivers/common/cnxk/roc_nix_priv.h > @@ -424,4 +424,13 @@ int nix_lf_int_reg_dump(uintptr_t nix_lf_base, > uint64_t *data, uint16_t qints, int nix_q_ctx_get(struct dev *dev, uint8= _t > ctype, uint16_t qid, > __io void **ctx_p); >=20 > +/* > + * Telemetry > + */ > +int nix_tel_node_add(struct roc_nix *roc_nix); void > +nix_tel_node_del(struct roc_nix *roc_nix); int > +nix_tel_node_add_rq(struct roc_nix_rq *rq); int > +nix_tel_node_add_cq(struct roc_nix_cq *cq); int > +nix_tel_node_add_sq(struct roc_nix_sq *sq); > + > #endif /* _ROC_NIX_PRIV_H_ */ > diff --git a/drivers/common/cnxk/roc_nix_queue.c > b/drivers/common/cnxk/roc_nix_queue.c > index 8fbb13ecbd..f546fc83c5 100644 > --- a/drivers/common/cnxk/roc_nix_queue.c > +++ b/drivers/common/cnxk/roc_nix_queue.c > @@ -387,7 +387,11 @@ roc_nix_rq_init(struct roc_nix *roc_nix, struct > roc_nix_rq *rq, bool ena) > if (rc) > return rc; >=20 > - return mbox_process(mbox); > + rc =3D mbox_process(mbox); > + if (rc) > + return rc; > + > + return nix_tel_node_add_rq(rq); > } >=20 > int > @@ -415,7 +419,11 @@ roc_nix_rq_modify(struct roc_nix *roc_nix, struct > roc_nix_rq *rq, bool ena) > if (rc) > return rc; >=20 > - return mbox_process(mbox); > + rc =3D mbox_process(mbox); > + if (rc) > + return rc; > + > + return nix_tel_node_add_rq(rq); > } >=20 > int > @@ -504,7 +512,7 @@ roc_nix_cq_init(struct roc_nix *roc_nix, struct > roc_nix_cq *cq) > if (rc) > goto free_mem; >=20 > - return 0; > + return nix_tel_node_add_cq(cq); >=20 > free_mem: > plt_free(cq->desc_base); > @@ -884,6 +892,7 @@ roc_nix_sq_init(struct roc_nix *roc_nix, struct > roc_nix_sq *sq) > ((qid & RVU_CN9K_LMT_SLOT_MASK) > << 12)); > } >=20 > + rc =3D nix_tel_node_add_sq(sq); > return rc; > nomem: > plt_free(sq->fc); > diff --git a/drivers/common/cnxk/roc_platform.h > b/drivers/common/cnxk/roc_platform.h > index 57073d62aa..b95af115f7 100644 > --- a/drivers/common/cnxk/roc_platform.h > +++ b/drivers/common/cnxk/roc_platform.h > @@ -145,7 +145,10 @@ >=20 > #define plt_strlcpy rte_strlcpy >=20 > +#define PLT_TEL_STRING_VAL RTE_TEL_STRING_VAL > #define plt_tel_data rte_tel_data > +#define plt_tel_data_start_array rte_tel_data_start_array > +#define plt_tel_data_add_array_string rte_tel_data_add_array_string > #define plt_tel_data_start_dict rte_tel_data_start_dict > #define plt_tel_data_add_dict_int rte_tel_data_add_dict_int > #define plt_tel_data_add_dict_ptr(d, n, v) \ > -- > 2.25.1