get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 130903,
    "url": "http://patchwork.dpdk.org/api/patches/130903/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230830155927.3566-25-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": "<20230830155927.3566-25-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230830155927.3566-25-syalavarthi@marvell.com",
    "date": "2023-08-30T15:59:14",
    "name": "[v1,24/34] ml/cnxk: update internal info for TVM model",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b2a8ba9bc3f73ca13d059290bb44928e07555846",
    "submitter": {
        "id": 2480,
        "url": "http://patchwork.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230830155927.3566-25-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 29376,
            "url": "http://patchwork.dpdk.org/api/series/29376/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29376",
            "date": "2023-08-30T15:58:50",
            "name": "Implemenation of revised ml/cnxk driver",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29376/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/130903/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/130903/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 D37BC41FD1;\n\tWed, 30 Aug 2023 18:04:34 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 8DB1340ED2;\n\tWed, 30 Aug 2023 18:00:04 +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 6B760402B4\n for <dev@dpdk.org>; Wed, 30 Aug 2023 17:59:42 +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 37U86I74012554 for <dev@dpdk.org>; Wed, 30 Aug 2023 08:59:41 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3st1y61ga5-13\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Wed, 30 Aug 2023 08:59:41 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Wed, 30 Aug 2023 08:59:40 -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, 30 Aug 2023 08:59:40 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 1396F3F7080;\n Wed, 30 Aug 2023 08:59:40 -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=b9Goicxb871KLXyUYnm4kFeVjkCtjPxJ/0YG1HY95rQ=;\n b=hPQZa+plV6gM+MvU2qVHSwqRksTf9QNRcXYK9O/zYS2ijWajh41Zq+A78VyEWCY7wI5v\n SVloj1dGhFYrQj7qY9DQhkGC9Y0RFZkjU4TyQBxVWMkhODvBct12Zop8YrHVqMx9Ctoi\n wjpDdUVjFnqBlnKCFQjZw73Q5GutiCvCIOCjWhKkAEkTdjXVjpnmlYRJeH48K3hVSY0Q\n 0i0zfOohk40sZWkBW0zjRDSEGFKgmNbRxcYf52PaNWtF0/gN4xgNZxvSqUlJaLSunMxz\n LW48bRg25ejD3hC6xpp0uhwsQRZ5XQkwjI8It+HfhSxiqEq2joSG5aFZlinrNuq9c1SE sw==",
        "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 v1 24/34] ml/cnxk: update internal info for TVM model",
        "Date": "Wed, 30 Aug 2023 08:59:14 -0700",
        "Message-ID": "<20230830155927.3566-25-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.41.0",
        "In-Reply-To": "<20230830155927.3566-1-syalavarthi@marvell.com>",
        "References": "<20230830155927.3566-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "WPeEhVmDhbKGUFbFLDs1OdeIYEgx4qRd",
        "X-Proofpoint-GUID": "WPeEhVmDhbKGUFbFLDs1OdeIYEgx4qRd",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.601,FMLib:17.11.176.26\n definitions=2023-08-30_12,2023-08-29_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": "Enabled updating internal IO info structures for TVM model.\nCompute static fields related to the model I/O.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/mvtvm_ml_model.c | 105 +++++++++++++++++++++++++++++++\n drivers/ml/cnxk/mvtvm_ml_model.h |   1 +\n drivers/ml/cnxk/mvtvm_ml_ops.c   |   3 +\n 3 files changed, 109 insertions(+)",
    "diff": "diff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c\nindex 425a682209f..86f465a645f 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.c\n@@ -7,10 +7,14 @@\n \n #include <rte_mldev.h>\n \n+#include <mldev_utils.h>\n+\n #include <roc_api.h>\n \n #include \"mvtvm_ml_model.h\"\n \n+#include \"cnxk_ml_model.h\"\n+\n /* Objects list */\n char mvtvm_object_list[ML_MVTVM_MODEL_OBJECT_MAX][RTE_ML_STR_MAX] = {\"mod.so\", \"mod.json\",\n \t\t\t\t\t\t\t\t     \"mod.params\"};\n@@ -71,3 +75,104 @@ mvtvm_ml_model_blob_parse(struct rte_ml_model_params *params, struct mvtvm_ml_mo\n \n \treturn -EINVAL;\n }\n+\n+static enum rte_ml_io_type\n+mvtvm_ml_io_type_map(uint8_t type)\n+{\n+\tswitch (type) {\n+\tcase kDLInt:\n+\t\treturn RTE_ML_IO_TYPE_INT32;\n+\tcase kDLUInt:\n+\t\treturn RTE_ML_IO_TYPE_UINT32;\n+\tcase kDLFloat:\n+\t\treturn RTE_ML_IO_TYPE_FP32;\n+\tcase kDLBfloat:\n+\t\treturn RTE_ML_IO_TYPE_BFLOAT16;\n+\t}\n+\n+\treturn RTE_ML_IO_TYPE_UNKNOWN;\n+}\n+\n+void\n+mvtvm_ml_model_io_info_update(struct cnxk_ml_model *model)\n+{\n+\tstruct tvmdp_model_metadata *metadata;\n+\tint32_t i;\n+\tint32_t j;\n+\n+\tif (model->subtype == ML_CNXK_MODEL_SUBTYPE_TVM_MRVL)\n+\t\tgoto tvm_mrvl_model;\n+\n+\tmetadata = &model->mvtvm.metadata;\n+\n+\t/* Inputs, set for layer_id = 0 */\n+\tmodel->mvtvm.info.nb_inputs = metadata->model.num_input;\n+\tmodel->mvtvm.info.total_input_sz_d = 0;\n+\tmodel->mvtvm.info.total_input_sz_q = 0;\n+\tfor (i = 0; i < metadata->model.num_input; i++) {\n+\t\tstrncpy(model->mvtvm.info.input[i].name, metadata->input[i].name,\n+\t\t\tTVMDP_NAME_STRLEN);\n+\t\tmodel->mvtvm.info.input[i].dtype =\n+\t\t\tmvtvm_ml_io_type_map(metadata->input[i].datatype.code);\n+\t\tmodel->mvtvm.info.input[i].qtype =\n+\t\t\tmvtvm_ml_io_type_map(metadata->input[i].model_datatype.code);\n+\t\tmodel->mvtvm.info.input[i].nb_dims = metadata->input[i].ndim;\n+\n+\t\tmodel->mvtvm.info.input[i].nb_elements = 1;\n+\t\tfor (j = 0; j < metadata->input[i].ndim; j++) {\n+\t\t\tmodel->mvtvm.info.input[i].shape[j] = metadata->input[i].shape[j];\n+\t\t\tmodel->mvtvm.info.input[i].nb_elements *= metadata->input[i].shape[j];\n+\t\t}\n+\n+\t\tmodel->mvtvm.info.input[i].sz_d =\n+\t\t\tmodel->mvtvm.info.input[i].nb_elements *\n+\t\t\trte_ml_io_type_size_get(model->mvtvm.info.input[i].dtype);\n+\t\tmodel->mvtvm.info.input[i].sz_q =\n+\t\t\tmodel->mvtvm.info.input[i].nb_elements *\n+\t\t\trte_ml_io_type_size_get(model->mvtvm.info.input[i].qtype);\n+\n+\t\tmodel->mvtvm.info.total_input_sz_d += model->mvtvm.info.input[i].sz_d;\n+\t\tmodel->mvtvm.info.total_input_sz_q += model->mvtvm.info.input[i].sz_q;\n+\n+\t\tplt_ml_dbg(\"model_id = %u, input[%u] - sz_d = %u sz_q = %u\", model->model_id, i,\n+\t\t\t   model->mvtvm.info.input[i].sz_d, model->mvtvm.info.input[i].sz_q);\n+\t}\n+\n+\t/* Outputs, set for nb_layers - 1 */\n+\tmodel->mvtvm.info.nb_outputs = metadata->model.num_output;\n+\tmodel->mvtvm.info.total_output_sz_d = 0;\n+\tmodel->mvtvm.info.total_output_sz_q = 0;\n+\tfor (i = 0; i < metadata->model.num_output; i++) {\n+\t\tstrncpy(model->mvtvm.info.output[i].name, metadata->output[i].name,\n+\t\t\tTVMDP_NAME_STRLEN);\n+\t\tmodel->mvtvm.info.output[i].dtype =\n+\t\t\tmvtvm_ml_io_type_map(metadata->output[i].datatype.code);\n+\t\tmodel->mvtvm.info.output[i].qtype =\n+\t\t\tmvtvm_ml_io_type_map(metadata->output[i].model_datatype.code);\n+\t\tmodel->mvtvm.info.output[i].nb_dims = metadata->output[i].ndim;\n+\n+\t\tmodel->mvtvm.info.output[i].nb_elements = 1;\n+\t\tfor (j = 0; j < metadata->output[i].ndim; j++) {\n+\t\t\tmodel->mvtvm.info.output[i].shape[j] = metadata->output[i].shape[j];\n+\t\t\tmodel->mvtvm.info.output[i].nb_elements *= metadata->output[i].shape[j];\n+\t\t}\n+\n+\t\tmodel->mvtvm.info.output[i].sz_d =\n+\t\t\tmodel->mvtvm.info.output[i].nb_elements *\n+\t\t\trte_ml_io_type_size_get(model->mvtvm.info.output[i].dtype);\n+\t\tmodel->mvtvm.info.output[i].sz_q =\n+\t\t\tmodel->mvtvm.info.output[i].nb_elements *\n+\t\t\trte_ml_io_type_size_get(model->mvtvm.info.output[i].qtype);\n+\n+\t\tmodel->mvtvm.info.total_output_sz_d += model->mvtvm.info.output[i].sz_d;\n+\t\tmodel->mvtvm.info.total_output_sz_q += model->mvtvm.info.output[i].sz_q;\n+\n+\t\tplt_ml_dbg(\"model_id = %u, output[%u] - sz_d = %u sz_q = %u\", model->model_id, i,\n+\t\t\t   model->mvtvm.info.output[i].sz_d, model->mvtvm.info.output[i].sz_q);\n+\t}\n+\n+\treturn;\n+\n+tvm_mrvl_model:\n+\tcn10k_ml_layer_io_info_update(&model->mvtvm.info, &model->layer[0].glow.metadata);\n+}\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_model.h b/drivers/ml/cnxk/mvtvm_ml_model.h\nindex 6c38217c158..2b25a7b568e 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.h\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.h\n@@ -47,5 +47,6 @@ struct mvtvm_ml_model_data {\n \n int mvtvm_ml_model_blob_parse(struct rte_ml_model_params *params,\n \t\t\t      struct mvtvm_ml_model_object *object);\n+void mvtvm_ml_model_io_info_update(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 5c30bbf6b89..a783e16e6eb 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_ops.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c\n@@ -181,6 +181,9 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *\n \t\tgoto error;\n \t}\n \n+\t/* Update model I/O data */\n+\tmvtvm_ml_model_io_info_update(model);\n+\n \treturn 0;\n \n error:\n",
    "prefixes": [
        "v1",
        "24/34"
    ]
}