get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/121102/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 121102,
    "url": "http://patches.dpdk.org/api/patches/121102/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221220192645.14042-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": "<20221220192645.14042-4-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221220192645.14042-4-syalavarthi@marvell.com",
    "date": "2022-12-20T19:26:10",
    "name": "[v3,03/38] ml/cnxk: enable probe and remove of ML device",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8922b6c97446bf67b08e61ae3714352448ea5c0c",
    "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/20221220192645.14042-4-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 26199,
            "url": "http://patches.dpdk.org/api/series/26199/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=26199",
            "date": "2022-12-20T19:26:07",
            "name": "Implementation of ML CNXK driver",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/26199/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/121102/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/121102/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 3A7EDA0545;\n\tTue, 20 Dec 2022 20:27:12 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 40C1C42D1A;\n\tTue, 20 Dec 2022 20:26:58 +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 3121B40A7A\n for <dev@dpdk.org>; Tue, 20 Dec 2022 20:26:54 +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 2BKHPQ0p015491; Tue, 20 Dec 2022 11:26:53 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3mkapj2tpd-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 20 Dec 2022 11:26:53 -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 Tue, 20 Dec 2022 11:26:51 -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; Tue, 20 Dec 2022 11:26:51 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 759583F7075;\n Tue, 20 Dec 2022 11:26:51 -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=byW8TMHKW3ZjWLwgqz+Rv+VJBD2Wr3QFCRm+2wRnu9g=;\n b=ePRblIFycEe82BUW2OfhWXhuQG6NI1HI0e0u8De0OIvmDDZcGd05LC9zD60nqXZSEQBI\n Tv4RcuaAJ8ikrAiAG1ycEPPwZptj5h5lCvJNG9dO/FvGMZPgQOfDnp03EALU5sPjrEZI\n GHx+v7mlOky/gxq1lUpWEySJny526zQyCSwKwANmeTPSlNvi0IOGWCkuGuidbkCnP7yc\n 6HDPHIpLDhJ9ThJhgsbDSR+d52yfh9Fk+a3HgxoeyfKFqxRmS2jfWvVaB8w06a/DvEIp\n sVc/0zFD93PSqjg1oAREoi1BNjJbGpjo0hr6S12DDCw2B/Op+4Mn09YEQu2EgktIt+ST 5w==",
        "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 v3 03/38] ml/cnxk: enable probe and remove of ML device",
        "Date": "Tue, 20 Dec 2022 11:26:10 -0800",
        "Message-ID": "<20221220192645.14042-4-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20221220192645.14042-1-syalavarthi@marvell.com>",
        "References": "<20221208201806.21893-1-syalavarthi@marvell.com>\n <20221220192645.14042-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "WiWgFOSpNqxPeBXTFzrTsOXB7joJyKWl",
        "X-Proofpoint-GUID": "WiWgFOSpNqxPeBXTFzrTsOXB7joJyKWl",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-12-20_06,2022-12-20_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 f33fef39e3..aff65a082f 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_ml', 'common_cnxk']\n",
    "prefixes": [
        "v3",
        "03/38"
    ]
}