get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132868,
    "url": "http://patches.dpdk.org/api/patches/132868/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231018064806.24145-26-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": "<20231018064806.24145-26-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231018064806.24145-26-syalavarthi@marvell.com",
    "date": "2023-10-18T06:47:53",
    "name": "[v5,25/34] ml/cnxk: enable OCM check for multilayer TVM model",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "998f25782f0718e27dc4758c94331a3c2c5f3c7c",
    "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/20231018064806.24145-26-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 29898,
            "url": "http://patches.dpdk.org/api/series/29898/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=29898",
            "date": "2023-10-18T06:47:28",
            "name": "Implementation of revised ml/cnxk driver",
            "version": 5,
            "mbox": "http://patches.dpdk.org/series/29898/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/132868/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/132868/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 CBE5843196;\n\tWed, 18 Oct 2023 08:51:35 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A0E5D42E71;\n\tWed, 18 Oct 2023 08:48:50 +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 84002427D7\n for <dev@dpdk.org>; Wed, 18 Oct 2023 08:48:24 +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 39I3vKK7020024 for <dev@dpdk.org>; Tue, 17 Oct 2023 23:48:24 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3tstb3ursq-19\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Tue, 17 Oct 2023 23:48:23 -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:17 -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:17 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id A38A85B696D;\n Tue, 17 Oct 2023 23:48:16 -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=gkQBB8jd7+puHBQS/i4pyAANg3JRWgZmI+waOOACzS4=;\n b=lTVn1hZyIdIdNqXbRRyv+/sMxiiiXLsL/U6fT7kuoIv4/bD8BeiujUt746BY7uNvYBo+\n zlRjFPTjCuEw8N9Yt5EYh3x7ozfHkP77oVqGLOZhMKr+AzYuRMQ2LwDhscOLsEt8Owgs\n r/Lm3Tx5d4ZFdachllTHFFZKFfe7k9BjnfpRx380hjzwtlJdgVJpNcvIcsSBi8UpbMg0\n rl0gv2Hk03xcwH8ldeHZ4KH+vepiTBy+PQxyHno2Mv7O/vrNGQRB2qhNv8FZJNUjKu1w\n NkaXniea8d9NhDa0o8nBiIn+sURlepAdqoEcStNUWy20FW0hC4ITU8XLYpj/cv7RzCax yA==",
        "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 25/34] ml/cnxk: enable OCM check for multilayer TVM model",
        "Date": "Tue, 17 Oct 2023 23:47:53 -0700",
        "Message-ID": "<20231018064806.24145-26-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": "WK_iR3hpUk0e5FwYzE9FHVIdIeFSO24N",
        "X-Proofpoint-GUID": "WK_iR3hpUk0e5FwYzE9FHVIdIeFSO24N",
        "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": "From: Anup Prabhu <aprabhu@marvell.com>\n\nEnabled check for OCM size requirement for multi-layer\nTVM model. Compute OCM scratch and WB requirement for\nall layers during the load stage.\n\nSigned-off-by: Anup Prabhu <aprabhu@marvell.com>\n---\n drivers/ml/cnxk/cnxk_ml_ops.c | 60 +++++++++++++++++++++++++++++++++++\n 1 file changed, 60 insertions(+)",
    "diff": "diff --git a/drivers/ml/cnxk/cnxk_ml_ops.c b/drivers/ml/cnxk/cnxk_ml_ops.c\nindex cd95a3c7ad..03f4783b3f 100644\n--- a/drivers/ml/cnxk/cnxk_ml_ops.c\n+++ b/drivers/ml/cnxk/cnxk_ml_ops.c\n@@ -1023,8 +1023,12 @@ cnxk_ml_model_load(struct rte_ml_dev *dev, struct rte_ml_model_params *params, u\n \n \tchar str[RTE_MEMZONE_NAMESIZE];\n \tconst struct plt_memzone *mz;\n+\tuint16_t max_scratch_pages;\n+\tstruct cn10k_ml_ocm *ocm;\n \tuint64_t model_info_size;\n+\tuint16_t total_wb_pages;\n \tuint16_t lcl_model_id;\n+\tuint16_t layer_id;\n \tuint64_t mz_size;\n \tbool found;\n \tint ret;\n@@ -1086,6 +1090,62 @@ cnxk_ml_model_load(struct rte_ml_dev *dev, struct rte_ml_model_params *params, u\n \tif (ret != 0)\n \t\tgoto error;\n \n+\tmax_scratch_pages = 0;\n+\ttotal_wb_pages = 0;\n+\tlayer_id = 0;\n+\n+\tocm = &cnxk_mldev->cn10k_mldev.ocm;\n+\n+\tif (model->type == ML_CNXK_MODEL_TYPE_GLOW) {\n+\t\ttotal_wb_pages = total_wb_pages + model->layer[layer_id].glow.ocm_map.wb_pages;\n+\t\tmax_scratch_pages = PLT_MAX(max_scratch_pages,\n+\t\t\t\t\t    model->layer[layer_id].glow.ocm_map.scratch_pages);\n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+\t} else {\n+\t\tfor (layer_id = 0; layer_id < model->mvtvm.metadata.model.nb_layers; layer_id++) {\n+\t\t\tif (model->layer[layer_id].type == ML_CNXK_LAYER_TYPE_MRVL) {\n+\t\t\t\ttotal_wb_pages = total_wb_pages +\n+\t\t\t\t\t\t model->layer[layer_id].glow.ocm_map.wb_pages;\n+\t\t\t\tmax_scratch_pages =\n+\t\t\t\t\tPLT_MAX(max_scratch_pages,\n+\t\t\t\t\t\tmodel->layer[layer_id].glow.ocm_map.scratch_pages);\n+\t\t\t}\n+\t\t}\n+#endif\n+\t}\n+\n+\tif ((total_wb_pages + max_scratch_pages) > ocm->num_pages) {\n+\t\tplt_err(\"model_id = %u: total_wb_pages (%u) + scratch_pages (%u) >  %u\\n\",\n+\t\t\tlcl_model_id, total_wb_pages, max_scratch_pages, ocm->num_pages);\n+\n+\t\tif (model->type == ML_CNXK_MODEL_TYPE_GLOW) {\n+\t\t\tplt_ml_dbg(\"layer_id = %u: wb_pages = %u, scratch_pages = %u\\n\", layer_id,\n+\t\t\t\t   model->layer[layer_id].glow.ocm_map.wb_pages,\n+\t\t\t\t   model->layer[layer_id].glow.ocm_map.scratch_pages);\n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+\t\t} else {\n+\t\t\tfor (layer_id = 0; layer_id < model->mvtvm.metadata.model.nb_layers;\n+\t\t\t     layer_id++) {\n+\t\t\t\tif (model->layer[layer_id].type == ML_CNXK_LAYER_TYPE_MRVL) {\n+\t\t\t\t\tplt_ml_dbg(\n+\t\t\t\t\t\t\"layer_id = %u: wb_pages = %u, scratch_pages = %u\\n\",\n+\t\t\t\t\t\tlayer_id,\n+\t\t\t\t\t\tmodel->layer[layer_id].glow.ocm_map.wb_pages,\n+\t\t\t\t\t\tmodel->layer[layer_id].glow.ocm_map.scratch_pages);\n+\t\t\t\t}\n+\t\t\t}\n+#endif\n+\t\t}\n+\n+\t\tif (model->type == ML_CNXK_MODEL_TYPE_GLOW)\n+\t\t\tcn10k_ml_model_unload(cnxk_mldev, model);\n+#ifdef RTE_MLDEV_CNXK_ENABLE_MVTVM\n+\t\telse {\n+\t\t\tmvtvm_ml_model_unload(cnxk_mldev, model);\n+\t\t\treturn -ENOMEM;\n+\t\t}\n+#endif\n+\t}\n \tplt_spinlock_init(&model->lock);\n \tmodel->state = ML_CNXK_MODEL_STATE_LOADED;\n \tcnxk_mldev->nb_models_loaded++;\n",
    "prefixes": [
        "v5",
        "25/34"
    ]
}