get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133418,
    "url": "http://patches.dpdk.org/api/patches/133418/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231026124347.22477-28-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": "<20231026124347.22477-28-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231026124347.22477-28-syalavarthi@marvell.com",
    "date": "2023-10-26T12:43:36",
    "name": "[v9,27/34] ml/cnxk: update internal TVM model info structure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "3a20f2182f5c9f56ea8c8a310955fb432362ef4c",
    "submitter": {
        "id": 2480,
        "url": "http://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20231026124347.22477-28-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 30002,
            "url": "http://patches.dpdk.org/api/series/30002/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30002",
            "date": "2023-10-26T12:43:09",
            "name": "Implementation of revised ml/cnxk driver",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/30002/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/133418/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/133418/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 A45C343208;\n\tThu, 26 Oct 2023 14:50:02 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6BD2542DE9;\n\tThu, 26 Oct 2023 14:44:35 +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 9205942E3C\n for <dev@dpdk.org>; Thu, 26 Oct 2023 14:44:06 +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 39QALk0H007523 for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:06 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3txcsr25pc-18\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:05 -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 Thu, 26 Oct 2023 05:44:00 -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; Thu, 26 Oct 2023 05:44:01 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 87DCF3F70C0;\n Thu, 26 Oct 2023 05:44:00 -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=44Wv4VxUi1YLt+mCd/gmtf7u18xR1Za6A6KkOnk9jp4=;\n b=f9y9EzHWB+AISBqB/Q8PP0zqdD2OfIjUcjcYuMrtzYIlirJoKk0ChTMxSnuse+i5GSCx\n iAP7tDe87C+a/Gbk40LqSRe31r52dC6sy/9IJ0XE24Za7nc8fUPia55V8Vy3D46/bTHH\n bTcaApvuSiEd5grRhm/80cG9lzxZYOMstfTCSs5WKjiW4pbhpEfc2TRv1L9saR/Zd/yF\n 7sZwJpylppb2x+7/mtZfspOLUOQsnMwqiKJdhTc1uXo6ektfRtzd7oEUzV3AqSf9TPh9\n 4E/VNRRUTVCvUt9Xtcam0wVyVbi4eJlfMfaKQueCdt7inRrxGQYyWIMrcNO6q68XhylY dw==",
        "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 v9 27/34] ml/cnxk: update internal TVM model info structure",
        "Date": "Thu, 26 Oct 2023 05:43:36 -0700",
        "Message-ID": "<20231026124347.22477-28-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.42.0",
        "In-Reply-To": "<20231026124347.22477-1-syalavarthi@marvell.com>",
        "References": "<20230830155927.3566-1-syalavarthi@marvell.com>\n <20231026124347.22477-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "n2G6Nve7vZnGElhm72JaRDZJsg0YiAYw",
        "X-Proofpoint-GUID": "n2G6Nve7vZnGElhm72JaRDZJsg0YiAYw",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.987,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-10-26_10,2023-10-26_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": "From: Prince Takkar <ptakkar@marvell.com>\n\nAdded support to update internal model info structure\nfor TVM models.\n\nSigned-off-by: Prince Takkar <ptakkar@marvell.com>\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/mvtvm_ml_model.c | 66 ++++++++++++++++++++++++++++++++\n drivers/ml/cnxk/mvtvm_ml_model.h |  2 +\n drivers/ml/cnxk/mvtvm_ml_ops.c   |  3 ++\n 3 files changed, 71 insertions(+)",
    "diff": "diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c\nindex f35c2bb3e5..88f2738423 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.c\n@@ -11,6 +11,7 @@\n \n #include <roc_api.h>\n \n+#include \"cnxk_ml_dev.h\"\n #include \"cnxk_ml_model.h\"\n \n /* Objects list */\n@@ -268,3 +269,68 @@ mvtvm_ml_model_io_info_get(struct cnxk_ml_model *model, uint16_t layer_id)\n \n \treturn &model->mvtvm.info;\n }\n+\n+void\n+mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model)\n+{\n+\tstruct tvmdp_model_metadata *metadata;\n+\tstruct rte_ml_model_info *info;\n+\tstruct rte_ml_io_info *output;\n+\tstruct rte_ml_io_info *input;\n+\tuint8_t i;\n+\n+\tinfo = PLT_PTR_CAST(model->info);\n+\tinput = PLT_PTR_ADD(info, sizeof(struct rte_ml_model_info));\n+\toutput = PLT_PTR_ADD(input, ML_CNXK_MODEL_MAX_INPUT_OUTPUT * sizeof(struct rte_ml_io_info));\n+\n+\t/* Reset model info */\n+\tmemset(info, 0, sizeof(struct rte_ml_model_info));\n+\n+\tif (model->subtype == ML_CNXK_MODEL_SUBTYPE_TVM_MRVL)\n+\t\tgoto tvm_mrvl_model;\n+\n+\tmetadata = &model->mvtvm.metadata;\n+\trte_memcpy(info->name, metadata->model.name, TVMDP_NAME_STRLEN);\n+\tsnprintf(info->version, RTE_ML_STR_MAX, \"%u.%u.%u.%u\", metadata->model.version[0],\n+\t\t metadata->model.version[1], metadata->model.version[2],\n+\t\t metadata->model.version[3]);\n+\tinfo->model_id = model->model_id;\n+\tinfo->device_id = cnxk_mldev->mldev->data->dev_id;\n+\tinfo->io_layout = RTE_ML_IO_LAYOUT_SPLIT;\n+\tinfo->min_batches = model->batch_size;\n+\tinfo->max_batches = model->batch_size;\n+\tinfo->nb_inputs = metadata->model.num_input;\n+\tinfo->input_info = input;\n+\tinfo->nb_outputs = metadata->model.num_output;\n+\tinfo->output_info = output;\n+\tinfo->wb_size = 0;\n+\n+\t/* Set input info */\n+\tfor (i = 0; i < info->nb_inputs; i++) {\n+\t\trte_memcpy(input[i].name, metadata->input[i].name, MRVL_ML_INPUT_NAME_LEN);\n+\t\tinput[i].nb_dims = metadata->input[i].ndim;\n+\t\tinput[i].shape = &model->mvtvm.info.input[i].shape[0];\n+\t\tinput[i].type = model->mvtvm.info.input[i].qtype;\n+\t\tinput[i].nb_elements = model->mvtvm.info.input[i].nb_elements;\n+\t\tinput[i].size = model->mvtvm.info.input[i].nb_elements *\n+\t\t\t\trte_ml_io_type_size_get(model->mvtvm.info.input[i].qtype);\n+\t}\n+\n+\t/* Set output info */\n+\tfor (i = 0; i < info->nb_outputs; i++) {\n+\t\trte_memcpy(output[i].name, metadata->output[i].name, MRVL_ML_OUTPUT_NAME_LEN);\n+\t\toutput[i].nb_dims = metadata->output[i].ndim;\n+\t\toutput[i].shape = &model->mvtvm.info.output[i].shape[0];\n+\t\toutput[i].type = model->mvtvm.info.output[i].qtype;\n+\t\toutput[i].nb_elements = model->mvtvm.info.output[i].nb_elements;\n+\t\toutput[i].size = model->mvtvm.info.output[i].nb_elements *\n+\t\t\t\t rte_ml_io_type_size_get(model->mvtvm.info.output[i].qtype);\n+\t}\n+\n+\treturn;\n+\n+tvm_mrvl_model:\n+\tcn10k_ml_model_info_set(cnxk_mldev, model, &model->mvtvm.info,\n+\t\t\t\t&model->layer[0].glow.metadata);\n+\tinfo->io_layout = RTE_ML_IO_LAYOUT_SPLIT;\n+}\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_model.h b/drivers/ml/cnxk/mvtvm_ml_model.h\nindex e86581bc6a..a1247ffbde 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.h\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.h\n@@ -11,6 +11,7 @@\n \n #include \"cnxk_ml_io.h\"\n \n+struct cnxk_ml_dev;\n struct cnxk_ml_model;\n \n /* Maximum number of objects per model */\n@@ -52,5 +53,6 @@ int mvtvm_ml_model_get_layer_id(struct cnxk_ml_model *model, const char *layer_n\n \t\t\t\tuint16_t *layer_id);\n void mvtvm_ml_model_io_info_set(struct cnxk_ml_model *model);\n struct cnxk_ml_io_info *mvtvm_ml_model_io_info_get(struct cnxk_ml_model *model, uint16_t layer_id);\n+void mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model);\n \n #endif /* _MVTVM_ML_MODEL_H_ */\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c\nindex 323c7c6fb6..c6872cd89a 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_ops.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c\n@@ -178,6 +178,9 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *\n \t/* Update model I/O data */\n \tmvtvm_ml_model_io_info_set(model);\n \n+\t/* Set model info */\n+\tmvtvm_ml_model_info_set(cnxk_mldev, model);\n+\n \treturn 0;\n \n error:\n",
    "prefixes": [
        "v9",
        "27/34"
    ]
}