get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133415,
    "url": "http://patches.dpdk.org/api/patches/133415/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231026124347.22477-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": "<20231026124347.22477-26-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231026124347.22477-26-syalavarthi@marvell.com",
    "date": "2023-10-26T12:43:34",
    "name": "[v9,25/34] ml/cnxk: enable OCM check for multilayer TVM model",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "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/20231026124347.22477-26-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/133415/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/133415/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 0F94D43208;\n\tThu, 26 Oct 2023 14:49:27 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F37A842EBA;\n\tThu, 26 Oct 2023 14:44:31 +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 8EF4542E1B\n for <dev@dpdk.org>; Thu, 26 Oct 2023 14:44:05 +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 39QALk0F007523 for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:05 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3txcsr25pc-16\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:04 -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:00 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id E22273F709C;\n Thu, 26 Oct 2023 05:43:59 -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=Uzxyi/YiCwRE4oCS2mXIPnja0Wxh9gAb2OKOy+Zg3Zg=;\n b=jdBiGa2miL05Faazrc6+HIMRY0noOItpD5RXtCeuu7LTP2X/FZwxXQU6AFdn5Vk2yLYB\n VjPz0S647e7G9CehYh1db8qjtZ1X4dYdf4D5NOj2ZPB+6Y9PPMnXdpAeFW8KEnviz7Yd\n owMSvIPhMudVUijEpx7MaaigO1nZbfs577nN22E1QObmvtCZ/WKEOjAcp6dfq/W7aLNP\n d303xtr8m1jAzIapfGOxQZXDfDQDPiTNSKGDZ5/jFdqpuslIXSxHN87bcXHylZZpJtit\n FAEsXILuJwMOwalMvFv7SDC7ya6XLO/7Ra3ToA1SwbISm1yI4EoqjTKQA6OZXIXDHdBC zw==",
        "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 25/34] ml/cnxk: enable OCM check for multilayer TVM model",
        "Date": "Thu, 26 Oct 2023 05:43:34 -0700",
        "Message-ID": "<20231026124347.22477-26-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": "StWhyZ1LS3Rj7iDCJZo7_UaTidEpbNOu",
        "X-Proofpoint-GUID": "StWhyZ1LS3Rj7iDCJZo7_UaTidEpbNOu",
        "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: 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 ce668e1eb6..d1471971e4 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": [
        "v9",
        "25/34"
    ]
}