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 0B72BA0C47; Wed, 3 Nov 2021 20:38:06 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 9D63E40E0F; Wed, 3 Nov 2021 20:38:05 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id D597440689 for ; Wed, 3 Nov 2021 20:38:03 +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 1A3C3Ljb012640; Wed, 3 Nov 2021 12:38:03 -0700 Received: from nam02-dm3-obe.outbound.protection.outlook.com (mail-dm3nam07lp2040.outbound.protection.outlook.com [104.47.56.40]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3c3dd8dbpd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 03 Nov 2021 12:38:02 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PVs29tUTg08/ZUce7vqSQ2DLK75N2knv7hSJIPJEGg2fRNOFzwbtdQoYY0hKvCtCOxTKJJTUmZSK8j5hwSdLK8vKmSsbfWotjNnaCaqfbk+vE3adLVy8uy5RBCcM1volTm9h62blVc34D2Cm93pwNZapOWL2s66edTpHSb4yWM441FGIfCj0p7RjqkI2yxoFr/+Fg9DltVbsDO3ZQXZtIrU867YcMz2e0YsntRRhSDXbtbu431cE2MbDkf8XZg24ECcK8y9sg5UeswBiy4MyJqPz4+G44IHg+yT6pe7GrTASinvlGrwuyFaAaspscYkygxWvhb0x7XWKAduZEhJGkg== 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=+RHIGFOcH7LRbWEimURki84SahfkqIrtTgGlZYeQR8Q=; b=WHWx2ml4s7wcEZYDcwygOT3Cb5gy7Ik/N5WaPSU+7NKPFlug0xf5Ygn0RVWwuHUi9GQlfydoeWRd9SM9rGeYFluVO2az4hI73fbNZ1sBP6ph2TgCPthhomQx/TYtn4YeQm/a9QyrEOfpOtqXP7oRvILktgiG/na4Fsvw1ZaLAe9In5oC+Q7PlZCzM5CoZcv9U9Fa+bTGj3r00e2ivNZtnbTuv6OlqPlznY3lqrWiCsVgiPUkfV7EzdFeX5mB1HU1/3weYHW1HfSVMRmMqRNFpWVSas3/7SUfmtP8Eyeqd9h1O9jopVFjf09j8yUKbm994pkrt6hSRi2JudTeaDhtWg== 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=+RHIGFOcH7LRbWEimURki84SahfkqIrtTgGlZYeQR8Q=; b=PKjZocxas4A8t2KrDxJNuxDcLj6825VJHXYNiE/l0MamDndwUmq8Pm6tB+6ymTqictPvs8aD7MEDeoDc2wtWc3ZX6WsIu7Tqwr2n96z/6yIOmu8gTR2QEx0NfwMWYN9hMPHLwBZUSrMapWG9rzpncskMcfITO63ap2+bWYXSIv0= Received: from CO6PR18MB4484.namprd18.prod.outlook.com (2603:10b6:5:359::9) by CO1PR18MB4793.namprd18.prod.outlook.com (2603:10b6:303:ec::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4669.10; Wed, 3 Nov 2021 19:38:00 +0000 Received: from CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8]) by CO6PR18MB4484.namprd18.prod.outlook.com ([fe80::c41e:707:3f91:71b8%8]) with mapi id 15.20.4669.011; Wed, 3 Nov 2021 19:37:59 +0000 From: Akhil Goyal To: Gowrishankar Muthukrishnan , "dev@dpdk.org" CC: Jerin Jacob Kollanukkaran , Anoob Joseph , "declan.doherty@intel.com" , Gowrishankar Muthukrishnan Thread-Topic: [v4] security: add telemetry endpoint for cryptodev security capabilities Thread-Index: AQHXz/lXWsRu5yF8HEWjqchBtXM04avyM9gA Date: Wed, 3 Nov 2021 19:37:59 +0000 Message-ID: References: <4d0648e0347e8c6a4b2b095acf568faf6df135ca.1635864621.git.gmuthukrishn@marvell.com> In-Reply-To: <4d0648e0347e8c6a4b2b095acf568faf6df135ca.1635864621.git.gmuthukrishn@marvell.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: 06e998bf-dcd6-4a18-0a55-08d99f0171a0 x-ms-traffictypediagnostic: CO1PR18MB4793: 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: rds4XTq8L5IiYeYfjf4AWobUOYUbuXOzOt8f4OBeFb4/OB836G1iwhvZkf73km8hRs1jSEWhxvMzZqvHjD45fPzHWxCHFQ93buWesAsJ/Osx0Y8rEzTRusTMomk1lybbPbHCmWOEdTvWtH00lXtZe+rB+E8sUZX1Ni/b0Ls5YU0FomxTInsYtavx/yR3lrFcvQC4qe1hMsxGAhqe7rW7By9WH4aazcp2Be6NaqD/Z+e/Q85Wg1Dm1Hk3Qq2lvc/tzcaTtaQ1uq3ukNZdfnHr1OyU8El5OFqVFV9rjxNmnSKrFJP2KCZM1Mil4ssZuOEBsDgnE36AQu7Ylp9zcOA9VNoHhxwxQcLwM4hQCgfU4NSkmAGnNRzG8e9TJvnEA9aS9vdb7xFKWK0+Oulg2WGE73KxIymnu1WOdeka2BLwPgKKs3YqnCOlaibetVLhe1kSxryabr7oQE1BSddor7EokT9oDHP4pgt/Gy4uTil4TXWQeU2OM5pm7cPt9eUh/EnnSDETCD9n3/2XxARRHCzqQnhRm75p2kJZLC4jZZkKV3olKTFZprH/T87LGFkWor6Oy72k9UYFOheokV2vtkbZQ3vJE8zBqXOinTO45NHk4yqmpNI7ct4x9pgBNLDVtXopxckaJ19uRXxHy3U4LdNlT/DsYcTYBwV+bl6ur/zcanKHmIOSp+jJOe8Ms03OvhZd8aKMlNGG1gCrZe3nfdCQgw== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:CO6PR18MB4484.namprd18.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(86362001)(186003)(2906002)(38070700005)(6506007)(122000001)(8676002)(55236004)(7696005)(26005)(66556008)(66476007)(52536014)(8936002)(316002)(71200400001)(33656002)(5660300002)(55016002)(76116006)(110136005)(66946007)(64756008)(38100700002)(66446008)(9686003)(4326008)(107886003)(15650500001)(54906003)(83380400001)(508600001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?JzJe+5yNm8hEbeUUj+rELgHN4UEeZhfpzb8DHZQDkrufyEsYFa1/auLS5ifR?= =?us-ascii?Q?mY8qg5oIyhvR0EZj1VnDJoKhX25/IOOuN7DcXNUYc5Zg7fbZC1Q1sR/z3EhZ?= =?us-ascii?Q?6By6UjEaqW6jT1p4fyjNgThm1/jSuWS/uQLESR9bvN74ONF+VHQDDmO+apo0?= =?us-ascii?Q?R+s0d91cAThps3DNiiK9Og8YJwxrYBJ5LQwYo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EJ878e5O5WuloGi9zk0YYxqbu0D4KS43vdHdEBVe+H5daBmNpNs9hcQBN?= =?us-ascii?Q?V8NFyDmfMSbDjwrsjKmifUk9V6BxpkHENF3ZoAA0LIBA7PmKcv/Vq2Abz61n?= =?us-ascii?Q?j60ZlgZG6sem467QauckZ8AS/ntYNC5fAAABnUDpfNeK+lbwOEb8dQrzc6G5?= =?us-ascii?Q?NZ/rXw+NVr6zH2n64MoWaAuSFQzD6sbH6aJRzr6155jMPGM4ILHvvB4Mv795?= =?us-ascii?Q?QoORFeox/H1xf4rztPYzx5VvoTMrtNugykxuGuOYvPZjBYABb1HjAAyWTQ7G?= =?us-ascii?Q?7CKB7VFu8GFC9IgaeHXeAnXEC4Re4FK66gfBtBEbfgk3TE1UrZpZE70RrBtG?= =?us-ascii?Q?sovUdfsbXv1u7aHlxzekLTPAp7rsQlscyqySiSAQVJWYHnr9X+08BfS7vpP1?= =?us-ascii?Q?aVm4gTODRT0CY4AmK1boADOT5BvMwYcbglXF0hxWq6ROa3jEar5E7+5jbFUI?= =?us-ascii?Q?EJAI8PgIxoFzhlKazu8K6Pbq7L60JvkzHm0zjdoloaIV30hdd5xfOO8gG37Z?= =?us-ascii?Q?F04cvxnbAK+6b1Kcb2IhlQA=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: CO6PR18MB4484.namprd18.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 06e998bf-dcd6-4a18-0a55-08d99f0171a0 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Nov 2021 19:37:59.6298 (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: fX7Mu1ZcsWy09u7L1hlmmhkqKp9sU51Ro1IrpxnHWXP4lv5aVdqgIDERsIJl7ew2PJiFovIXeeABsWzMKb0uFg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR18MB4793 X-Proofpoint-ORIG-GUID: Mhn8_lKIZZv2m01igGrCWLDl1OFXO41p X-Proofpoint-GUID: Mhn8_lKIZZv2m01igGrCWLDl1OFXO41p 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-03_06,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" > +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 *)&capabilities)= ; > + 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; > + } 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? > + > + 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