Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/102667/?format=api
https://patches.dpdk.org/api/patches/102667/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/0d6b08d9e79545a358396b8792ecfef87ffd851d.1634907297.git.gmuthukrishn@marvell.com/", "project": { "id": 1, "url": "https://patches.dpdk.org/api/projects/1/?format=api", "name": "DPDK", "link_name": "dpdk", "list_id": "dev.dpdk.org", "list_email": "dev@dpdk.org", "web_url": "http://core.dpdk.org", "scm_url": "git://dpdk.org/dpdk", "webscm_url": "http://git.dpdk.org/dpdk", "list_archive_url": "https://inbox.dpdk.org/dev", "list_archive_url_format": "https://inbox.dpdk.org/dev/{}", "commit_url_format": "" }, "msgid": "<0d6b08d9e79545a358396b8792ecfef87ffd851d.1634907297.git.gmuthukrishn@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/0d6b08d9e79545a358396b8792ecfef87ffd851d.1634907297.git.gmuthukrishn@marvell.com", "date": "2021-10-22T12:59:03", "name": "[v6] crypto/cnxk: add telemetry endpoints to cryptodev", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7a8823fb27ddf39ed8dcbf96d4e3f6ed51905031", "submitter": { "id": 2301, "url": "https://patches.dpdk.org/api/people/2301/?format=api", "name": "Gowrishankar Muthukrishnan", "email": "gmuthukrishn@marvell.com" }, "delegate": { "id": 6690, "url": "https://patches.dpdk.org/api/users/6690/?format=api", "username": "akhil", "first_name": "akhil", "last_name": "goyal", "email": "gakhil@marvell.com" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/0d6b08d9e79545a358396b8792ecfef87ffd851d.1634907297.git.gmuthukrishn@marvell.com/mbox/", "series": [ { "id": 19917, "url": "https://patches.dpdk.org/api/series/19917/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=19917", "date": "2021-10-22T12:59:03", "name": "[v6] crypto/cnxk: add telemetry endpoints to cryptodev", "version": 6, "mbox": "https://patches.dpdk.org/series/19917/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/102667/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/102667/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@inbox.dpdk.org", "Delivered-To": "patchwork@inbox.dpdk.org", "Received": [ "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 36DDCA0C43;\n\tFri, 22 Oct 2021 14:59:12 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 256054114A;\n\tFri, 22 Oct 2021 14:59:12 +0200 (CEST)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 480A041149\n for <dev@dpdk.org>; Fri, 22 Oct 2021 14:59:10 +0200 (CEST)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 19M9qIp3011081\n for <dev@dpdk.org>; Fri, 22 Oct 2021 05:59:08 -0700", "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 3buu23rneq-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Fri, 22 Oct 2021 05:59:08 -0700", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Fri, 22 Oct 2021 05:59:07 -0700", "from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Fri, 22 Oct 2021 05:59:07 -0700", "from localhost.localdomain (unknown [10.28.34.38])\n by maili.marvell.com (Postfix) with ESMTP id 52AA83F7073;\n Fri, 22 Oct 2021 05:59:05 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=EZrAc+CSqRty9992z0yJAzP8Uc4H3bI4sRNThOYQc0Q=;\n b=JMYiKWj69GynMX4OmrTYZoxOj0ehyxgwbAxE9gXq/JYvsOLndDbAb91D5B+ACnL9rEhx\n BLCEPHm18YTRIfbgYIEEjwAxeD83zprnQd7kjLSq0Jq3A5fNoVbV2ewMA07KL2flMF7+\n dkmVR5qgRrW5/Hmh7xK2akZZscrmg4wPtKi+XXYU4/3+0kmnxfj1AIlpi0YHAWnm2dJj\n XKM9d8p7vFne/6wVtRVaZb5rSBaifQQh54UemP0PhNaR7wTrECvmTPGV3OEMYvaAjWy2\n MP1IwpDuonAvwbTyNZ7VPo7cdfjgcfCK6AUtIdxYGkNaDnrUl3H73K9vWxSUQimUYk2v GQ==", "From": "Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>", "To": "<dev@dpdk.org>", "CC": "<jerinj@marvell.com>, <gakhil@marvell.com>, <anoobj@marvell.com>,\n <adwivedi@marvell.com>, <ktejasree@marvell.com>, Gowrishankar Muthukrishnan\n <gmuthukrishn@marvell.com>", "Date": "Fri, 22 Oct 2021 18:29:03 +0530", "Message-ID": "\n <0d6b08d9e79545a358396b8792ecfef87ffd851d.1634907297.git.gmuthukrishn@marvell.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "\n <87d43771c47598181851bd6ec6897859d8bba50a.1634905387.git.gmuthukrishn@marvell.com>", "References": "\n <87d43771c47598181851bd6ec6897859d8bba50a.1634905387.git.gmuthukrishn@marvell.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Content-Type": "text/plain", "X-Proofpoint-GUID": "XCaA-x8Pp5ja2i8XGdMcM-2FWr-BhO3P", "X-Proofpoint-ORIG-GUID": "XCaA-x8Pp5ja2i8XGdMcM-2FWr-BhO3P", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.182.1,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.0.607.475\n definitions=2021-10-22_03,2021-10-22_01,2020-04-07_01", "Subject": "[dpdk-dev] [v6] crypto/cnxk: add telemetry endpoints to cryptodev", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.29", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://mails.dpdk.org/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add telemetry endpoints to cryptodev.\n\nSigned-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>\n---\nDepends-on: patch-19601 (\"cryptodev: add telemetry callbacks\")\nDepends-on: patch-19915 (\"cryptodev: add telemetry endpoint for cryptodev capabilities\")\n\nv6:\n - checkpatch fixes.\n---\n .../crypto/cnxk/cnxk_cryptodev_telemetry.c | 122 ++++++++++++++++++\n drivers/crypto/cnxk/meson.build | 1 +\n 2 files changed, 123 insertions(+)\n create mode 100644 drivers/crypto/cnxk/cnxk_cryptodev_telemetry.c", "diff": "diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_telemetry.c b/drivers/crypto/cnxk/cnxk_cryptodev_telemetry.c\nnew file mode 100644\nindex 0000000000..d44dd82ea8\n--- /dev/null\n+++ b/drivers/crypto/cnxk/cnxk_cryptodev_telemetry.c\n@@ -0,0 +1,122 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2021 Marvell.\n+ */\n+\n+#include <rte_cryptodev.h>\n+#include <rte_telemetry.h>\n+#include <cryptodev_pmd.h>\n+\n+#include <cnxk_telemetry.h>\n+#include <roc_api.h>\n+\n+#include \"cnxk_cryptodev.h\"\n+\n+#define CRYPTO_CAPS_SZ \\\n+\t(RTE_ALIGN_CEIL(sizeof(struct rte_cryptodev_capabilities), \\\n+\t\t\t\t\tsizeof(uint64_t)) / \\\n+\t sizeof(uint64_t))\n+\n+#define SEC_CAPS_SZ \\\n+\t(RTE_ALIGN_CEIL(sizeof(struct rte_security_capability), \\\n+\t\t\t\t\tsizeof(uint64_t)) / \\\n+\t sizeof(uint64_t))\n+\n+static int\n+crypto_caps_array(struct rte_tel_data *d,\n+\t\t struct rte_cryptodev_capabilities *dev_caps,\n+\t\t size_t dev_caps_n)\n+{\n+\tunion caps_u {\n+\t\tstruct rte_cryptodev_capabilities dev_caps;\n+\t\tuint64_t val[CRYPTO_CAPS_SZ];\n+\t} caps;\n+\tunsigned int i, j, n = 0;\n+\n+\trte_tel_data_start_array(d, RTE_TEL_U64_VAL);\n+\n+\tfor (i = 0; i < dev_caps_n; i++) {\n+\t\tif (dev_caps[i].op == RTE_CRYPTO_OP_TYPE_UNDEFINED)\n+\t\t\tbreak;\n+\n+\t\tmemset(&caps, 0, sizeof(caps));\n+\t\trte_memcpy(&caps.dev_caps, &dev_caps[i], sizeof(dev_caps[0]));\n+\t\tfor (j = 0; j < CRYPTO_CAPS_SZ; j++)\n+\t\t\trte_tel_data_add_array_u64(d, caps.val[j]);\n+\t\t++n;\n+\t}\n+\n+\treturn n;\n+}\n+\n+static int\n+sec_caps_array(struct rte_tel_data *d, struct rte_security_capability *dev_caps,\n+\t size_t dev_caps_n)\n+{\n+\tunion caps_u {\n+\t\tstruct rte_security_capability dev_caps;\n+\t\tuint64_t val[SEC_CAPS_SZ];\n+\t} caps;\n+\tunsigned int i, j, n = 0;\n+\n+\trte_tel_data_start_array(d, RTE_TEL_U64_VAL);\n+\n+\tfor (i = 0; i < dev_caps_n; i++) {\n+\t\tmemset(&caps, 0, sizeof(caps));\n+\t\trte_memcpy(&caps.dev_caps, &dev_caps[i], sizeof(dev_caps[0]));\n+\t\tfor (j = 0; j < SEC_CAPS_SZ; j++)\n+\t\t\trte_tel_data_add_array_u64(d, caps.val[j]);\n+\t\t++n;\n+\t}\n+\n+\treturn n;\n+}\n+\n+static int\n+cryptodev_tel_handle_caps(const char *cmd __rte_unused, const char *params,\n+\t\t\t struct rte_tel_data *d)\n+{\n+\tstruct rte_tel_data *sec_crypto_caps, *sec_caps;\n+\tint sec_crypto_caps_n, sec_caps_n;\n+\tstruct rte_cryptodev *dev;\n+\tstruct cnxk_cpt_vf *vf;\n+\tint dev_id;\n+\n+\tif (!params || strlen(params) == 0 || !isdigit(*params))\n+\t\treturn -EINVAL;\n+\n+\tdev_id = strtol(params, NULL, 10);\n+\tif (!rte_cryptodev_is_valid_dev(dev_id))\n+\t\treturn -EINVAL;\n+\n+\tdev = rte_cryptodev_pmd_get_dev(dev_id);\n+\tif (!dev) {\n+\t\tplt_err(\"No cryptodev for id %d available\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tvf = dev->data->dev_private;\n+\trte_tel_data_start_dict(d);\n+\n+\t/* Security Crypto capabilities */\n+\tsec_crypto_caps = rte_tel_data_alloc();\n+\tsec_crypto_caps_n = crypto_caps_array(\n+\t\tsec_crypto_caps, vf->sec_crypto_caps, CNXK_SEC_CRYPTO_MAX_CAPS);\n+\trte_tel_data_add_dict_container(d, \"sec_crypto_caps\", sec_crypto_caps,\n+\t\t\t\t\t0);\n+\trte_tel_data_add_dict_int(d, \"sec_crypto_caps_n\", sec_crypto_caps_n);\n+\n+\t/* Security capabilities */\n+\tsec_caps = rte_tel_data_alloc();\n+\tsec_caps_n = sec_caps_array(sec_caps, vf->sec_caps, CNXK_SEC_MAX_CAPS);\n+\trte_tel_data_add_dict_container(d, \"sec_caps\", sec_caps, 0);\n+\trte_tel_data_add_dict_int(d, \"sec_caps_n\", sec_caps_n);\n+\n+\treturn 0;\n+}\n+\n+RTE_INIT(cnxk_cryptodev_init_telemetry)\n+{\n+\trte_telemetry_register_cmd(\n+\t\t\"/cnxk/cryptodev/caps\", cryptodev_tel_handle_caps,\n+\t\t\"Returns cryptodev capabilities. Parameters: int dev_id\");\n+}\ndiff --git a/drivers/crypto/cnxk/meson.build b/drivers/crypto/cnxk/meson.build\nindex 024109f7e9..2d78757bba 100644\n--- a/drivers/crypto/cnxk/meson.build\n+++ b/drivers/crypto/cnxk/meson.build\n@@ -20,6 +20,7 @@ sources = files(\n 'cnxk_cryptodev_devargs.c',\n 'cnxk_cryptodev_ops.c',\n 'cnxk_cryptodev_sec.c',\n+ 'cnxk_cryptodev_telemetry.c',\n )\n \n deps += ['bus_pci', 'common_cnxk', 'security', 'eventdev']\n", "prefixes": [ "v6" ] }{ "id": 102667, "url": "