get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133414,
    "url": "http://patches.dpdk.org/api/patches/133414/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231026124347.22477-32-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-32-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231026124347.22477-32-syalavarthi@marvell.com",
    "date": "2023-10-26T12:43:40",
    "name": "[v9,31/34] ml/cnxk: add generic ML malloc and free callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "bc81e0ec165710fb2198c1fb687d001f0190284e",
    "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-32-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/133414/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/133414/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 EDD5743208;\n\tThu, 26 Oct 2023 14:49:15 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E44F242EB3;\n\tThu, 26 Oct 2023 14:44:30 +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 404FF42E19\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 39QAKqce006841 for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:04 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3txcsr25pj-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-EXCH01.marvell.com\n (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.48;\n Thu, 26 Oct 2023 05:44:02 -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:02 -0700",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id CAE163F70C0;\n Thu, 26 Oct 2023 05:44:01 -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=sGRRyhF5yMVAYPVYPi/vbnlS8t/Cq6ovep4gB7DzMNo=;\n b=Ht0Yrr0akbVR/RPQWCBlfxTD+z7GyIjTsyQSlZV8kuQ16uYIdisFJxPhIHi+C/8lU0Gm\n H1eeqiOxkVjr15gXbRaqqPnlYjivKAOAhIob7JgOlDTeXYYRyEyPzqwrJdkEc2/ylhkt\n rDlJOA/D+x7IXFgBNVuBw1PqCYoTx1p8M7R4fSvUmCHo3vegOOtCicC2FNnibReE1Lck\n tNQouc5GbZqcxu6zviHoyjvSC+hCsD1YWJXnnyNl4wwJ6do8e9QnfPdD+vK12rwBHFIs\n siR0SlEq3WFEA/0NO0EYdS5CHFwR/BlO0usEH+w8kMVYaD9cMLMunNx3BotmCpyOMtsK fw==",
        "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 31/34] ml/cnxk: add generic ML malloc and free callback",
        "Date": "Thu, 26 Oct 2023 05:43:40 -0700",
        "Message-ID": "<20231026124347.22477-32-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": "DnKYBSLXAwBBR1RGSNvOCIyb_LA-E6dV",
        "X-Proofpoint-GUID": "DnKYBSLXAwBBR1RGSNvOCIyb_LA-E6dV",
        "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": "Implemented generic ML malloc and free callbacks\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cn10k_ml_ops.c | 30 ++++++++++++++++++++++++++++++\n drivers/ml/cnxk/cn10k_ml_ops.h |  3 +++\n drivers/ml/cnxk/mvtvm_ml_ops.c |  2 ++\n 3 files changed, 35 insertions(+)",
    "diff": "diff --git a/drivers/ml/cnxk/cn10k_ml_ops.c b/drivers/ml/cnxk/cn10k_ml_ops.c\nindex 7802425c87..01b0a44caa 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.c\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.c\n@@ -1497,3 +1497,33 @@ cn10k_ml_io_free(void *device, uint16_t model_id, const char *layer_name)\n \n \treturn plt_memzone_free(mz);\n }\n+\n+int\n+cn10k_ml_malloc(const char *name, size_t size, uint32_t align, void **addr)\n+{\n+\tconst struct plt_memzone *mz;\n+\n+\tmz = plt_memzone_reserve_aligned(name, size, 0, align);\n+\tif (mz == NULL) {\n+\t\tplt_err(\"ml_malloc failed: Unable to allocate memory: name = %s\", name);\n+\t\treturn -ENOMEM;\n+\t}\n+\n+\t*addr = mz->addr;\n+\n+\treturn 0;\n+}\n+\n+int\n+cn10k_ml_free(const char *name)\n+{\n+\tconst struct plt_memzone *mz;\n+\n+\tmz = plt_memzone_lookup(name);\n+\tif (mz == NULL) {\n+\t\tplt_err(\"ml_free failed: Memzone not found: name = %s\", name);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn plt_memzone_free(mz);\n+}\ndiff --git a/drivers/ml/cnxk/cn10k_ml_ops.h b/drivers/ml/cnxk/cn10k_ml_ops.h\nindex 9c41c1c0b0..eb3e1c139c 100644\n--- a/drivers/ml/cnxk/cn10k_ml_ops.h\n+++ b/drivers/ml/cnxk/cn10k_ml_ops.h\n@@ -333,6 +333,9 @@ int cn10k_ml_io_alloc(void *device, uint16_t model_id, const char *layer_name,\n \t\t      uint64_t **input_qbuffer, uint64_t **output_qbuffer);\n int cn10k_ml_io_free(void *device, uint16_t model_id, const char *layer_name);\n \n+int cn10k_ml_malloc(const char *name, size_t size, uint32_t align, void **addr);\n+int cn10k_ml_free(const char *name);\n+\n /* xstats ops */\n void cn10k_ml_xstat_model_name_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model,\n \t\t\t\t   uint16_t stat_id, uint16_t entry, char *suffix);\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_ops.c b/drivers/ml/cnxk/mvtvm_ml_ops.c\nindex a50b31ec6e..9d59e28661 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_ops.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_ops.c\n@@ -234,6 +234,8 @@ mvtvm_ml_model_load(struct cnxk_ml_dev *cnxk_mldev, struct rte_ml_model_params *\n \t\tcallback->tvmrt_glow_layer_unload = cn10k_ml_layer_unload;\n \t\tcallback->tvmrt_io_alloc = cn10k_ml_io_alloc;\n \t\tcallback->tvmrt_io_free = cn10k_ml_io_free;\n+\t\tcallback->tvmrt_malloc = cn10k_ml_malloc;\n+\t\tcallback->tvmrt_free = cn10k_ml_free;\n \t} else {\n \t\tcallback = NULL;\n \t}\n",
    "prefixes": [
        "v9",
        "31/34"
    ]
}