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 79167A0C47; Thu, 7 Oct 2021 18:04:32 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 000AE40042; Thu, 7 Oct 2021 18:04:31 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id 1BC1140040 for ; Thu, 7 Oct 2021 18:04:29 +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 1977TbVw012132; Thu, 7 Oct 2021 09:02:49 -0700 Received: from nam10-dm6-obe.outbound.protection.outlook.com (mail-dm6nam10lp2102.outbound.protection.outlook.com [104.47.58.102]) by mx0a-0016f401.pphosted.com with ESMTP id 3bhvj2t3mq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Oct 2021 09:02:49 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TGxB3wOH0C0Z4vOyMRfkf7XGeP9JujR0cUoMxJfIbhc41E8+5Yw7BMRbjOEK5XQrTWAJnyTti7NVdO/X+dl0xfb5AaNQLvY52xNH74Fu2KTmpcH0fS2EzpwqzGKFKv1DSqLKy/PcGmRNARSLzxXqfNG+yIo2r6pTr37Hwfydn/mnnmg8YNhHvvScK3CuljmPmm5n8i3bM+9KiLvEkOGCg8k3KQYiA1uJsgYpHeuy0UjIKndNtk4IiG05CLlcskiR0HPTqsPPckmIM4+5H5Js2tgv+ZlNtpZ/0ag52xdoWsm38WwauXc1SE9MfsxEw0BWuW1ZozTB5KW901q2ALXviQ== 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=1AxPSRGCKsiEsv40jGn6SS48bkLwcpiB4IBJoKjRnHw=; b=dJ0+6Howo0XAd8ifu3v+j32WwJdxYRpfvx8Zyn/kR+Zu97x9rY/brVjhE56sXXQcZGQME301cJoABa1wzPatiWUHbsLMw8CGuRV0RKwnbDbR3inQuSfNRoLnyqBqRC1NgbUydI/k1TtU5Xvr3hAl8ljlyoEFMPdSe0HN7mOBT8jL3kRfA+4QUb+IRMg3Opi9DL0VE3OQ4VvdUM5lA5nYB6asNiV8G+UkiVg39T4DaFMw2zxsnP3a+8Mi/wow4QzTDBsoLgO3bBWw3LX8w3HEHQygor2NCjwgN5XesuO9u3MCSNAG9dJthfNcwu/+v7MWo8LQm3DLEFhLv1TNq8EYfg== 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=1AxPSRGCKsiEsv40jGn6SS48bkLwcpiB4IBJoKjRnHw=; b=pOvznUzLyzIa9CJ0NfJy8qjK8r1S0fFeoitdDKJAz3RDGohBbHf/hWfqFZE6fMKKI0xgMbbyoh0fmv4jYqFwPjdJlZVjb089tS1Dr4End/5WkzasZA6hSkIMBa9uZBw3+jbiZOizx3AX1MW+5M9X3pAFQ/cl9n11h9X+5nvsBc8= Received: from CO1PR18MB4714.namprd18.prod.outlook.com (2603:10b6:303:e9::18) by CO1PR18MB4569.namprd18.prod.outlook.com (2603:10b6:303:fc::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.19; Thu, 7 Oct 2021 16:02:47 +0000 Received: from CO1PR18MB4714.namprd18.prod.outlook.com ([fe80::8c05:ddeb:f02:7b5c]) by CO1PR18MB4714.namprd18.prod.outlook.com ([fe80::8c05:ddeb:f02:7b5c%9]) with mapi id 15.20.4566.023; Thu, 7 Oct 2021 16:02:47 +0000 From: Gowrishankar Muthukrishnan To: Ganapati Kundapura , "jerinjacobk@gmail.com" , "dev@dpdk.org" CC: "jay.jayatheerthan@intel.com" Thread-Topic: [EXT] [dpdk-dev] [PATCH v2] eventdev/rx-adapter: add telemetry callbacks Thread-Index: AQHXu4G0F2h3fhE9nUyc4fvQp2fO16vHsJPQ Date: Thu, 7 Oct 2021 16:02:47 +0000 Message-ID: References: <20211007125734.2326512-1-ganapati.kundapura@intel.com> <20211007134607.2351243-1-ganapati.kundapura@intel.com> In-Reply-To: <20211007134607.2351243-1-ganapati.kundapura@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 82033f2f-1bcf-4cb1-f523-08d989abe816 x-ms-traffictypediagnostic: CO1PR18MB4569: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:65; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: P9juhXYG5P8swRUO6LaPF6nL7uMHdqpWeBDRwfPpYSzsh8eHbNzHtj6PdwIQC7d5B9o8e+CaJP16fW9r31TDZ0RLrKHFJVcOS6qxLP8nAJWhI3siWFjejLQJx4aNCIsocrbK8IyFJkPJbT5Z2Xq+sANKPddYhVgQ4tpfPngQjLRk0iZXw3i7a1xNNRkdr7HaE80jtFNi1mDJMyf9z4gjETAJ7fyuzK4F8lD+q/YLJ6oFJwUWSGtqrw8eaGSscNsiXYJLeS5531p7MTyTpDlsTXYv3aqkCaX2ATVg9xQ4qoSeqNVfiWEorASfmxhyZeazVmkQmdo4vK3cFCtU22UpTbpgMcxZIPsGzldYWWI0xdcRyxswGtfQktqV/mIE/UByMViQ/MuFZrhzLvOSPzu7hGGufXpV0irVxeWkcEW21mduPUwi5hpAoZAysWkJzOHzVEUe918+9E5eiGdLgbE1Bdswx03scnyqHoRs1jm4C/teO/9hSDjn/9nJ8VTi/TYOapAHhl5hcL0nu9BDDDK8k8MKh3Ti4cQWUFL8u3f1hgujDiD5mQXHXtczo6iDWwicrO196+x/YEm5t9wfn/YfqFEBBhP3L4peXlUywbCSdTs4vZ4mOXNI5k8Oe31l+9f9oqQkSZjORUaTI8sh4MIgZqAVW26opqhYb5kyQFz6mNnbOhx0ZACbAVsUdSWzL6/VAvc0Sk112aSXhEIBS7O6hw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO1PR18MB4714.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(33656002)(5660300002)(316002)(26005)(186003)(110136005)(7696005)(71200400001)(55016002)(38100700002)(508600001)(9686003)(76116006)(6506007)(66476007)(66446008)(8936002)(4326008)(64756008)(66556008)(52536014)(2906002)(83380400001)(8676002)(66946007)(122000001)(38070700005); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?R4xuyreSc0ssZOG7OC00jgrdIMOTWCGgB8W5emHpFZaIxRXdsZOMZVktXIhL?= =?us-ascii?Q?zQtrOguI4r3EkJBv8L8vK3+n5OLMWx0pRrwpt37eJrU8Wc6v5YS3ZzCANTkV?= =?us-ascii?Q?0rXHwSzXTHG0pk1hUGXi65LWOVgHMXyU1YB3CrPoajvXyKMvSuY8QuQMQSHk?= =?us-ascii?Q?AMnOUtGOH6qdjc0c0JgLiojOyBG5nvmN32hg36ZS/GPz/IJLtTTnpYtvor4Z?= =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pK+QKvJdLHlogSA?= =?us-ascii?Q?4gbFFNIR0uu1J+uQ18DkDO7wNmAw277+25dwEQZE9MhXXZ6aqFx9FTivMqBB?= =?us-ascii?Q?ckf2MIbpl9o7G+wm0flzmZY+4ZsVy9Fk6/thv+KZpgN5Lwp6CIqxIfXw1HID?= =?us-ascii?Q?HXzr42JaSZ7pD3T4eSZkBWqjHxe0Z4ifvXcW1p4sSUSekf246tPuaJ2CPCTf?= =?us-ascii?Q?5MLGcgmviKxSacDfCK3UuZEU?= x-ms-exchange-transport-forked: True 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: CO1PR18MB4714.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 82033f2f-1bcf-4cb1-f523-08d989abe816 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Oct 2021 16:02:47.3856 (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: 67X80N6P4N9r0LcCde+iQ3Hj615ikzogluyVZuyteJPOvz98nfVXkmPEO6UsXblTI/XPe5QWECEmt9Sx5+cqlZjsPoGulgu4KhINKn61zT0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4569 X-Proofpoint-ORIG-GUID: 3fiYd0on85XAftZzwuQk2APAX2bwQxZp X-Proofpoint-GUID: 3fiYd0on85XAftZzwuQk2APAX2bwQxZp X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.391,FMLib:17.0.607.475 definitions=2021-10-07_02,2021-10-07_02,2020-04-07_01 Subject: Re: [dpdk-dev] [EXT] [PATCH v2] eventdev/rx-adapter: add telemetry callbacks 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" Just few minor corrections as below. >=20 > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.c > b/lib/eventdev/rte_event_eth_rx_adapter.c > index 9ac976c..c2fb54a 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.c > +++ b/lib/eventdev/rte_event_eth_rx_adapter.c > @@ -23,6 +23,7 @@ > #include "eventdev_pmd.h" > #include "rte_eventdev_trace.h" > #include "rte_event_eth_rx_adapter.h" > +#include This change can follow other <> includes before this folder include. >=20 > #define BATCH_SIZE 32 > #define BLOCK_CNT_THRESHOLD 10 > @@ -2852,6 +2853,7 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > struct rte_event_eth_rx_adapter_stats *stats) { > struct rte_event_eth_rx_adapter *rx_adapter; > + struct rte_eth_event_enqueue_buffer *buf; > struct rte_event_eth_rx_adapter_stats dev_stats_sum =3D { 0 }; > struct rte_event_eth_rx_adapter_stats dev_stats; > struct rte_eventdev *dev; > @@ -2887,8 +2889,11 @@ rte_event_eth_rx_adapter_stats_get(uint8_t id, > if (rx_adapter->service_inited) > *stats =3D rx_adapter->stats; >=20 > + buf =3D &rx_adapter->event_enqueue_buffer; > stats->rx_packets +=3D dev_stats_sum.rx_packets; > stats->rx_enq_count +=3D dev_stats_sum.rx_enq_count; > + stats->rx_event_buf_count =3D buf->count; > + stats->rx_event_buf_size =3D buf->events_size; >=20 > return 0; > } > @@ -3052,3 +3057,146 @@ > rte_event_eth_rx_adapter_queue_conf_get(uint8_t id, >=20 > return 0; > } > + > +#define RXA_ADD_DICT(stats, s) rte_tel_data_add_dict_u64(d, #s, > +stats.s) > + > +static int > +handle_rxa_stats(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + struct rte_event_eth_rx_adapter_stats rx_adptr_stats; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id =3D atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + /* Get Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_get(rx_adapter_id, > + &rx_adptr_stats)) { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter stats\n"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + RXA_ADD_DICT(rx_adptr_stats, rx_packets); > + RXA_ADD_DICT(rx_adptr_stats, rx_poll_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_dropped); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_retry); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_event_buf_size); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_count); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_start_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_block_cycles); > + RXA_ADD_DICT(rx_adptr_stats, rx_enq_end_ts); > + RXA_ADD_DICT(rx_adptr_stats, rx_intr_packets); > + > + return 0; > +} > + > +static int > +handle_rxa_stats_reset(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d __rte_unused) { > + uint8_t rx_adapter_id; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || ~isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + rx_adapter_id =3D atoi(params); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + /* Reset Rx adapter stats */ > + if (rte_event_eth_rx_adapter_stats_reset(rx_adapter_id)) { > + RTE_EDEV_LOG_ERR("Failed to reset Rx adapter stats\n"); > + return -1; > + } > + > + return 0; > +} > + > +static int > +handle_rxa_get_queue_conf(const char *cmd __rte_unused, > + const char *params, > + struct rte_tel_data *d) > +{ > + uint8_t rx_adapter_id; > + uint16_t rx_queue_id; > + int eth_dev_id; > + char *token, *l_params; > + struct rte_event_eth_rx_adapter_queue_conf queue_conf; > + > + if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) > + return -1; > + > + /* Get Rx adapter ID from parameter string */ > + l_params =3D strdup(params); > + token =3D strtok(l_params, ","); > + rx_adapter_id =3D strtoul(token, NULL, 10); > + RTE_EVENT_ETH_RX_ADAPTER_ID_VALID_OR_ERR_RET(rx_adapter_id, > -EINVAL); > + > + token =3D strtok(NULL, ","); > + if (token =3D=3D NULL || strlen(token) =3D=3D 0 || !isdigit(*token)) > + return -1; > + > + /* Get device ID from parameter string */ > + eth_dev_id =3D strtoul(token, NULL, 10); > + RTE_EVENTDEV_VALID_DEVID_OR_ERR_RET(eth_dev_id, -EINVAL); > + > + token =3D strtok(NULL, ","); > + if (token =3D=3D NULL || strlen(token) =3D=3D 0 || !isdigit(*token)) > + return -1; > + > + /* Get Rx queue ID from parameter string */ > + rx_queue_id =3D strtoul(token, NULL, 10); > + if (rx_queue_id >=3D rte_eth_devices[eth_dev_id].data->nb_rx_queues) { > + RTE_EDEV_LOG_ERR("Invalid rx queue_id %u", rx_queue_id); > + return -EINVAL; > + } > + > + token =3D strtok(NULL, "\0"); > + if (token !=3D NULL) > + RTE_EDEV_LOG_ERR("Extra parameters passed to eventdev" > + " telemetry command, igrnoring"); > + > + if (rte_event_eth_rx_adapter_queue_conf_get(rx_adapter_id, > eth_dev_id, > + rx_queue_id, &queue_conf)) > { > + RTE_EDEV_LOG_ERR("Failed to get Rx adapter queue config"); > + return -1; > + } > + > + rte_tel_data_start_dict(d); > + rte_tel_data_add_dict_u64(d, "rx_adapter_id", rx_adapter_id); > + rte_tel_data_add_dict_u64(d, "eth_dev_id", eth_dev_id); > + rte_tel_data_add_dict_u64(d, "rx_queue_id", rx_queue_id); > + RXA_ADD_DICT(queue_conf, rx_queue_flags); > + RXA_ADD_DICT(queue_conf, servicing_weight); > + RXA_ADD_DICT(queue_conf.ev, queue_id); > + RXA_ADD_DICT(queue_conf.ev, sched_type); > + RXA_ADD_DICT(queue_conf.ev, priority); > + RXA_ADD_DICT(queue_conf.ev, flow_id); > + > + return 0; > +} > + > +RTE_INIT(rxa_init_telemetry) > +{ > + rte_telemetry_register_cmd("/eventdev/rxa_stats", > + handle_rxa_stats, > + "Returns Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_stats_reset", > + handle_rxa_stats_reset, > + "Reset Rx adapter stats. Parameter: rx_adapter_id"); > + > + rte_telemetry_register_cmd("/eventdev/rxa_queue_conf", > + handle_rxa_get_queue_conf, > + "Returns Rx queue config. Parameter: rxa_id, DevID, Either rxa_id or rx_adapter_id as a description in all end points. Also, De= vID -> dev_id. Thanks, Gowrishankar > queue_id"); } > diff --git a/lib/eventdev/rte_event_eth_rx_adapter.h > b/lib/eventdev/rte_event_eth_rx_adapter.h > index 70ca427..acabed4 100644 > --- a/lib/eventdev/rte_event_eth_rx_adapter.h > +++ b/lib/eventdev/rte_event_eth_rx_adapter.h > @@ -216,6 +216,10 @@ struct rte_event_eth_rx_adapter_stats { > /**< Eventdev enqueue count */ > uint64_t rx_enq_retry; > /**< Eventdev enqueue retry count */ > + uint64_t rx_event_buf_count; > + /**< Rx event buffered count */ > + uint64_t rx_event_buf_size; > + /**< Rx event buffer size */ > uint64_t rx_dropped; > /**< Received packet dropped count */ > uint64_t rx_enq_start_ts; > -- > 2.6.4