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 AEAD0A0C4D; Tue, 19 Oct 2021 14:30:27 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 915A0410FA; Tue, 19 Oct 2021 14:30:27 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 03053410F4 for ; Tue, 19 Oct 2021 14:30:25 +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 19JAIlVY009139 for ; Tue, 19 Oct 2021 05:30:25 -0700 Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2042.outbound.protection.outlook.com [104.47.66.42]) by mx0a-0016f401.pphosted.com with ESMTP id 3bsnmq2fqp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 19 Oct 2021 05:30:24 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GflkJ/x6c+tsGQJvFW1pCzLjrGr/gxnxX+fLCNaN47m9hCde9RvvqM1frmhRfD+3WDRNGCozy9SEGfiF4d6ZD/6wcklevnM1uiHSkc9izdfnSAMPgeEx+6gi37kGk60/4YKgCMuraETTqfohTqObCJN7aFUiE02FfDgcD+asIGP85Fl6Gj1WIANilR4LWEwi/tgQ5nZnE2nEj0M2IAoKNiEvO1PghNMqBfFuV5tz0U8BrhDn8tdot9RTf6W8BDNunMM63CmF3FUWA2h6FmQMr2xGwv1LbTjouCSI+DMD5LUlQpHZ5Jd787qseR3mc91s6O+m708byADn3Mk5Gxw1yA== 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=P417dQIYj2xRkpQb1q3PSUfrCokXppJHP/+YwLJPs+U=; b=BVnyUShQyFXjBa5b3hQuqHIgCOWZ87YwTV0yGsexuOKvQ4wwKv1dZgdBGSgV/9/tALferPzNnxim6f3OY7DdcmmnLdLMYN3/XOyxUgjhSfSg19kmwQDxQ5qvp4iUEgGCTBifd2fiX0WTQVJqrjAvFz6SP4FeyGflN5yIxDixJfbagsZBcxZ76FbHsxWdTQT9zFeGIQXlQYvrE7G97xgMa6MdIm213hArGkrj8HMqWroM2GeUSfakWeD7NaliRrnfzNvXvzEDfXHUBP8XtbzGO139gxKHTgDczzUPDFEujA1ybBTwaDEteaAoUdo2hoNc8YIlHUEchqGJkHOrqu2xfQ== 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=P417dQIYj2xRkpQb1q3PSUfrCokXppJHP/+YwLJPs+U=; b=R0e8UrXd7Ty2tcsJEeFFgt6Hd9fnDxlyIJQAt6ws8VTcQBCS60UcZsdRgN59/vm1dgv8SkiA1rfmAC6nqoCFsbJBiumynLrOrHsJ9vint3crY0ck01FYG46NqMm8BAf2ltofjW56S1TsZuw/4hSapEXScp44fQWXRzkCf4iJdIA= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN8PR18MB2979.namprd18.prod.outlook.com (2603:10b6:408:a9::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4608.17; Tue, 19 Oct 2021 12:30:23 +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.4628.015; Tue, 19 Oct 2021 12:30:23 +0000 From: Harman Kalra To: Tomasz Duszynski , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Tomasz Duszynski , Nithin Kumar Dabilpuram , Kiran Kumar Kokkilagadda , Sunil Kumar Kori , Satha Koteswara Rao Kottidi , Jakub Palider Thread-Topic: [EXT] [dpdk-dev] [PATCH] common/cnxk: support BPHY telemetry Thread-Index: AQHXub03YmNzDMxpQU6f4dsFmeCyiKvaVRqA Date: Tue, 19 Oct 2021 12:30:22 +0000 Message-ID: References: <20211005074620.2224968-1-tduszynski@marvell.com> In-Reply-To: <20211005074620.2224968-1-tduszynski@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: 0fb69f0f-5e30-4af9-b978-08d992fc38b1 x-ms-traffictypediagnostic: BN8PR18MB2979: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: d/PSHQiqSMNGcRlforDCxobXDhv51p8/ijHjJUsdUkQdH32FbwMWTJNTxsBLQb4Na52l4pQubq6m5h847LZDmn740dlmGv2h+NimUCds5ZPE1sNsRr+f/yCrcJQsbtl2d5bPXxkZRIjS5rmpy3VOplX/tW5n5n7arrn7F2BMvKnyz21UUuuoxIM10wX5xC9H25YPKyVv4ni3i23mpAlUnYt3kv2gQwvUitKm0wiUC3OxXLe53Phv1NE7KZandOCiXWmQ7JxuBJ+mMteVlMuxV3FMLv2hutquhMJju733un0Mvc/R/XzmQw8zW2V0ak+nuviwXpBVvnZiLCZqilWh04kAyFfeFQ04If/pA00nLlki05v4MQ92o3qTZvrmtYxCb0e5As4C9Msp1uStUnrzkvmz7mWatC6scW2C9UaXTEXZtK2fSDIUEluGahyRVADWCCzw9KQwRd7GHHZJC/SSl4tLbNCL8cig0D5Wm+dx4EjCeXL5WuJby2/j91lyOOOl200zwxLdLVVi9d3lc/lkmDEWWdPs4lUr0ZAMI/C5for6S+t6RBJivtxjqC+U06cENd+NI9wjp+ncPs8RrSspAx+9PRY9aoiE5EMqj0BxgtOGGcS+NsnU2E4cJ+JH/k1hLO22W+7IpZj8IIvsxtoT6zFp/WOFSKFTtdCaz/DDqHoe6NI+68sRvhukleS9/k1sQbv63B4PvsY4bXSGoVkgLw== 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)(2906002)(107886003)(83380400001)(26005)(8936002)(71200400001)(5660300002)(4326008)(186003)(33656002)(86362001)(54906003)(110136005)(508600001)(53546011)(6506007)(38100700002)(66556008)(66946007)(38070700005)(55016002)(64756008)(66446008)(9686003)(122000001)(66476007)(7696005)(76116006)(52536014)(316002)(8676002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?novz2VvZMmKlh2kaEj9rtocE0CjH5KXeRqqkEy5b/ra7KjHF4dpJC/+VdrAX?= =?us-ascii?Q?StZRg2Eym0Zq4d8fKk9h+yC6xIQZQAlt+mgW8DMuEaXGC4Y1GLtJkCb/eu0T?= =?us-ascii?Q?YmL7cy7aMkUiYtVg15hrFmg0SuVOX0EVERjar2e7YIMyv3N9JiicJSp4fKN1?= =?us-ascii?Q?71c4nsTm/5H7NJLQuASXXTJa1K2oXsyJgiR/yEmiVyM/EFS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liFKglt5WRvGwFxeX8hhoZ/xbVdU2QIIFb0t9R9i4UlvBvfHW0F3Q?= =?us-ascii?Q?wZGMc5YhfNM5CktmWnDzoS7ds07OlGcR3/5dzlYqAosXjGnN03rqL3Iufj/H?= =?us-ascii?Q?KjZmcpnwu1ioTsz3OLOOBUd7w3+E4yMwUWbqH0mqwAIWWSqju0fJU1UgafZV?= =?us-ascii?Q?uKvRxj4QB6xy+XQXS+P4rbCAUhUVERBz9O82LXuEXA72c6Jp6ynnifUI6rUY?= =?us-ascii?Q?Qdk4y/1TqcfgaUO+2PP/l68y?= 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: 0fb69f0f-5e30-4af9-b978-08d992fc38b1 X-MS-Exchange-CrossTenant-originalarrivaltime: 19 Oct 2021 12:30:22.8658 (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: 1r9YiZ1SbOBHwop7qJkFhv0y7AYJjABd5bptlM7LF8q25ALXZLToKKcUGRhQfJ/CTYSVpigDp6FQZBa6fmNjjA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR18MB2979 X-Proofpoint-GUID: b6Ct6VAXI4AWUb4VMD_TjLuVTJjjNJ0B X-Proofpoint-ORIG-GUID: b6Ct6VAXI4AWUb4VMD_TjLuVTJjjNJ0B 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-19_01,2021-10-19_01,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH] common/cnxk: support BPHY telemetry 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 Tomasz Please find my comments inline > -----Original Message----- > From: dev On Behalf Of Tomasz Duszynski > Sent: Tuesday, October 5, 2021 1:16 PM > To: dev@dpdk.org > Cc: Jerin Jacob Kollanukkaran ; Tomasz Duszynski > ; Nithin Kumar Dabilpuram > ; Kiran Kumar Kokkilagadda > ; Sunil Kumar Kori ; Satha > Koteswara Rao Kottidi ; Jakub Palider > > Subject: [EXT] [dpdk-dev] [PATCH] common/cnxk: support BPHY telemetry >=20 > External Email >=20 > ---------------------------------------------------------------------- > Add initial support for baseband telemetry. >=20 > Signed-off-by: Tomasz Duszynski > --- > drivers/common/cnxk/cnxk_telemetry_bphy.c | 43 > +++++++++++++++++++++++ > drivers/common/cnxk/meson.build | 7 +++- > drivers/raw/cnxk_bphy/cnxk_bphy.c | 11 ++++++ > drivers/raw/cnxk_bphy/cnxk_bphy_irq.h | 1 + > 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 > drivers/common/cnxk/cnxk_telemetry_bphy.c >=20 > diff --git a/drivers/common/cnxk/cnxk_telemetry_bphy.c > b/drivers/common/cnxk/cnxk_telemetry_bphy.c > new file mode 100644 > index 0000000000..d60729c437 > --- /dev/null > +++ b/drivers/common/cnxk/cnxk_telemetry_bphy.c > @@ -0,0 +1,43 @@ > + > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell. > + */ > + > +#include > + > +#include > + > +#include "roc_api.h" > +#include "roc_priv.h" > + > +static int > +cnxk_tel_bphy(struct rte_tel_data *d) > +{ > + struct idev_cfg *idev; > + > + idev =3D idev_get_cfg(); > + if (!idev || !idev->bphy) > + return -ENODEV; > + > + rte_tel_data_add_dict_int(d, "sso_pf_func", > roc_bphy_sso_pf_func_get()); > + rte_tel_data_add_dict_int(d, "npa_pf_func", > +roc_bphy_npa_pf_func_get()); > + > + return 0; > +} > + > +static int > +cnxk_bphy_tel_handle_info(const char *cmd __rte_unused, > + const char *params __rte_unused, > + struct rte_tel_data *d) > +{ > + rte_tel_data_start_dict(d); > + > + return cnxk_tel_bphy(d); > +} > + > +RTE_INIT(cnxk_telemetry_bphy_init) I think this command should be enables only for platforms which have BPHY d= evices. May be we should register this telemetry command after successful BPHY devi= ce probe. Thanks Harman > +{ > + rte_telemetry_register_cmd( > + "/cnxk/bphy/info", cnxk_bphy_tel_handle_info, > + "Returns bphy information. Takes no parameters"); } > diff --git a/drivers/common/cnxk/meson.build > b/drivers/common/cnxk/meson.build index 258429d54b..dd52f50dcd > 100644 > --- a/drivers/common/cnxk/meson.build > +++ b/drivers/common/cnxk/meson.build > @@ -9,7 +9,7 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64') endi= f >=20 > config_flag_fmt =3D 'RTE_LIBRTE_@0@_COMMON' > -deps =3D ['eal', 'pci', 'bus_pci', 'mbuf', 'security'] > +deps =3D ['eal', 'pci', 'bus_pci', 'mbuf', 'security', 'telemetry'] > sources =3D files( > 'roc_ae.c', > 'roc_ae_fpm_tables.c', > @@ -61,6 +61,11 @@ sources =3D files( > # Security common code > sources +=3D files('cnxk_security.c') >=20 > +# Telemetry common code > +sources +=3D files( > + 'cnxk_telemetry_bphy.c', > +) > + > # common DPDK utilities code > sources +=3D files('cnxk_utils.c') >=20 > diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy.c > b/drivers/raw/cnxk_bphy/cnxk_bphy.c > index 6bfda71761..558ebfa85e 100644 > --- a/drivers/raw/cnxk_bphy/cnxk_bphy.c > +++ b/drivers/raw/cnxk_bphy/cnxk_bphy.c > @@ -341,6 +341,13 @@ bphy_rawdev_probe(struct rte_pci_driver *pci_drv, > bphy_dev =3D (struct bphy_device *)bphy_rawdev->dev_private; > bphy_dev->mem.res0 =3D pci_dev->mem_resource[0]; > bphy_dev->mem.res2 =3D pci_dev->mem_resource[2]; > + bphy_dev->bphy.pci_dev =3D pci_dev; > + > + ret =3D roc_bphy_dev_init(&bphy_dev->bphy); > + if (ret) { > + rte_rawdev_pmd_release(bphy_rawdev); > + return ret; > + } >=20 > return 0; > } > @@ -349,6 +356,7 @@ static int > bphy_rawdev_remove(struct rte_pci_device *pci_dev) { > char name[RTE_RAWDEV_NAME_MAX_LEN]; > + struct bphy_device *bphy_dev; > struct rte_rawdev *rawdev; >=20 > if (rte_eal_process_type() !=3D RTE_PROC_PRIMARY) @@ -366,6 +374,9 > @@ bphy_rawdev_remove(struct rte_pci_device *pci_dev) > return -EINVAL; > } >=20 > + bphy_dev =3D (struct bphy_device *)rawdev->dev_private; > + roc_bphy_dev_fini(&bphy_dev->bphy); > + > return rte_rawdev_pmd_release(rawdev); } >=20 > diff --git a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > index f141677e2a..63d7285055 100644 > --- a/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > +++ b/drivers/raw/cnxk_bphy/cnxk_bphy_irq.h > @@ -24,6 +24,7 @@ struct bphy_irq_queue { >=20 > struct bphy_device { > #define BPHY_QUEUE_CNT 1 > + struct roc_bphy bphy; > struct roc_bphy_irq_chip *irq_chip; > struct bphy_mem mem; > /* bphy irq interface supports single queue only */ > -- > 2.25.1