get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 131692,
    "url": "https://patches.dpdk.org/api/patches/131692/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230920072528.14185-20-syalavarthi@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": "<20230920072528.14185-20-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230920072528.14185-20-syalavarthi@marvell.com",
    "date": "2023-09-20T07:25:10",
    "name": "[v2,19/34] ml/cnxk: support config and close of tvmdp library",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "41c500dc49610577481dd9c4691c9a3cd6f310dd",
    "submitter": {
        "id": 2480,
        "url": "https://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230920072528.14185-20-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 29567,
            "url": "https://patches.dpdk.org/api/series/29567/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29567",
            "date": "2023-09-20T07:24:51",
            "name": "Implemenation of revised ml/cnxk driver",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/29567/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/131692/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/131692/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 74978425E4;\n\tWed, 20 Sep 2023 09:27:42 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3D2E642D27;\n\tWed, 20 Sep 2023 09:25:58 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id AEE2C40EE5\n for <dev@dpdk.org>; Wed, 20 Sep 2023 09:25:40 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 38K7JW0x008355 for <dev@dpdk.org>; Wed, 20 Sep 2023 00:25:40 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3t7htasykw-7\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 20 Sep 2023 00:25:40 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Wed, 20 Sep 2023 00:25:38 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.48 via Frontend\n Transport; Wed, 20 Sep 2023 00:25:38 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 5134E5B6926;\n Wed, 20 Sep 2023 00:25:38 -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=uzJ6TXChF1ZSghTMUyujkCoGzodJc5twoL13hvUsasw=;\n b=asw8ry+/kBN56h8afo23qoIhTkqauXylXPTAsV/HXO3SG9dfsPeOu8YBZATGY4wl13md\n IReJy9A6kA1C4o8Gk/xE+52kXlNfARzlh7C8wf902cYqNkuy/0VfJhMiX+CYS+oq027i\n Yu+wm7HZ2W8m7KhVDa26VnIzPL0myJ4kbVNL/avnhQ1uOgdGoRuzzVjCid75Jk3gc458\n o+S4ytwOGjATrtGzXwBOYe4xdcWdhr0ZNd6+xumhewOQ4FWW1GXmX3jrwAEFVwQbdP/x\n ik9eMh8sl9gD9YH7Zk1ZX6JJuoiI0rlpmFu9x9/3lfxPQlwmK/yVUx91QqjF5bSrD1i3 Xw==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <aprabhu@marvell.com>,\n <ptakkar@marvell.com>",
        "Subject": "[PATCH v2 19/34] ml/cnxk: support config and close of tvmdp library",
        "Date": "Wed, 20 Sep 2023 00:25:10 -0700",
        "Message-ID": "<20230920072528.14185-20-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<20230920072528.14185-1-syalavarthi@marvell.com>",
        "References": "<20230830155927.3566-1-syalavarthi@marvell.com>\n <20230920072528.14185-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "ANbaZtT7fzR1cI886w-1f_-FVFYLKDz6",
        "X-Proofpoint-GUID": "ANbaZtT7fzR1cI886w-1f_-FVFYLKDz6",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.980,Hydra:6.0.601,FMLib:17.11.176.26\n definitions=2023-09-20_02,2023-09-19_01,2023-05-22_02",
        "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": "Added support to configure and close TVMDP library based\non ML device configuration options.\n\nUpdated meson build to enable Jansson, TVM runtime, TVMDP\nlibrary as build dependencies.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cnxk_ml_ops.c  | 15 ++++++++++\n drivers/ml/cnxk/meson.build    | 50 ++++++++++++++++++++++++++++++++++\n drivers/ml/cnxk/mvtvm_ml_ops.c | 42 ++++++++++++++++++++++++++++\n drivers/ml/cnxk/mvtvm_ml_ops.h | 19 +++++++++++++\n 4 files changed, 126 insertions(+)\n create mode 100644 drivers/ml/cnxk/mvtvm_ml_ops.c\n create mode 100644 drivers/ml/cnxk/mvtvm_ml_ops.h",
    "diff": "diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c\nindex e6c67c71f5..358f16cead 100644\n--- a/drivers/ml/cnxk/cnxk_ml_ops.c\n+++ b/drivers/ml/cnxk/cnxk_ml_ops.c\n@@ -9,6 +9,10 @@\n \n #include \"cn10k_ml_ops.h\"\n \n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+#include \"mvtvm_ml_ops.h\"\n+#endif\n+\n #include \"cnxk_ml_dev.h\"\n #include \"cnxk_ml_io.h\"\n #include \"cnxk_ml_model.h\"\n@@ -625,6 +629,12 @@ cnxk_ml_dev_configure(struct rte_ml_dev *dev, const struct rte_ml_dev_config *co\n \t\tgoto error;\n \t}\n \n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+\tret = mvtvm_ml_dev_configure(cnxk_mldev, conf);\n+\tif (ret != 0)\n+\t\tgoto error;\n+#endif\n+\n \t/* Set device capabilities */\n \tcnxk_mldev->max_nb_layers =\n \t\tcnxk_mldev->cn10k_mldev.fw.req->cn10k_req.jd.fw_load.cap.s.max_models;\n@@ -685,6 +695,11 @@ cnxk_ml_dev_close(struct rte_ml_dev *dev)\n \t/* Un-initialize xstats */\n \tcnxk_ml_xstats_uninit(cnxk_mldev);\n \n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+\tif (mvtvm_ml_dev_close(cnxk_mldev) != 0)\n+\t\tplt_err(\"Failed to close MVTVM ML Device\");\n+#endif\n+\n \tif (cn10k_ml_dev_close(cnxk_mldev) != 0)\n \t\tplt_err(\"Failed to close CN10K ML Device\");\n \ndiff --git a/drivers/ml/cnxk/meson.build b/drivers/ml/cnxk/meson.build\nindex 575f08f9c0..61f7fa32af 100644\n--- a/drivers/ml/cnxk/meson.build\n+++ b/drivers/ml/cnxk/meson.build\n@@ -7,6 +7,32 @@ if not is_linux or not dpdk_conf.get('RTE_ARCH_64')\n     subdir_done()\n endif\n \n+enable_mvtvm = true\n+\n+if not jansson_dep.found()\n+        message('drivers/ml/cnxk: jansson not found')\n+        enable_mvtvm = false\n+endif\n+\n+if not cc.check_header('dlpack/dlpack.h')\n+        message('drivers/ml/cnxk: dlpack.h not found')\n+        enable_mvtvm = false\n+endif\n+\n+tvmrt_lib = cc.find_library('tvm_runtime', required: false)\n+if tvmrt_lib.found()\n+        tvmrt_dep = declare_dependency(dependencies: tvmrt_lib)\n+else\n+        message('drivers/ml/cnxk: tvm_runtime not found')\n+        enable_mvtvm = false\n+endif\n+\n+tvmdp_dep = dependency('tvmdp', required: false)\n+if not tvmdp_dep.found()\n+        message('drivers/ml/cnxk: tvmdp not found')\n+        enable_mvtvm = false\n+endif\n+\n driver_sdk_headers = files(\n         'cn10k_ml_dev.h',\n         'cn10k_ml_ops.h',\n@@ -34,6 +60,30 @@ sources = files(\n \n deps += ['mldev', 'common_cnxk', 'kvargs', 'hash']\n \n+if enable_mvtvm\n+\n+dpdk_conf.set('RTE_MLDEV_CNXK_ENABLE_MVTVM', true)\n+\n+driver_sdk_headers += files(\n+        'mvtvm_ml_ops.h',\n+)\n+\n+sources += files(\n+        'mvtvm_ml_ops.c',\n+)\n+\n+ext_deps += tvmrt_dep\n+ext_deps += tvmdp_dep\n+ext_deps += cc.find_library('stdc++', required: true)\n+ext_deps += jansson_dep\n+\n+deps += ['bus_vdev']\n+\n+message('drivers/ml/cnxk: Enabled TVM model support')\n+else\n+message('drivers/ml/cnxk: Disabled TVM model support')\n+endif\n+\n require_iova_in_mbuf = false\n \n if get_option('buildtype').contains('debug')\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c\nnew file mode 100644\nindex 0000000000..f2b9499cf4\n--- /dev/null\n+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c\n@@ -0,0 +1,42 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2023 Marvell.\n+ */\n+\n+#include <rte_common.h>\n+#include <rte_cycles.h>\n+#include <rte_mldev.h>\n+#include <rte_mldev_pmd.h>\n+\n+#include \"mvtvm_ml_ops.h\"\n+\n+#include \"cnxk_ml_dev.h\"\n+\n+int\n+mvtvm_ml_dev_configure(struct cnxk_ml_dev *cnxk_mldev, const struct rte_ml_dev_config *conf)\n+{\n+\tint ret;\n+\n+\tRTE_SET_USED(conf);\n+\n+\t/* Configure TVMDP library */\n+\tret = tvmdp_configure(cnxk_mldev->mldev->data->nb_models, rte_get_tsc_cycles);\n+\tif (ret != 0)\n+\t\tplt_err(\"TVMDP configuration failed, error = %d\\n\", ret);\n+\n+\treturn ret;\n+}\n+\n+int\n+mvtvm_ml_dev_close(struct cnxk_ml_dev *cnxk_mldev)\n+{\n+\tint ret;\n+\n+\tRTE_SET_USED(cnxk_mldev);\n+\n+\t/* Close TVMDP library configuration */\n+\tret = tvmdp_close();\n+\tif (ret != 0)\n+\t\tplt_err(\"TVMDP close failed, error = %d\\n\", ret);\n+\n+\treturn ret;\n+}\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_ops.h b/drivers/ml/cnxk/mvtvm_ml_ops.h\nnew file mode 100644\nindex 0000000000..305b4681ed\n--- /dev/null\n+++ b/drivers/ml/cnxk/mvtvm_ml_ops.h\n@@ -0,0 +1,19 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2023 Marvell.\n+ */\n+\n+#ifndef _MVTVM_ML_OPS_H_\n+#define _MVTVM_ML_OPS_H_\n+\n+#include <dlpack/dlpack.h>\n+\n+#include <tvmdp.h>\n+\n+#include <rte_mldev.h>\n+\n+struct cnxk_ml_dev;\n+\n+int mvtvm_ml_dev_configure(struct cnxk_ml_dev *cnxk_mldev, const struct rte_ml_dev_config *conf);\n+int mvtvm_ml_dev_close(struct cnxk_ml_dev *cnxk_mldev);\n+\n+#endif /* _MVTVM_ML_OPS_H_ */\n",
    "prefixes": [
        "v2",
        "19/34"
    ]
}