Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/122812/?format=api
http://patches.dpdk.org/api/patches/122812/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230201092310.23252-4-syalavarthi@marvell.com/", "project": { "id": 1, "url": "http://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": "<20230201092310.23252-4-syalavarthi@marvell.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230201092310.23252-4-syalavarthi@marvell.com", "date": "2023-02-01T09:22:34", "name": "[v4,03/39] ml/cnxk: enable probe and remove of ML device", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "f925338ae14fbbfade6242524f64bf6e55cec77e", "submitter": { "id": 2480, "url": "http://patches.dpdk.org/api/people/2480/?format=api", "name": "Srikanth Yalavarthi", "email": "syalavarthi@marvell.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230201092310.23252-4-syalavarthi@marvell.com/mbox/", "series": [ { "id": 26732, "url": "http://patches.dpdk.org/api/series/26732/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26732", "date": "2023-02-01T09:22:31", "name": "Implementation of ML CNXK driver", "version": 4, "mbox": "http://patches.dpdk.org/series/26732/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/122812/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/122812/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 9B69941B9D;\n\tWed, 1 Feb 2023 10:23:31 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1D0EF42D3D;\n\tWed, 1 Feb 2023 10:23:20 +0100 (CET)", "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174])\n by mails.dpdk.org (Postfix) with ESMTP id 87214406A2\n for <dev@dpdk.org>; Wed, 1 Feb 2023 10:23:16 +0100 (CET)", "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 3116Lf5W026253; Wed, 1 Feb 2023 01:23:15 -0800", "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3nfjr8rgv2-3\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Wed, 01 Feb 2023 01:23:15 -0800", "from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.42;\n Wed, 1 Feb 2023 01:23:14 -0800", "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.42 via Frontend\n Transport; Wed, 1 Feb 2023 01:23:14 -0800", "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id CA5BB3F7041;\n Wed, 1 Feb 2023 01:23:13 -0800 (PST)" ], "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-type; s=pfpt0220; bh=2SFZ1LQtLSDaUp9R90Y+TQ7Qvd4L640wiK/wG5NVntc=;\n b=DURHElCnjctsTOe5h2ih6R35pbK7Sz9RLK92ltI/HTIpSJTMOqeTIQSb3EgQ0wdYZpe1\n HmwmCjKgCCKsVgu6N0Qnzeu3cPSInQ0mRP4xIvpD2jQjSV0Cj/OIchGm26/oQsagUFkz\n 4N67ql/Bm9yFIUaI7XmKR6udYHwxKtkRx5M2HoapVDep7DPWgZluHBFJvVOxFxPodx3m\n hXtLx5o5hGaLc4U8QW7suAyRhjn25AJ/SKjM9e7inhHzeCip/djnnNUPZjrM+aBsf112\n fUxO9VkVZoQT2jZ0uoRwJgfliDpdZ2RpP8AlNwlVzd5zOPRMTGDTOLM/5rSlwg8X8ppb 2w==", "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>", "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>, Anatoly Burakov\n <anatoly.burakov@intel.com>", "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>,\n <aprabhu@marvell.com>", "Subject": "[PATCH v4 03/39] ml/cnxk: enable probe and remove of ML device", "Date": "Wed, 1 Feb 2023 01:22:34 -0800", "Message-ID": "<20230201092310.23252-4-syalavarthi@marvell.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20230201092310.23252-1-syalavarthi@marvell.com>", "References": "<20221208200220.20267-1-syalavarthi@marvell.com>\n <20230201092310.23252-1-syalavarthi@marvell.com>", "MIME-Version": "1.0", "Content-Type": "text/plain", "X-Proofpoint-GUID": "jjuQllKxLe3ZRIVj4ukPZ9Qd6j7Nynz0", "X-Proofpoint-ORIG-GUID": "jjuQllKxLe3ZRIVj4ukPZ9Qd6j7Nynz0", "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1\n definitions=2023-02-01_03,2023-01-31_01,2022-06-22_01", "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" }, "content": "ML inference engine on cn10k platform is a PCI based device. Added\ndriver support to probe and remove the device for cn10k poll mode\ndriver. The device is named by the PMD as \"ml_cn10k\".\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cn10k_ml_dev.c | 114 +++++++++++++++++++++++++++++++++\n drivers/ml/cnxk/cn10k_ml_dev.h | 11 ++++\n drivers/ml/cnxk/cn10k_ml_ops.c | 10 +++\n drivers/ml/cnxk/cn10k_ml_ops.h | 11 ++++\n drivers/ml/cnxk/meson.build | 2 +\n 5 files changed, 148 insertions(+)\n create mode 100644 drivers/ml/cnxk/cn10k_ml_ops.c\n create mode 100644 drivers/ml/cnxk/cn10k_ml_ops.h", "diff": "diff --git a/drivers/ml/cnxk/cn10k_ml_dev.c b/drivers/ml/cnxk/cn10k_ml_dev.c\nindex cc96a7bdb3..c2e93c9a1a 100644\n--- a/drivers/ml/cnxk/cn10k_ml_dev.c\n+++ b/drivers/ml/cnxk/cn10k_ml_dev.c\n@@ -2,7 +2,121 @@\n * Copyright (c) 2022 Marvell.\n */\n \n+#include <rte_common.h>\n+#include <rte_dev.h>\n #include <rte_mldev.h>\n #include <rte_mldev_pmd.h>\n+#include <rte_pci.h>\n+\n+#include <roc_api.h>\n \n #include \"cn10k_ml_dev.h\"\n+#include \"cn10k_ml_ops.h\"\n+\n+/* Dummy operations for ML device */\n+struct rte_ml_dev_ops ml_dev_dummy_ops = {0};\n+\n+static int\n+cn10k_ml_pci_probe(struct rte_pci_driver *pci_drv, struct rte_pci_device *pci_dev)\n+{\n+\tstruct rte_ml_dev_pmd_init_params init_params;\n+\tstruct cn10k_ml_dev *mldev;\n+\tchar name[RTE_ML_STR_MAX];\n+\tstruct rte_ml_dev *dev;\n+\tint ret;\n+\n+\tPLT_SET_USED(pci_drv);\n+\n+\tinit_params = (struct rte_ml_dev_pmd_init_params){\n+\t\t.socket_id = rte_socket_id(), .private_data_size = sizeof(struct cn10k_ml_dev)};\n+\n+\tret = roc_plt_init();\n+\tif (ret < 0) {\n+\t\tplt_err(\"Failed to initialize platform model\");\n+\t\treturn ret;\n+\t}\n+\n+\trte_pci_device_name(&pci_dev->addr, name, sizeof(name));\n+\tdev = rte_ml_dev_pmd_create(name, &pci_dev->device, &init_params);\n+\tif (dev == NULL) {\n+\t\tret = -ENODEV;\n+\t\tgoto error_exit;\n+\t}\n+\n+\t/* Get private data space allocated */\n+\tmldev = dev->data->dev_private;\n+\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\tmldev->roc.pci_dev = pci_dev;\n+\n+\t\tret = roc_ml_dev_init(&mldev->roc);\n+\t\tif (ret) {\n+\t\t\tplt_err(\"Failed to initialize ML ROC, ret = %d\", ret);\n+\t\t\tgoto pmd_destroy;\n+\t\t}\n+\n+\t\tdev->dev_ops = &cn10k_ml_ops;\n+\t} else {\n+\t\tplt_err(\"CN10K ML Ops are not supported on secondary process\");\n+\t\tdev->dev_ops = &ml_dev_dummy_ops;\n+\t}\n+\n+\tdev->enqueue_burst = NULL;\n+\tdev->dequeue_burst = NULL;\n+\tdev->op_error_get = NULL;\n+\n+\treturn 0;\n+\n+pmd_destroy:\n+\trte_ml_dev_pmd_destroy(dev);\n+\n+error_exit:\n+\tplt_err(\"Could not create device (vendor_id: 0x%x device_id: 0x%x)\", pci_dev->id.vendor_id,\n+\t\tpci_dev->id.device_id);\n+\n+\treturn ret;\n+}\n+\n+static int\n+cn10k_ml_pci_remove(struct rte_pci_device *pci_dev)\n+{\n+\tstruct cn10k_ml_dev *mldev;\n+\tchar name[RTE_ML_STR_MAX];\n+\tstruct rte_ml_dev *dev;\n+\tint ret;\n+\n+\tif (pci_dev == NULL)\n+\t\treturn -EINVAL;\n+\n+\trte_pci_device_name(&pci_dev->addr, name, sizeof(name));\n+\n+\tdev = rte_ml_dev_pmd_get_named_dev(name);\n+\tif (dev == NULL)\n+\t\treturn -ENODEV;\n+\n+\tif (rte_eal_process_type() == RTE_PROC_PRIMARY) {\n+\t\tmldev = dev->data->dev_private;\n+\t\tret = roc_ml_dev_fini(&mldev->roc);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\t}\n+\n+\treturn rte_ml_dev_pmd_destroy(dev);\n+}\n+\n+static struct rte_pci_id pci_id_ml_table[] = {\n+\t{RTE_PCI_DEVICE(PCI_VENDOR_ID_CAVIUM, PCI_DEVID_CN10K_ML_PF)},\n+\t/* sentinel */\n+\t{},\n+};\n+\n+static struct rte_pci_driver cn10k_mldev_pmd = {\n+\t.id_table = pci_id_ml_table,\n+\t.drv_flags = RTE_PCI_DRV_NEED_MAPPING | RTE_PCI_DRV_NEED_IOVA_AS_VA,\n+\t.probe = cn10k_ml_pci_probe,\n+\t.remove = cn10k_ml_pci_remove,\n+};\n+\n+RTE_PMD_REGISTER_PCI(MLDEV_NAME_CN10K_PMD, cn10k_mldev_pmd);\n+RTE_PMD_REGISTER_PCI_TABLE(MLDEV_NAME_CN10K_PMD, pci_id_ml_table);\n+RTE_PMD_REGISTER_KMOD_DEP(MLDEV_NAME_CN10K_PMD, \"vfio-pci\");\ndiff --git a/drivers/ml/cnxk/cn10k_ml_dev.h b/drivers/ml/cnxk/cn10k_ml_dev.h\nindex 049ac13fcd..833a09791a 100644\n--- a/drivers/ml/cnxk/cn10k_ml_dev.h\n+++ b/drivers/ml/cnxk/cn10k_ml_dev.h\n@@ -5,4 +5,15 @@\n #ifndef _CN10K_ML_DEV_H_\n #define _CN10K_ML_DEV_H_\n \n+#include <roc_api.h>\n+\n+/* Marvell OCTEON CN10K ML PMD device name */\n+#define MLDEV_NAME_CN10K_PMD ml_cn10k\n+\n+/* Device private data */\n+struct cn10k_ml_dev {\n+\t/* Device ROC */\n+\tstruct roc_ml roc;\n+};\n+\n #endif /* _CN10K_ML_DEV_H_ */\ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nnew file mode 100644\nindex 0000000000..39843e3ee5\n--- /dev/null\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2022 Marvell.\n+ */\n+\n+#include <rte_mldev.h>\n+#include <rte_mldev_pmd.h>\n+\n+#include \"cn10k_ml_ops.h\"\n+\n+struct rte_ml_dev_ops cn10k_ml_ops = {0};\ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.h b/drivers/ml/cnxk/cn10k_ml_ops.h\nnew file mode 100644\nindex 0000000000..b14221d02c\n--- /dev/null\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.h\n@@ -0,0 +1,11 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2022 Marvell.\n+ */\n+\n+#ifndef _CN10K_ML_OPS_H_\n+#define _CN10K_ML_OPS_H_\n+\n+/* Device ops */\n+extern struct rte_ml_dev_ops cn10k_ml_ops;\n+\n+#endif /* _CN10K_ML_OPS_H_ */\ndiff --git a/drivers/ml/cnxk/meson.build b/drivers/ml/cnxk/meson.build\nindex 2ec6a88e3f..caed62a9f3 100644\n--- a/drivers/ml/cnxk/meson.build\n+++ b/drivers/ml/cnxk/meson.build\n@@ -9,10 +9,12 @@ endif\n \n driver_sdk_headers = files(\n 'cn10k_ml_dev.h',\n+ 'cn10k_ml_ops.h',\n )\n \n sources = files(\n 'cn10k_ml_dev.c',\n+ 'cn10k_ml_ops.c',\n )\n \n deps += ['mldev', 'common_cnxk']\n", "prefixes": [ "v4", "03/39" ] }{ "id": 122812, "url": "