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 19CEBA0C47; Tue, 12 Oct 2021 16:30:35 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A6BEF410EF; Tue, 12 Oct 2021 16:30:34 +0200 (CEST) Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mails.dpdk.org (Postfix) with ESMTP id 5D63B40151 for ; Tue, 12 Oct 2021 16:30:32 +0200 (CEST) X-IronPort-AV: E=McAfee;i="6200,9189,10135"; a="227059701" X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="227059701" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 12 Oct 2021 07:30:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.85,367,1624345200"; d="scan'208";a="716890045" Received: from fmsmsx606.amr.corp.intel.com ([10.18.126.86]) by fmsmga005.fm.intel.com with ESMTP; 12 Oct 2021 07:30:30 -0700 Received: from fmsmsx607.amr.corp.intel.com (10.18.126.87) by fmsmsx606.amr.corp.intel.com (10.18.126.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12; Tue, 12 Oct 2021 07:30:30 -0700 Received: from fmsedg601.ED.cps.intel.com (10.1.192.135) by fmsmsx607.amr.corp.intel.com (10.18.126.87) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2242.12 via Frontend Transport; Tue, 12 Oct 2021 07:30:30 -0700 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.43) by edgegateway.intel.com (192.55.55.70) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2242.12; Tue, 12 Oct 2021 07:30:30 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=OpKmXjuh0bvIpAHTirshCwqbjV0KUUeViciPgAb+DaoJ8X6iMJD+XnlvmgB6cuSik/mK6pGgTS8wjGOMHamk98litYTH2qDYU8qNsW1gvJMA6wHzW08y5EIyuLRA1mdaPT2LIM0AJc/mhrFnlKpVDqRUowRF/guyrKV/0SyzFISKc/GIhP5BI0rJwgDhuPuKEFBi9txEgXGpIzooA+6exQXzC1duM9OvUdvOUP1actCbAtlvoKTwNhRhZ17bwqSQdtoMyTSlmBLlEC16MIH8oKo46eZRnQp/PAOpZWHclohxO4YQWrXKZTitBhCMaLais3wz2RQ5X8wOxoYls2tf8Q== 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=92utzY1VqEInH5JFUGc0xkFFvWViqZPJgCmTSba5VBg=; b=PUM4x/mRhkTrPNaPDsonu8exbOFqR3u7q+641J1/drXVY24tYe3MzO5rpMGBlKZd1X0eFpQghZJ5pY/3kqm8LCYpqKENxqJtQxK2VAP6dUjKe9+eTXJI/fMibomtHu/Pp4f4W4FXcsDDg1AKMo4JolvDF5eQ6wuA9+eaIH25ehISqqVTZSTO9b+4XLO+MwFGT6esUEreO0XII/AxG3bX053ioTJnBQYGjafcaCgPFgXm6FwvVbHn9UJGqytzTvTma5gfug6SC+qO1hiuqOsg6K9g9Xbq8M6u3FH9prxXwD0wVBnmberIiqaBfzFifajEzcuAQy3l0ygjwYX8ZMUx3w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=92utzY1VqEInH5JFUGc0xkFFvWViqZPJgCmTSba5VBg=; b=ndssfuyb9UETQfcBbtnBA5KQ0M/lw74rF8PsHO6GBrJB3xdTwlmnnq0OZfqXN8UD0fnTw65ABzYwhdKSY35LKsciePqJP5zUnKI5kLP2AoBJmU/W5beUt210GPUWvQGGJgNlqXvNqyRQ9GUTerrTjykpf+fxDsYMDA5tcKVY7YQ= Received: from MN2PR11MB3821.namprd11.prod.outlook.com (2603:10b6:208:f7::24) by MN2PR11MB3822.namprd11.prod.outlook.com (2603:10b6:208:f8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4587.20; Tue, 12 Oct 2021 14:30:26 +0000 Received: from MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::304c:39f1:9d95:4ba2]) by MN2PR11MB3821.namprd11.prod.outlook.com ([fe80::304c:39f1:9d95:4ba2%6]) with mapi id 15.20.4587.026; Tue, 12 Oct 2021 14:30:26 +0000 From: "Power, Ciara" To: "Troy, Rebecca" , "dev@dpdk.org" CC: "Zhang, Roy Fan" , Akhil Goyal , "Doherty, Declan" Thread-Topic: [PATCH v3] cryptodev: add telemetry callbacks Thread-Index: AQHXu4U+cnSxAavGLkiiT80RgRz7XKvPcfDw Date: Tue, 12 Oct 2021 14:30:26 +0000 Message-ID: References: <20211007101748.556608-1-rebecca.troy@intel.com> <20211007141110.569739-1-rebecca.troy@intel.com> In-Reply-To: <20211007141110.569739-1-rebecca.troy@intel.com> Accept-Language: en-IE, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-version: 11.6.200.16 dlp-product: dlpe-windows dlp-reaction: no-action authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 50064c33-5d97-49af-c669-08d98d8cd55e x-ms-traffictypediagnostic: MN2PR11MB3822: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:6108; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: K538+KXUe/nrosxhGZ4b71gWhYn2F1402BkNPfp3mmrGrsWFheEk9qoVv5qLKY5EKgM+3GcKrQjXZQIx/+pjhTa9vEraOQggQo7H9jVYHg+n+KbaRrQ45hcAt8AM2Ns0bnJukDdguLZQmroLgwNfo7NbN9AdFHfyLW/o39HJ3HMrP3wcHWRZs9ZSJBm9Tf9cAkLKw3qOAUffFvSnqAf3ZV+JfauQ8RDcSzI+1FMT/2GqkCTJnMILAR/P+FdoUhk0lwFU6aZHHz52VBcKm2mzkSNZxDV1sjyO/qlSRS+iWl/tBSYwO0qvhSJ/vBQULqK8jxzesEpgkLXwrBukzG25hx32+gos/fmFnRhjMtLSYHaeSfrdbr7KhIgCB6vG7EeuX+bQLT/WMUwCyWFKVxSqOxcwq5yjwvYrFkmlY0q5FXr//bQ3QUL+XtkGmXGO5w38iM7MA5k7pGjejXw9RU0/ovL6q6vBU7bhj8VhNNFuibhk0A6FZhiyySuS7xF0LhGvRoOx/YNOfI30/K6bKl4QBEAhWLKCLqfnXCi9dtodiDB4t8xtLPM4BAHVaaoeKzKgX3SuS8jipJx3Ra37hupkCV9bebEgS6MCdY/DVdSS1K6kjtMx2/Nmxp6HRqERZVCChdeC/RyGJFTPQg758jU2bbXgues1NbOqUZqd4kpE82k5GeFyGlqINDyuQCoDUorzxB2lwo45Mxeuo15QyqSPsDPpU/Qb32XBN76BqM6dDNpJS2MNqKgsNbY8DERuJjElibQLkt6b9E6PS9UkKEbCABdCM+MV7KklnQN36IQnnjE= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:MN2PR11MB3821.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(66556008)(8936002)(107886003)(7696005)(55016002)(66476007)(26005)(508600001)(71200400001)(83380400001)(76116006)(9686003)(66946007)(33656002)(8676002)(4326008)(186003)(6506007)(316002)(64756008)(38070700005)(66446008)(2906002)(54906003)(110136005)(52536014)(122000001)(5660300002)(38100700002); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?9oHZFlSKjQwf+Y1GjiEuZif/saaAG24d0z6LLlkp8WaSa+AE100vKXOEiXUd?= =?us-ascii?Q?d5i8LM5zAvJCgawn5CVmJ9bZb4qkLrdODTkB1VnQHn4Qe6BvEI5bdDKH6Z7+?= =?us-ascii?Q?gjzM4d7mfmZSPd3zMHI3E5r0YaHtlKt66WbpQcJGofN15hHWNbcq+Jtylpbl?= =?us-ascii?Q?TeBi357+q1XA6HeftUFH91+f1rZmEN2FmAXgQWH6d7fpBnNuEXJAGsuzLbWy?= =?us-ascii?Q?MUDJ/+o/estcE+EePgzFWS8nyMJv4TvuFkZkl5+lRIwm6ACl3nCC8wuSrL8N?= =?us-ascii?Q?qqtbHSbE352DY3ltUntDY7uk9I7/qnkA6z6azgU4f7JC6BFgyf2Fm+bcTjom?= =?us-ascii?Q?l9SEYvqOv+v+7OxiRSky6i0AZrNoH8fa+eoMSJ1iuZZR7YBQVmdkRmZVJ7lN?= =?us-ascii?Q?sh6ZXltPNoPzzWeRTOov+MZS1HTgIOiJ5nLUc8Q3f2x/mTHFYYE8H/DepqD8?= =?us-ascii?Q?LlUSq2e6gAvBvN0ae2kfCkl0zOdP0DZznVrJyMeD0wPxzqvtIBpYJ4spb3TU?= =?us-ascii?Q?g2zpIJLzvId9yQlQnr3EGTooboVqsO6ybUf1YBaT0rdbZrFQuQJKem9MslWm?= =?us-ascii?Q?GDIeIW/zP/gGQ0qm21JC0vnLFx+JL6npg0Pmy6iTluKn+PXgrhBpvgz8tSPX?= =?us-ascii?Q?GcmpACzgXcJAJiUVjyVt2i9zwe6espz/gxe1gaNLZPdTEqm94OWG1ZlWxMJi?= =?us-ascii?Q?zDqor4dH8h9mjAPu7YxbQcl0KwnSCsBn+vPbiZO5OFEvx3m167GgZdlqGK+l?= =?us-ascii?Q?J+Semv9RJQTKrh//AOnaqWrVoWYkaF3FMwWjeSBE2mGE/N0MwkfELODvtEBj?= =?us-ascii?Q?Q/A6MyLTJabvsSVLn+OJwjpxQC6HIqnymeXOqH0Mwxce+0+Nk8jobxxfjm4O?= =?us-ascii?Q?YhWfsBv12/rcyTsizDRPuoiCAMvDVjNeGbp3MpWLWNmMIGiInMQMrqhQEz62?= =?us-ascii?Q?UPHa1CcbtomOEohEeIyrA+VdBFzsWceb2zOFrnk0ZgTZtDGabIXowyFIYfR+?= =?us-ascii?Q?2/CXmqAw2Bth9EefqsmyLz8tz+lASJHe2kC9S1uRl2QaizRvlDp1a3Q4gF+Q?= =?us-ascii?Q?pKmy9S8deTUvf3bOQnR6n6/FRsM4KMHZbPLPhywFN6I9zhE//RIi1g40JCjj?= =?us-ascii?Q?UdttdVv5IY0Cf05mV+PE7jM0971f13887BAdvmR5UGENV7oJXA+rNJID1UBL?= =?us-ascii?Q?v6H+V9RMsBy9ZydYalDQZA9Rp9npHojEBMYr3rNKiThkInqoMJE4sQfQAlQX?= =?us-ascii?Q?B5vAJplvQ7SCOZy/09tPvMyREoBFk8pRERwLIwqI6mqrGlO5EdtdKgL9jNLw?= =?us-ascii?Q?D5gL2f7BzPHdQAtGtr4aZdvZ?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN2PR11MB3821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 50064c33-5d97-49af-c669-08d98d8cd55e X-MS-Exchange-CrossTenant-originalarrivaltime: 12 Oct 2021 14:30:26.3262 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: Hrn3/Gkvm6McNCfpUFpLU0L2gtH7Y3Nb2Tezrvkt1trbJdSttpkvTBbYVwerRTOOytj7AI3/YdoljTYbifO54w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR11MB3822 X-OriginatorOrg: intel.com Subject: Re: [dpdk-dev] [PATCH v3] cryptodev: 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" Hi Becky, >-----Original Message----- >From: Troy, Rebecca >Sent: Thursday 7 October 2021 15:11 >To: dev@dpdk.org >Cc: Power, Ciara ; Zhang, Roy Fan >; Troy, Rebecca ; Akhil >Goyal ; Doherty, Declan >Subject: [PATCH v3] cryptodev: add telemetry callbacks > >The cryptodev library now registers commands with telemetry, and >implements the corresponding callback functions. These commands allow a >list of cryptodevs to be queried, as well as info and stats for the corres= ponding >cryptodev. > >An example usage can be seen below: > >Connecting to /var/run/dpdk/rte/dpdk_telemetry.v2 >{"version": "DPDK 21.11.0-rc0", "pid": 1135019, "max_output_len": 16384} >--> / >{"/": ["/", "/cryptodev/info", "/cryptodev/list", "/cryptodev/stats", ...]= } >--> /cryptodev/list >{"/cryptodev/list": [0,1,2,3]} >--> /cryptodev/info,0 >{"/cryptodev/info": {"device_name": "0000:1c:01.0_qat_sym", \ > "max_nb_queue_pairs": 2}} >--> /cryptodev/stats,0 >{"/cryptodev/stats": {"enqueued_count": 0, "dequeued_count": 0, \ > "enqueue_err_count": 0, "dequeue_err_count": 0}} > >Signed-off-by: Rebecca Troy > >--- >v3: > - Added missing version tag to patch. >v2: > - Added documentation and release notes. > - Changed the /cryptodev/list command to list the devices as an > array of IDs, rather than as names and IDs. > - Added the /cryptodev/info command as described above. >--- >--- > doc/guides/prog_guide/cryptodev_lib.rst | 30 ++++++++ >doc/guides/rel_notes/release_21_11.rst | 5 ++ > lib/cryptodev/rte_cryptodev.c | 92 +++++++++++++++++++++++++ > 3 files changed, 127 insertions(+) > >diff --git a/doc/guides/prog_guide/cryptodev_lib.rst >b/doc/guides/prog_guide/cryptodev_lib.rst >index 9b1cf8d49f..b94d3caa60 100644 >--- a/doc/guides/prog_guide/cryptodev_lib.rst >+++ b/doc/guides/prog_guide/cryptodev_lib.rst >@@ -1282,3 +1282,33 @@ Asymmetric Crypto Device API > > The cryptodev Library API is described in the `DPDK API Reference >`_ >+ >+ >+Device Statistics >+~~~~~~~~~~~~~~~~~ This header underline (~~~) means this section will be a subsection of "Asy= mmetric crypto Sample code", which isn't correct. I suggest changing the underline to "----" to move it up a level to be its = own section. >+ >+The Cryptodev library has support for displaying cryptodev information >+through the Telemetry interface. Telemetry commands that can be used >+are shown below. >+ >+#. Get the list of available Crypto devices by ID:: >+ >+ --> /cryptodev/list >+ {"/cryptodev/list": [0, 1, 2, 3]} >+ >+#. Get general information from a Crypto device:: >+ >+ --> /cryptodev/info,0 >+ {"/cryptodev/info": {"device_name": "0000:1c:01.0_qat_sym", >+ "max_nb_queue_pairs": 2}} >+ >+#. Get the statistics for a particular Crypto device:: >+ >+ --> /cryptodev/stats,0 >+ {"/cryptodev/stats": {"enqueued_count": 0, >+ "dequeued_count": 0, "enqueue_err_count": 0, >+ "dequeue_err_count": 0}} >+ >+ >+For more information on how to use the Telemetry interface, see the >+:doc:../howto/telemetry. There are ` symbols missing here, so this link doesn't work. Needs to be: :doc:`../howto/telemetry` >+static int >+cryptodev_handle_dev_info(const char *cmd __rte_unused, >+ const char *params, struct rte_tel_data *d) { >+ struct rte_cryptodev_info cryptodev_info; >+ int dev_id; >+ char *end_param; >+ >+ if (params =3D=3D NULL || strlen(params) =3D=3D 0 || !isdigit(*params)) >+ return -EINVAL; >+ >+ dev_id =3D strtoul(params, &end_param, 0); >+ if (*end_param !=3D '\0') >+ CDEV_LOG_ERR("Extra parameters passed to command, >ignoring"); >+ if (!rte_cryptodev_is_valid_dev(dev_id)) >+ return -1; Maybe -EINVAL return value would be better here, same comment for handle_de= v_stats function. Thanks, Ciara