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 3275AA0C4B; Thu, 14 Oct 2021 18:47:13 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 17BED40E01; Thu, 14 Oct 2021 18:47:13 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id E75124003C for ; Thu, 14 Oct 2021 18:47:11 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19EDBpRY014567 for ; Thu, 14 Oct 2021 09:47:10 -0700 Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0b-0016f401.pphosted.com with ESMTP id 3bpjk19s3u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 14 Oct 2021 09:47:10 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=j9FQFOdhuIG5XsUtzn8VgVueHPygM9EKLJ8ZDH2ICJP/wVmEH7ToB9mtzTFV2DVKOMMJ3mb+W7RR6JqTiBl57ptJ9Umla1JAFXdg+J41cDkbIYYuHzmTGprIRhnp+vEZEhjFfMrH5H8dALPoTHRFnHLsHbXaPLfXMJ1oEf5+X2w0H2qOTTMRRXhhzUDQiYBqz2dm8sS3QBXVdi5mEXYwHNbGLOoaqVlUlat/7gqYfUP9plUtD1k+dmJWEzxwaXw0M7iPV8FF8Gj8tb9VgUFNZTWeCCvR/VuyIBpP4QEyUEm4sBfhPbE0SR0u/u34dU8e+1gpzTKxzVI4XrAyM2aIlg== 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=NIKh8GFz6h07I15zXLSAWDwEZYoFlg5Ftq7zUgAUboc=; b=VYOioTJklxEBOWIxWeOIxz1mZ5PXQurJOuLmrS7zz5dxI9DeuHqCYOPM5Ao55jL93SllB7iyCzX+ZJ8XhPVTI80ETSy5WFEB5K2PINS4RZiStM49jAlG/RkcPam3FSAvdK9A6P+QPVARbpMEWWEKMKfEX8StNSxUDj8+8w99YTTD950hqbtSBxFvypg6PD+19WLkRPAavAv9yy0hZFPby2m1C7mQNyATIHs7X//XD8b6FzGiZ7zj3N/7IuL6b/XpYolKOflT6JrNJDyCHfxaSyYFE2UjCH59HWJNOamPYCZTxUSSfkMfSQMDiLSBJtUVqBgpdyNuLwrc+xx+zI0LIg== 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=NIKh8GFz6h07I15zXLSAWDwEZYoFlg5Ftq7zUgAUboc=; b=AdRDxDjJe75ObcBsVzbAHAAxCrWAtk+DMmM1W7yzANaJmm/oYX3MD3IR4Lmxhqmgu1VKoYqz9WivhaC/Vsp8HzN3K+VVsJ2mkLxl2kdpR6XoULY6+IPVbJcocv2VdNFjI3WF7Q7hvSFTg7GW9ZusmK9MDwr2Ri2Cmurv13HEnZs= Received: from BN9PR18MB4204.namprd18.prod.outlook.com (2603:10b6:408:119::18) by BN6PR18MB1409.namprd18.prod.outlook.com (2603:10b6:404:f3::13) 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 16:47:08 +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:47:08 +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 4/4] net/cnxk: add telemetry endpoints to ethdev Thread-Index: AQHXtP8FDMbyT9kmtESgyhn64QzxZKvSy9YA Date: Thu, 14 Oct 2021 16:47:08 +0000 Message-ID: References: In-Reply-To: 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: 955ecf33-6921-4faa-00ae-08d98f3242f8 x-ms-traffictypediagnostic: BN6PR18MB1409: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:185; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 1SXMBpJLaBKD6AI7CeqIQVyk2yvN6Uj27yOnJI1jkIiI2u7+jIxbu7tUz0Nhtzm0dqXsJymxY4U+M408RqQr3slaU3fjagLxqVs/Sb3HUsSqUxiRjSRRzhrKdKf3VyuKoH+eg1AXe9iBO384ddFqfiue5kzo9N4w9M6oAVRCG23vV7eWcqNV4AU3r4Aj1kHh/wagZBMJiHCgZlzggeI5dEd7znwIgDFmyzz/8lOeT19ZPFrrw/xjXNsPDX5DPGuAVjGXDd7WHVFjYVQ6KIkHTQkPi+/yv4oGcwI74v2V9FegnKpFnyE1kF6hJIfrEzolFGFI90XXhMldlubcGba/Z+MQKaY3AvuREwJiAgU9pY3NSECupE7JTCZXco3ZraOa0BaDgZRxmB8c6fy1uoc2Zq/MKA0n7NxoaGGgcA8ielYuro1NUDB8E7+l3kUg8StnYxYNAFJMn2F4MDatMJEYiQM+4t/PkWhX7d17jI4Efnw7dkCBak2eT7IBGVhQq63J1zZRnjESr5ucs9VTN+3vQv5uQd2L7RVv+jj4376PIyg+JDXtnnFfwifkfdmCm8GjZaatV2wxPY5Ac8Z+bD+qIjw2t/yuU0EqATduhsMnWwv8KpW+TaljAdOnCZWvVZh44jc6McrraVvZ6JmM+AEiaJUFkA96wuKUMbgSZCc10BD+16vGqSIIlFuM3k/UrdHGhwKdn+0cncoD1v9qs2WCCQ== 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)(38100700002)(71200400001)(122000001)(54906003)(66556008)(66476007)(316002)(2906002)(66946007)(64756008)(26005)(107886003)(9686003)(76116006)(86362001)(66446008)(8936002)(186003)(8676002)(55016002)(52536014)(83380400001)(508600001)(6506007)(7696005)(33656002)(53546011)(4326008)(38070700005)(110136005)(5660300002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?Cw7xfs8TqnAM3xTFjTxx4ktLadRG3Mf00pIm1RCtAI1WQzyRn+rMj+rHlYMT?= =?us-ascii?Q?rDXrboy8/6qbycmuVuXcCPcRrVO3U8cMfkxAV654TmtmTFtdTKcCZYyz53t0?= =?us-ascii?Q?8QMwcG76mqMuc8OKe+1GCKccI4foQXVZQVSgFtYDJBQ0l47UToE3PkJrL0XP?= =?us-ascii?Q?r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4VmYH/L?= =?us-ascii?Q?vh5GniXl+79HKWCDTUuhDSlUyqQkULZIZFIxI/YqbJkQFIPTZbUyryyoICsS?= =?us-ascii?Q?0JVMW0umNBmTnNovXfmfhyHXAxHzt798U4W8SG2Wtb5118sVCcbJcEsSkeYi?= =?us-ascii?Q?BqtzhpEO5+y3u7YnxJ1B1nGfWHtrwC2Yh1jqBlzwcvcEGwm3SbvJMQndhz2S?= =?us-ascii?Q?j5GrVwjKPv8S+cCU0hFI/nja8630tt60YmwbQKmQ7L263+XpnjuI147rl78R?= =?us-ascii?Q?4rlSlf4B/gkXi0YKZ92TBxro?= 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: 955ecf33-6921-4faa-00ae-08d98f3242f8 X-MS-Exchange-CrossTenant-originalarrivaltime: 14 Oct 2021 16:47:08.3495 (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: baQUfh+ZOXefGXVtZPM3yVoUQ6ZkSW+u8veiUnppFFalwmNDim1RjkieJedKl2+fLO76ImbfQFMmXG/EnHfPNA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR18MB1409 X-Proofpoint-ORIG-GUID: oN-ZjaZQwF2YHIS9DoSoXHF2yB6WsN2c X-Proofpoint-GUID: oN-ZjaZQwF2YHIS9DoSoXHF2yB6WsN2c 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 4/4] net/cnxk: add telemetry endpoints to ethdev 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 4/4] net/cnxk: add telemetry endpoints to > ethdev >=20 > External Email >=20 > ---------------------------------------------------------------------- > Add telemetry endpoints to ethdev. >=20 > Signed-off-by: Gowrishankar Muthukrishnan LGTM Reviewed-by: Harman Kalra Thanks Harman > --- > drivers/net/cnxk/cnxk_ethdev_telemetry.c | 93 > ++++++++++++++++++++++++ > drivers/net/cnxk/meson.build | 1 + > 2 files changed, 94 insertions(+) > create mode 100644 drivers/net/cnxk/cnxk_ethdev_telemetry.c >=20 > diff --git a/drivers/net/cnxk/cnxk_ethdev_telemetry.c > b/drivers/net/cnxk/cnxk_ethdev_telemetry.c > new file mode 100644 > index 0000000000..83bc65848c > --- /dev/null > +++ b/drivers/net/cnxk/cnxk_ethdev_telemetry.c > @@ -0,0 +1,93 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright(C) 2021 Marvell International Ltd. > + */ > + > +#include > + > +#include "cnxk_ethdev.h" > + > +/* Macro to count no of words in eth_info_s size */ > +#define ETH_INFO_SZ = \ > + (RTE_ALIGN_CEIL(sizeof(struct eth_info_s), sizeof(uint64_t)) / = \ > + sizeof(uint64_t)) > +#define MACADDR_LEN 18 > + > +static int > +ethdev_tel_handle_info(const char *cmd __rte_unused, > + const char *params __rte_unused, struct rte_tel_data *d) > { > + struct rte_eth_dev *eth_dev; > + struct rte_tel_data *i_data; > + struct cnxk_eth_dev *dev; > + union eth_info_u { > + struct eth_info_s { > + /** PF/VF information */ > + uint16_t pf_func; > + uint8_t max_mac_entries; > + bool dmac_filter_ena; > + uint8_t dmac_filter_count; > + uint8_t ptype_disable; > + bool scalar_ena; > + bool ptp_ena; > + /* Platform specific offload flags */ > + uint16_t rx_offload_flags; > + uint16_t tx_offload_flags; > + } info; > + uint64_t val[ETH_INFO_SZ]; > + } eth_info; > + struct eth_info_s *info; > + unsigned int i, j =3D 0; > + int n_ports; > + > + n_ports =3D rte_eth_dev_count_avail(); > + if (!n_ports) { > + plt_err("No active ethernet ports found."); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_int(d, "n_ports", n_ports); > + > + i_data =3D rte_tel_data_alloc(); > + rte_tel_data_start_array(i_data, RTE_TEL_U64_VAL); > + > + for (i =3D 0; i < RTE_MAX_ETHPORTS; i++) { > + /* Skip if port is unused */ > + if (!rte_eth_dev_is_valid_port(i)) > + continue; > + > + eth_dev =3D &rte_eth_devices[i]; > + if (eth_dev) { > + memset(ð_info, 0, sizeof(eth_info)); > + info =3D ð_info.info; > + dev =3D cnxk_eth_pmd_priv(eth_dev); > + if (dev) { > + info->pf_func =3D roc_nix_get_pf_func(&dev- > >nix); > + info->max_mac_entries =3D dev- > >max_mac_entries; > + info->dmac_filter_ena =3D dev- > >dmac_filter_enable; > + info->dmac_filter_count =3D > + dev->dmac_filter_count; > + info->ptype_disable =3D dev->ptype_disable; > + info->scalar_ena =3D dev->scalar_ena; > + info->ptp_ena =3D dev->ptp_en; > + info->rx_offload_flags =3D dev- > >rx_offload_flags; > + info->tx_offload_flags =3D dev- > >tx_offload_flags; > + } > + > + for (j =3D 0; j < ETH_INFO_SZ; j++) > + rte_tel_data_add_array_u64(i_data, > + eth_info.val[j]); > + > + j++; > + } > + } > + > + rte_tel_data_add_dict_container(d, "info", i_data, 0); > + return 0; > +} > + > +RTE_INIT(cnxk_ethdev_init_telemetry) > +{ > + rte_telemetry_register_cmd("/cnxk/ethdev/info", > ethdev_tel_handle_info, > + "Returns ethdev device information"); } > diff --git a/drivers/net/cnxk/meson.build b/drivers/net/cnxk/meson.build > index d1d4b4e15e..5b3b8422fb 100644 > --- a/drivers/net/cnxk/meson.build > +++ b/drivers/net/cnxk/meson.build > @@ -13,6 +13,7 @@ sources =3D files( > 'cnxk_ethdev_devargs.c', > 'cnxk_ethdev_ops.c', > 'cnxk_ethdev_sec.c', > + 'cnxk_ethdev_telemetry.c', > 'cnxk_link.c', > 'cnxk_lookup.c', > 'cnxk_ptp.c', > -- > 2.25.1