get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 123167,
    "url": "https://patches.dpdk.org/api/patches/123167/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230206202453.336280-6-jerinj@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": "<20230206202453.336280-6-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230206202453.336280-6-jerinj@marvell.com",
    "date": "2023-02-06T20:24:46",
    "name": "[v2,05/12] mldev: support handling ML models",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "e6be434dbd06e8608c313d112b8142fe8f0e706b",
    "submitter": {
        "id": 1188,
        "url": "https://patches.dpdk.org/api/people/1188/?format=api",
        "name": "Jerin Jacob Kollanukkaran",
        "email": "jerinj@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230206202453.336280-6-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 26825,
            "url": "https://patches.dpdk.org/api/series/26825/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26825",
            "date": "2023-02-06T20:24:41",
            "name": "mldev: introduce machine learning device library",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/26825/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/123167/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/123167/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 379A141C25;\n\tMon,  6 Feb 2023 21:25:45 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3BCC942D5D;\n\tMon,  6 Feb 2023 21:25:33 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 1364742D59\n for <dev@dpdk.org>; Mon,  6 Feb 2023 21:25:30 +0100 (CET)",
            "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 316FLMft015844; Mon, 6 Feb 2023 12:25:30 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3nhqrte0qk-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Mon, 06 Feb 2023 12:25:30 -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 Mon, 6 Feb 2023 12:25:28 -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; Mon, 6 Feb 2023 12:25:28 -0800",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 7AF293F705B;\n Mon,  6 Feb 2023 12:25:25 -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-transfer-encoding : content-type; s=pfpt0220;\n bh=EyJpNdSKDJQ+Dc48ouiEuzRHtFJj59jMkAj9f0dvhAs=;\n b=Wq69qYOiZkNk/AcDE0yl5G9q1WBOCJM5rBVlWk+hEaxdbdKhSu8+Y4UbMtTYMoI5zB1p\n a4VRa4GZlWdUbHPJUkEtVDhq3eRrFYs9HCyUdb13+sGB/lZn8YGMdClhppO26DEzKeIw\n o/O1LxwK5nlt2W+NDXnyszAGc75Z5kTKbbXRrzzsM5SXFTruQylT8bgwMGep0GUBtDUZ\n fELLL7zsHTOXWrjlTwd8fs/x609SKfO4++M7FGze/m2q2Y4U8tebmL9lhan4d3JWr/QQ\n BiLHYwhn5vlAJ/xmWZupsqjBubd+Q3jWb3Be80i4SR/yZtWOeiLCZSzD1BTi644Yi9tp jw==",
        "From": "<jerinj@marvell.com>",
        "To": "<dev@dpdk.org>, Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<thomas@monjalon.net>, <ferruh.yigit@xilinx.com>,\n <stephen@networkplumber.org>, <dchickles@marvell.com>,\n <sshankarnara@marvell.com>, <pkapoor@marvell.com>, Jerin Jacob\n <jerinj@marvell.com>",
        "Subject": "[dpdk-dev] [PATCH v2 05/12] mldev: support handling ML models",
        "Date": "Tue, 7 Feb 2023 01:54:46 +0530",
        "Message-ID": "<20230206202453.336280-6-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.39.1",
        "In-Reply-To": "<20230206202453.336280-1-jerinj@marvell.com>",
        "References": "<20221114120238.2143832-1-jerinj@marvell.com>\n <20230206202453.336280-1-jerinj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "HIlR7_PG4zcBDGFdVtFRMNAv6cHW-egH",
        "X-Proofpoint-ORIG-GUID": "HIlR7_PG4zcBDGFdVtFRMNAv6cHW-egH",
        "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-06_07,2023-02-06_03,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": "From: Srikanth Yalavarthi <syalavarthi@marvell.com>\n\nAdded RTE functions to handle ML models. These APIs can\nload, unload, start, and stop an ML model. Additional APIs\nto update model parameters and get model information are\nadded.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\nSigned-off-by: Jerin Jacob <jerinj@marvell.com>\n---\n lib/mldev/rte_mldev.c      | 123 +++++++++++++++++++++++++++++++++++++\n lib/mldev/rte_mldev_core.h | 122 ++++++++++++++++++++++++++++++++++++\n lib/mldev/version.map      |   6 ++\n 3 files changed, 251 insertions(+)",
    "diff": "diff --git a/lib/mldev/rte_mldev.c b/lib/mldev/rte_mldev.c\nindex 4452c21dd6..3b8c073615 100644\n--- a/lib/mldev/rte_mldev.c\n+++ b/lib/mldev/rte_mldev.c\n@@ -342,4 +342,127 @@ rte_ml_dev_queue_pair_setup(int16_t dev_id, uint16_t queue_pair_id,\n \treturn (*dev->dev_ops->dev_queue_pair_setup)(dev, queue_pair_id, qp_conf, socket_id);\n }\n \n+int\n+rte_ml_model_load(int16_t dev_id, struct rte_ml_model_params *params, uint16_t *model_id)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_load == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\tif (params == NULL) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Dev %d, params cannot be NULL\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (model_id == NULL) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Dev %d, model_id cannot be NULL\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn (*dev->dev_ops->model_load)(dev, params, model_id);\n+}\n+\n+int\n+rte_ml_model_unload(int16_t dev_id, uint16_t model_id)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_unload == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\treturn (*dev->dev_ops->model_unload)(dev, model_id);\n+}\n+\n+int\n+rte_ml_model_start(int16_t dev_id, uint16_t model_id)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_start == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\treturn (*dev->dev_ops->model_start)(dev, model_id);\n+}\n+\n+int\n+rte_ml_model_stop(int16_t dev_id, uint16_t model_id)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_stop == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\treturn (*dev->dev_ops->model_stop)(dev, model_id);\n+}\n+\n+int\n+rte_ml_model_info_get(int16_t dev_id, uint16_t model_id, struct rte_ml_model_info *model_info)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_info_get == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\tif (model_info == NULL) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Dev %d, model_id %u, model_info cannot be NULL\\n\", dev_id,\n+\t\t\t      model_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn (*dev->dev_ops->model_info_get)(dev, model_id, model_info);\n+}\n+\n+int\n+rte_ml_model_params_update(int16_t dev_id, uint16_t model_id, void *buffer)\n+{\n+\tstruct rte_ml_dev *dev;\n+\n+\tif (!rte_ml_dev_is_valid_dev(dev_id)) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Invalid dev_id = %d\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tdev = rte_ml_dev_pmd_get_dev(dev_id);\n+\tif (*dev->dev_ops->model_params_update == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\tif (buffer == NULL) {\n+\t\tRTE_MLDEV_LOG(ERR, \"Dev %d, buffer cannot be NULL\\n\", dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn (*dev->dev_ops->model_params_update)(dev, model_id, buffer);\n+}\n+\n RTE_LOG_REGISTER_DEFAULT(rte_ml_dev_logtype, INFO);\ndiff --git a/lib/mldev/rte_mldev_core.h b/lib/mldev/rte_mldev_core.h\nindex b7a692fc7a..4f1f32b583 100644\n--- a/lib/mldev/rte_mldev_core.h\n+++ b/lib/mldev/rte_mldev_core.h\n@@ -151,6 +151,110 @@ typedef int (*mldev_queue_pair_setup_t)(struct rte_ml_dev *dev, uint16_t queue_p\n  */\n typedef int (*mldev_queue_pair_release_t)(struct rte_ml_dev *dev, uint16_t queue_pair_id);\n \n+/**\n+ * @internal\n+ *\n+ * Function used to load an ML model.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param params\n+ *\tModel load params.\n+ * @param model_id\n+ *\tModel ID returned by the library.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- < 0, error on failure.\n+ */\n+typedef int (*mldev_model_load_t)(struct rte_ml_dev *dev, struct rte_ml_model_params *params,\n+\t\t\t\t  uint16_t *model_id);\n+\n+/**\n+ * @internal\n+ *\n+ * Function used to unload an ML model.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param model_id\n+ *\tModel ID to use.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- < 0, error on failure.\n+ */\n+typedef int (*mldev_model_unload_t)(struct rte_ml_dev *dev, uint16_t model_id);\n+\n+/**\n+ * @internal\n+ *\n+ * Function used to start an ML model.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param model_id\n+ *\tModel ID to use.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- <0, error on failure.\n+ */\n+typedef int (*mldev_model_start_t)(struct rte_ml_dev *dev, uint16_t model_id);\n+\n+/**\n+ * @internal\n+ *\n+ * Function used to stop an ML model.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param model_id\n+ *\tModel ID to use.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- <0, error on failure.\n+ */\n+typedef int (*mldev_model_stop_t)(struct rte_ml_dev *dev, uint16_t model_id);\n+\n+/**\n+ * @internal\n+ *\n+ * Get info about a model.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param model_id\n+ *\tModel ID to use.\n+ * @param model_info\n+ *\tPointer to model info structure.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- <0, error on failure.\n+ */\n+typedef int (*mldev_model_info_get_t)(struct rte_ml_dev *dev, uint16_t model_id,\n+\t\t\t\t      struct rte_ml_model_info *model_info);\n+\n+/**\n+ * @internal\n+ *\n+ * Update model params.\n+ *\n+ * @param dev\n+ *\tML device pointer.\n+ * @param model_id\n+ *\tModel ID to use.\n+ * @param buffer\n+ *\tPointer to model params.\n+ *\n+ * @return\n+ *\t- 0 on success.\n+ *\t- <0, error on failure.\n+ */\n+typedef int (*mldev_model_params_update_t)(struct rte_ml_dev *dev, uint16_t model_id, void *buffer);\n+\n /**\n  * @internal\n  *\n@@ -177,6 +281,24 @@ struct rte_ml_dev_ops {\n \n \t/** Release a device queue pair. */\n \tmldev_queue_pair_release_t dev_queue_pair_release;\n+\n+\t/** Load an ML model. */\n+\tmldev_model_load_t model_load;\n+\n+\t/** Unload an ML model. */\n+\tmldev_model_unload_t model_unload;\n+\n+\t/** Start an ML model. */\n+\tmldev_model_start_t model_start;\n+\n+\t/** Stop an ML model. */\n+\tmldev_model_stop_t model_stop;\n+\n+\t/** Get model information. */\n+\tmldev_model_info_get_t model_info_get;\n+\n+\t/** Update model params. */\n+\tmldev_model_params_update_t model_params_update;\n };\n \n /**\ndiff --git a/lib/mldev/version.map b/lib/mldev/version.map\nindex 8de1e8bec7..640671efff 100644\n--- a/lib/mldev/version.map\n+++ b/lib/mldev/version.map\n@@ -11,6 +11,12 @@ EXPERIMENTAL {\n \trte_ml_dev_socket_id;\n \trte_ml_dev_start;\n \trte_ml_dev_stop;\n+\trte_ml_model_info_get;\n+\trte_ml_model_load;\n+\trte_ml_model_params_update;\n+\trte_ml_model_start;\n+\trte_ml_model_stop;\n+\trte_ml_model_unload;\n \n \tlocal: *;\n };\n",
    "prefixes": [
        "v2",
        "05/12"
    ]
}