get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132854,
    "url": "http://patchwork.dpdk.org/api/patches/132854/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20231018064806.24145-12-syalavarthi@marvell.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20231018064806.24145-12-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231018064806.24145-12-syalavarthi@marvell.com",
    "date": "2023-10-18T06:47:39",
    "name": "[v5,11/34] ml/cnxk: update model utility functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8fe5c705b9dd58f7fdad5e8bd1e7a921cf9480f5",
    "submitter": {
        "id": 2480,
        "url": "http://patchwork.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patchwork.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20231018064806.24145-12-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 29898,
            "url": "http://patchwork.dpdk.org/api/series/29898/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29898",
            "date": "2023-10-18T06:47:28",
            "name": "Implementation of revised ml/cnxk driver",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/29898/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/132854/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/132854/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 1559D43196;\n\tWed, 18 Oct 2023 08:50:06 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A91C342E24;\n\tWed, 18 Oct 2023 08:48:33 +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 D615440E6E\n for <dev@dpdk.org>; Wed, 18 Oct 2023 08:48:18 +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 39I3vKJw020024 for <dev@dpdk.org>; Tue, 17 Oct 2023 23:48:18 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tstb3ursq-9\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 17 Oct 2023 23:48:18 -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.48;\n Tue, 17 Oct 2023 23:48:13 -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.48 via Frontend\n Transport; Tue, 17 Oct 2023 23:48:13 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 233E95B6951;\n Tue, 17 Oct 2023 23:48:13 -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=hw5Z4hZIi4vPdXZqKllXOXjCGLD5vyQ+s+IeaJz2U9I=;\n b=by9oCg4NEj368EdqxWbAkJSFCeABK1XmiXiQW+AJxB4dkg6Nb0FvcQ5SFtDMtWpo9DlP\n hgRVqWKLaJ/5nNt0SJa5n2FaxnDYRVSDY+ufTTSiSmUlXfXeP3Hz+uJQPerQ3jOhVty5\n mxY7VdzXAOrYccfuCez8KEoTTNOWyC1Dnp3ijwysa6poyuVIGAKVASMatEJ1p7r1SsP5\n l1ySoMqgqZI48mcuoHqKZQ4jxDUHlvvl8TyZOFZ8bg3kokTG9Mg0ea9yej+S6G/coJG8\n yn0hC7cF1DgeqpxyKtuyPaK5OTHmkvmaRoaqS167LH+v/58taCsbJqg3kh7ixyxeCHia Lw==",
        "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 v5 11/34] ml/cnxk: update model utility functions",
        "Date": "Tue, 17 Oct 2023 23:47:39 -0700",
        "Message-ID": "<20231018064806.24145-12-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20231018064806.24145-1-syalavarthi@marvell.com>",
        "References": "<20230830155927.3566-1-syalavarthi@marvell.com>\n <20231018064806.24145-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "WUkVJsk16wywb3-ILlvlrE_mQpW5Jypv",
        "X-Proofpoint-GUID": "WUkVJsk16wywb3-ILlvlrE_mQpW5Jypv",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-10-18_04,2023-10-17_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 cnxk wrapper function to update model params and\nfetch model info.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cn10k_ml_ops.c | 38 ++++++---------------------\n drivers/ml/cnxk/cn10k_ml_ops.h |  5 ++--\n drivers/ml/cnxk/cnxk_ml_ops.c  | 48 ++++++++++++++++++++++++++++++++--\n 3 files changed, 56 insertions(+), 35 deletions(-)",
    "diff": "diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nindex c677861645..c0d6216485 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -1835,45 +1835,23 @@ cn10k_ml_model_stop(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model)\n }\n \n int\n-cn10k_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,\n-\t\t\tstruct rte_ml_model_info *model_info)\n+cn10k_ml_model_params_update(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model,\n+\t\t\t     void *buffer)\n {\n-\tstruct cnxk_ml_model *model;\n-\n-\tmodel = dev->data->models[model_id];\n-\n-\tif (model == NULL) {\n-\t\tplt_err(\"Invalid model_id = %u\", model_id);\n-\t\treturn -EINVAL;\n-\t}\n-\n-\trte_memcpy(model_info, model->info, sizeof(struct rte_ml_model_info));\n-\tmodel_info->input_info = ((struct rte_ml_model_info *)model->info)->input_info;\n-\tmodel_info->output_info = ((struct rte_ml_model_info *)model->info)->output_info;\n-\n-\treturn 0;\n-}\n-\n-int\n-cn10k_ml_model_params_update(struct rte_ml_dev *dev, uint16_t model_id, void *buffer)\n-{\n-\tstruct cnxk_ml_model *model;\n-\n-\tmodel = dev->data->models[model_id];\n+\tstruct cnxk_ml_layer *layer;\n \n-\tif (model == NULL) {\n-\t\tplt_err(\"Invalid model_id = %u\", model_id);\n-\t\treturn -EINVAL;\n-\t}\n+\tRTE_SET_USED(cnxk_mldev);\n \n \tif (model->state == ML_CNXK_MODEL_STATE_UNKNOWN)\n \t\treturn -1;\n \telse if (model->state != ML_CNXK_MODEL_STATE_LOADED)\n \t\treturn -EBUSY;\n \n+\tlayer = &model->layer[0];\n+\n \t/* Update model weights & bias */\n-\trte_memcpy(model->layer[0].glow.addr.wb_load_addr, buffer,\n-\t\t   model->layer[0].glow.metadata.weights_bias.file_size);\n+\trte_memcpy(layer->glow.addr.wb_load_addr, buffer,\n+\t\t   layer->glow.metadata.weights_bias.file_size);\n \n \treturn 0;\n }\ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.h b/drivers/ml/cnxk/cn10k_ml_ops.h\nindex a222a43d55..ef12069f0d 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.h\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.h\n@@ -317,9 +317,8 @@ int cn10k_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_para\n int cn10k_ml_model_unload(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model);\n int cn10k_ml_model_start(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model);\n int cn10k_ml_model_stop(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model);\n-int cn10k_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,\n-\t\t\t    struct rte_ml_model_info *model_info);\n-int cn10k_ml_model_params_update(struct rte_ml_dev *dev, uint16_t model_id, void *buffer);\n+int cn10k_ml_model_params_update(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model,\n+\t\t\t\t void *buffer);\n \n /* I/O ops */\n int cn10k_ml_io_quantize(struct rte_ml_dev *dev, uint16_t model_id,\ndiff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c\nindex b61ed45876..9ce37fcfd1 100644\n--- a/drivers/ml/cnxk/cnxk_ml_ops.c\n+++ b/drivers/ml/cnxk/cnxk_ml_ops.c\n@@ -604,6 +604,50 @@ cnxk_ml_model_stop(struct rte_ml_dev *dev, uint16_t model_id)\n \treturn cn10k_ml_model_stop(cnxk_mldev, model);\n }\n \n+static int\n+cnxk_ml_model_info_get(struct rte_ml_dev *dev, uint16_t model_id,\n+\t\t       struct rte_ml_model_info *model_info)\n+{\n+\tstruct rte_ml_model_info *info;\n+\tstruct cnxk_ml_model *model;\n+\n+\tif ((dev == NULL) || (model_info == NULL))\n+\t\treturn -EINVAL;\n+\n+\tmodel = dev->data->models[model_id];\n+\tif (model == NULL) {\n+\t\tplt_err(\"Invalid model_id = %u\", model_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tinfo = (struct rte_ml_model_info *)model->info;\n+\trte_memcpy(model_info, info, sizeof(struct rte_ml_model_info));\n+\tmodel_info->input_info = info->input_info;\n+\tmodel_info->output_info = info->output_info;\n+\n+\treturn 0;\n+}\n+\n+static int\n+cnxk_ml_model_params_update(struct rte_ml_dev *dev, uint16_t model_id, void *buffer)\n+{\n+\tstruct cnxk_ml_dev *cnxk_mldev;\n+\tstruct cnxk_ml_model *model;\n+\n+\tif ((dev == NULL) || (buffer == NULL))\n+\t\treturn -EINVAL;\n+\n+\tcnxk_mldev = dev->data->dev_private;\n+\n+\tmodel = dev->data->models[model_id];\n+\tif (model == NULL) {\n+\t\tplt_err(\"Invalid model_id = %u\", model_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn cn10k_ml_model_params_update(cnxk_mldev, model, buffer);\n+}\n+\n struct rte_ml_dev_ops cnxk_ml_ops = {\n \t/* Device control ops */\n \t.dev_info_get = cnxk_ml_dev_info_get,\n@@ -631,8 +675,8 @@ struct rte_ml_dev_ops cnxk_ml_ops = {\n \t.model_unload = cnxk_ml_model_unload,\n \t.model_start = cnxk_ml_model_start,\n \t.model_stop = cnxk_ml_model_stop,\n-\t.model_info_get = cn10k_ml_model_info_get,\n-\t.model_params_update = cn10k_ml_model_params_update,\n+\t.model_info_get = cnxk_ml_model_info_get,\n+\t.model_params_update = cnxk_ml_model_params_update,\n \n \t/* I/O ops */\n \t.io_quantize = cn10k_ml_io_quantize,\n",
    "prefixes": [
        "v5",
        "11/34"
    ]
}