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 1B014A0548; Thu, 4 Nov 2021 05:30:08 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D6AE340E5A; Thu, 4 Nov 2021 05:30:07 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 9EE7640DFD for ; Thu, 4 Nov 2021 05:30:06 +0100 (CET) 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 ESMTP id 1A3NW8ux028700; Wed, 3 Nov 2021 21:30:05 -0700 Received: from nam02-bn1-obe.outbound.protection.outlook.com (mail-bn1nam07lp2042.outbound.protection.outlook.com [104.47.51.42]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3c43sf0xbb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Nov 2021 21:29:59 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ixTgy8FLkIwo5jAk9nveIZjFU/VQORSH+f80V3QvzxcTXM/AeOdl2X+uH+QQ/zR2mTAb662tsHmDNVvZ4dXVKrjoqYljOPVeKhM79vXU04SedyGSHTa/s7qcs/vfphSdp/7ZzIuhYDENA/7PbuEruv0y5kLlePSayXjvD/MQf/aMjNMJluaDPTvi1RJ+CRyzlB+borKP4ZhcN9YVDJo/4IR+Oh3KqYGddXJZUfHyH2a6ZGnfAZVVJe5wJzipH0HOccTusyoa0otHv6QSFcqoNVv29wObz21aMt4ZFJU0UfjdyBRKYByJz8NaeZ1EnMWqBvTOaASsIh3ZFGg3UVAprg== 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=mCM9OaYJ3VPh2RuPeYpvn6A1NHXJ9lrFePTL1iy+PE4=; b=DZf52DeffDrVj+jt8k2RzB0I4dLPmRgxSB1eGtz2eh5Rb60H+5xLCxFEPnsIYxLcgH59t7umOk71ghLcJX29qjbu/3BlThPehahJB7GR2tFIhQjFgdFRRjYQBIh83AyNLeAeny78C//B7r/rgbqKt1gGsB34PfgtgNueY813TslmTQ8nwbIFi67t4sSqtUHwRiu6F45fOvmeqnNtywC5d4uiJHBOwRMZ+yitsN82LOxhSJUYRvxLTcdilUZ4npaH4d8TklsxOcCtV6Kz6KwvoCM/ccDiJtedpehots1y28UwxwR0WO/1om0fytB4wCPtU/h0tr4d2DF7TzA4bmJPgw== 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=mCM9OaYJ3VPh2RuPeYpvn6A1NHXJ9lrFePTL1iy+PE4=; b=i01jMlQEfSRe7zQNaxlgKHZ5XSG/nt6ly4UtOoqKk96SH9yyeOje0RtPFxfTikL65euNnAXi/QKzUNfihWFoPvBtC6b7Hw89/OaYKc+U7bSjhEKvmFzWr6ZyBhj6FC7pk70Bv+itD5sNJaCXonDP0EEzDMQ1bQ1VA0GtUPM/TME= Received: from CO1PR18MB4714.namprd18.prod.outlook.com (2603:10b6:303:e9::18) by CO3PR18MB4846.namprd18.prod.outlook.com (2603:10b6:303:179::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.11; Thu, 4 Nov 2021 04:29:57 +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.4649.019; Thu, 4 Nov 2021 04:29:57 +0000 From: Gowrishankar Muthukrishnan To: Akhil Goyal , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Anoob Joseph , "declan.doherty@intel.com" Thread-Topic: [v4] security: add telemetry endpoint for cryptodev security capabilities Thread-Index: AQHXz/lX33Ec+bvtR0uUauPq6yc6GqvyNKqAgACUeiA= Date: Thu, 4 Nov 2021 04:29:57 +0000 Message-ID: References: <4d0648e0347e8c6a4b2b095acf568faf6df135ca.1635864621.git.gmuthukrishn@marvell.com> In-Reply-To: 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: da3d220b-791a-45a5-6386-08d99f4bc211 x-ms-traffictypediagnostic: CO3PR18MB4846: 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: 0inu0v+y+62cQXFrOgm79xcm1stjmoKFagmqRuBUWJAKC6w9376Mf4e0IMzobXcO9ETHr8gMl/SARv81PN9L2x30lwOelAwuCK+UEq69taNZOADbOmpjyUfdC9g+Adi5nWZc8WNsLuszOsMePtYJRN1zBl76v324iDa2AVUZmXIGoChdAlXcaKm1U/sGZ4O32Q1F3KNEb19dXTDPcmdCraSr1vvBtM1bi2PeGZOks+QK9meA5bZJIwlPBIoIiFGpUUj9PKs5ygat3tr4dxdCm5U1gPtEg++mGCcwCOb5R22jNtbX14348d5WxSY85pfkIxkjenQ29c9EoEmF0CqOO7XdYU8Tv2mpxqNcg6AyiAeEjnAtiEwUUb5Lbs+8q2l6YBHnqmXCubYRIjeCptPGNFEdc0VP6AHtD1htbS5x6GS+woMVdAgBNQoZ44onprz73rjC+jksJ6cw4G5m6IjOHXgzr7iUNzblNCdUqBSyYhNXpU62WC5xpJz0WZb/qOAYQgbVsYWNlv/YvpM5fQjNJvZ/FBhjet/hdh972QkvbzCMhBf3V75OfsMKIwBaDDZMGIh8YIE6D1ZjqXoAHpO1LddSEMac10FK9Hu751VbYslE1VXTsK7MBPy/FLvX1rUQcv5inONJVzgRIrkTVGuyHVHqYkIYMWVi8/RTT97FDtDdzEuVLGQLKT+EUAzy+uEqJ+LQSGQHapfRvFS7g60XZg== 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)(66946007)(66446008)(71200400001)(6506007)(64756008)(508600001)(66476007)(66556008)(2906002)(15650500001)(83380400001)(76116006)(4326008)(5660300002)(186003)(38100700002)(9686003)(38070700005)(8676002)(86362001)(26005)(55016002)(122000001)(316002)(52536014)(7696005)(110136005)(8936002)(54906003)(33656002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?ZbPRgfb7YOIAZOymm9gPOyuLWGXDiopgA+7LFaVNEFBn5/EIw2qio9TzNSWd?= =?us-ascii?Q?79EihTQ652xVFYrZpigkXlzrcKyiRj1zqA9MU8hVBZ6ZE7wa5SSW3vPqMmHV?= =?us-ascii?Q?Vv31iMDsWjP7PMeR8Go6uHSQFX10xTqqZBXiEwWAsmuQ4QQBQgym9zAqUjDx?= =?us-ascii?Q?ohBUUmmEQmAtXnvOiR/7pcAM0vomKnYvsk0aMauVZsbvVfgxRsXIF5V6XbmS?= =?us-ascii?Q?NxvUkFt37dC7H6DpxdeRhYNiy96BDf63ZoaEFUf7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GvQw7weOUqXnIoM6S/AUEfZ+Xm4iU+VfZLV2R+DALhAUwHdyQk?= =?us-ascii?Q?o9rzJBzRjTG7uMDWmIPG1i3zzK1RlC05OBHBawZ25aq3ANG7d26u34pcCCrj?= =?us-ascii?Q?retHdkJf+juNmIYPcxXKldlp0QQ6WZDqyOoBfW2KjoxpX3WOUWBZDrSWI4HT?= =?us-ascii?Q?+lpHhB9yF/D9W2NcR66r/rtCOD2NGr9hQi3p48ffbMeUXPFC1lhL9O9XFvpG?= =?us-ascii?Q?Je90W9JwTr/Dy4S83eZlesT+rvU3YvqRhaI9PjuvknS+sf4LwDcrivw6tig5?= =?us-ascii?Q?k8yzB7q7SSXno2311fdF3HW+JUHUtTXOia2PYJwHPSYGD6vYoQlJbSbFr6x+?= =?us-ascii?Q?rORhfSdMFVtE+vIPJg3NH4fGm23ShUf7DgPWuSUzi8Tmqwo8po3gtyttzF85?= =?us-ascii?Q?aGCKs/E0ROoUYIBg7sD8vrPTNoY0SH7Zi059KESWTZFyRhFXEefuV15s+5IR?= =?us-ascii?Q?6HmJ50xUOJcwTtiy7+KgFTtituLbio+YqvdZLuNKXhVcncbxYwfxu+xc9DI/?= =?us-ascii?Q?9xbKig=3D=3D?= 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: da3d220b-791a-45a5-6386-08d99f4bc211 X-MS-Exchange-CrossTenant-originalarrivaltime: 04 Nov 2021 04:29:57.5126 (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: meeSSel9CjHZ1giy87q7Ylc0k9blNLIy1VwXXahvKd66agMnQH+jktYboqWSpn/JdRMLzz1eT2tnV9bZpkeua/MwVu/P9P0sO8CNwo5AO9E= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO3PR18MB4846 X-Proofpoint-ORIG-GUID: rGazSr6ELfMi6mW72GtMWqKRpbDK85q- X-Proofpoint-GUID: rGazSr6ELfMi6mW72GtMWqKRpbDK85q- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475 definitions=2021-11-04_01,2021-11-03_01,2020-04-07_01 Subject: Re: [dpdk-dev] [v4] security: add telemetry endpoint for cryptodev security capabilities 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" >=20 > > +static int > > +security_handle_cryptodev_crypto_caps(const char *cmd __rte_unused, > > const char *params, > > + struct rte_tel_data *d) > > +{ > > + const struct rte_security_capability *capabilities; > > + struct rte_tel_data *crypto_caps; > > + const char *capa_param; > > + int dev_id, capa_id; > > + int crypto_caps_n; > > + char *end_param; > > + int rc; > > + > > + if (!params || strlen(params) =3D=3D 0 || !isdigit(*params)) > > + return -EINVAL; > > + > > + dev_id =3D strtoul(params, &end_param, 0); > > + capa_param =3D strtok(end_param, ","); > > + if (!capa_param || strlen(capa_param) =3D=3D 0 || > > !isdigit(*capa_param)) > > + return -EINVAL; > > + > > + capa_id =3D strtoul(capa_param, &end_param, 0); > > + if (*end_param !=3D '\0') > > + CDEV_LOG_ERR("Extra parameters passed to command, > > ignoring"); > > + > > + rc =3D security_capabilities_from_dev_id(dev_id, (void *)&capabilitie= s); > > + if (rc < 0) > > + return rc; > > + > > + crypto_caps =3D rte_tel_data_alloc(); > > + RTE_PTR_OR_ERR_RET(crypto_caps, -ENOMEM); > > + > > + rte_tel_data_start_dict(d); > > + crypto_caps_n =3D crypto_caps_array(crypto_caps, capabilities- > > >crypto_capabilities); > > + if (capa_id >=3D crypto_caps_n) { > > + CDEV_LOG_ERR("Extra parameters passed to command, > > ignoring"); > > + return -EINVAL; > > + } >=20 > Something is not correct here. > Capa_id is not getting used properly. > Security_capabilities should be traversed until capa_id and then extract = The > corresponding crypto capabilities. Right? >=20 Yeah right. Fixing it. Thanks, Gowrishankar >=20 > > + > > + rte_tel_data_add_dict_container(d, "crypto_caps", crypto_caps, 0); > > + rte_tel_data_add_dict_int(d, "crypto_caps_n", crypto_caps_n); > > + > > + return 0; > > +} > > + > > +RTE_INIT(security_init_telemetry) > > +{ > > + rte_telemetry_register_cmd("/security/cryptodev/list", > > + security_handle_cryptodev_list, > > + "Returns list of available crypto devices by IDs. No > > parameters."); > > + > > + rte_telemetry_register_cmd("/security/cryptodev/sec_caps", > > + security_handle_cryptodev_sec_caps, > > + "Returns security capabilities for a cryptodev. Parameters: int > > dev_id"); > > + > > + rte_telemetry_register_cmd("/security/cryptodev/crypto_caps", > > + security_handle_cryptodev_crypto_caps, > > + "Returns crypto capabilities for a security capability. > > Parameters: int dev_id, sec_cap_id"); > > +} > > -- > > 2.25.1