get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133408,
    "url": "http://patches.dpdk.org/api/patches/133408/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231026124347.22477-29-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-29-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231026124347.22477-29-syalavarthi@marvell.com",
    "date": "2023-10-26T12:43:37",
    "name": "[v9,28/34] ml/cnxk: support device dump for TVM models",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e231a862a991b6a77a13d0d9ad6b7452bd0bb4ef",
    "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-29-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/133408/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/133408/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 7193043208;\n\tThu, 26 Oct 2023 14:48:01 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 319B742E95;\n\tThu, 26 Oct 2023 14:44:24 +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 13EC142E04\n for <dev@dpdk.org>; Thu, 26 Oct 2023 14:44:02 +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 39QAKqcc006841 for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:02 -0700",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3txcsr25pj-13\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 26 Oct 2023 05:44:02 -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 Thu, 26 Oct 2023 05:44:01 -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; 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 D47535B692F;\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=H64JQBvJJ5KXiAAHkS/BBEwyne5Q4+h+72k9sMIF7Dk=;\n b=dhGIXCiSq1wqJPONvy+yvACDufYQziZDWP4YCPj/32t7J+eKkjbPirtpnty+GCZ/yROR\n GHoDvQtXSX5tQjL177M6zousW+rFS2IhAumYn5ychhcFII/IeVe3xO7zFoiQZeBVmpsW\n Csje8J/obArcs/bFFDjdgkLaJl4mvBaHHzr1bFj8Y5UrH6ZQgv3WdGaLAHaSvt8agv44\n SasY+/TmdXAtcGO8FQWznGg4GGoqh/FmJwT+S7bnyDdkZUv+uoAOk5pnKmanVsPKSEON\n +XKSL3s8aLtjWhQtTfjUhhxEqapcFl/InlctIjx7F+OFVg+hqwHxb2vyNpMUCTNEEWtE nA==",
        "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 28/34] ml/cnxk: support device dump for TVM models",
        "Date": "Thu, 26 Oct 2023 05:43:37 -0700",
        "Message-ID": "<20231026124347.22477-29-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": "AqbFZefeB7-c3GkY5_eGRGhmK4eHupFq",
        "X-Proofpoint-GUID": "AqbFZefeB7-c3GkY5_eGRGhmK4eHupFq",
        "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": "Enabled support to print TVM model layer info.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n drivers/ml/cnxk/cnxk_ml_model.c  |  7 +++-\n drivers/ml/cnxk/mvtvm_ml_model.c | 59 ++++++++++++++++++++++++++++++++\n drivers/ml/cnxk/mvtvm_ml_model.h |  2 ++\n drivers/ml/cnxk/mvtvm_ml_stubs.c |  8 +++++\n drivers/ml/cnxk/mvtvm_ml_stubs.h |  2 ++\n 5 files changed, 77 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/ml/cnxk/cnxk_ml_model.c b/drivers/ml/cnxk/cnxk_ml_model.c\nindex 02f80410ec..ed6a1ed866 100644\n--- a/drivers/ml/cnxk/cnxk_ml_model.c\n+++ b/drivers/ml/cnxk/cnxk_ml_model.c\n@@ -68,6 +68,8 @@ cnxk_ml_model_dump(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model,\n \tcnxk_ml_print_line(fp, LINE_LEN);\n \tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"model_id\", model->model_id);\n \tfprintf(fp, \"%*s : %s\\n\", FIELD_LEN, \"name\", model->name);\n+\tfprintf(fp, \"%*s : %d\\n\", FIELD_LEN, \"type\", model->type);\n+\tfprintf(fp, \"%*s : %d\\n\", FIELD_LEN, \"subtype\", model->subtype);\n \tfprintf(fp, \"%*s : 0x%016lx\\n\", FIELD_LEN, \"model\", PLT_U64_CAST(model));\n \tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"batch_size\", model->batch_size);\n \tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"nb_layers\", model->nb_layers);\n@@ -84,6 +86,9 @@ cnxk_ml_model_dump(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *model,\n \n \tfor (layer_id = 0; layer_id < model->nb_layers; layer_id++) {\n \t\tlayer = &model->layer[layer_id];\n-\t\tcn10k_ml_layer_print(cnxk_mldev, layer, fp);\n+\t\tif (layer->type == ML_CNXK_LAYER_TYPE_MRVL)\n+\t\t\tcn10k_ml_layer_print(cnxk_mldev, layer, fp);\n+\t\telse\n+\t\t\tmvtvm_ml_layer_print(cnxk_mldev, layer, fp);\n \t}\n }\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_model.c b/drivers/ml/cnxk/mvtvm_ml_model.c\nindex 88f2738423..e5ba672788 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.c\n@@ -13,6 +13,7 @@\n \n #include \"cnxk_ml_dev.h\"\n #include \"cnxk_ml_model.h\"\n+#include \"cnxk_ml_utils.h\"\n \n /* Objects list */\n char mvtvm_object_list[ML_MVTVM_MODEL_OBJECT_MAX][RTE_ML_STR_MAX] = {\"mod.so\", \"mod.json\",\n@@ -334,3 +335,61 @@ mvtvm_ml_model_info_set(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo\n \t\t\t\t&model->layer[0].glow.metadata);\n \tinfo->io_layout = RTE_ML_IO_LAYOUT_SPLIT;\n }\n+\n+void\n+mvtvm_ml_layer_print(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer, FILE *fp)\n+{\n+\tchar str[STR_LEN];\n+\tuint8_t i;\n+\n+\t/* Print debug info */\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \" Layer Information (Layer ID: %u, Name: %s)\\n\",\n+\t\tcnxk_mldev->index_map[layer->index].layer_id, layer->name);\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"layer_id\",\n+\t\tcnxk_mldev->index_map[layer->index].layer_id);\n+\tfprintf(fp, \"%*s : %s\\n\", FIELD_LEN, \"name\", layer->name);\n+\tfprintf(fp, \"%*s : %d\\n\", FIELD_LEN, \"type\", layer->type);\n+\tfprintf(fp, \"%*s : 0x%016lx\\n\", FIELD_LEN, \"layer\", PLT_U64_CAST(layer));\n+\tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"batch_size\", layer->batch_size);\n+\n+\t/* Print model state */\n+\tif (layer->state == ML_CNXK_LAYER_STATE_LOADED)\n+\t\tfprintf(fp, \"%*s : %s\\n\", FIELD_LEN, \"state\", \"loaded\");\n+\tif (layer->state == ML_CNXK_LAYER_STATE_JOB_ACTIVE)\n+\t\tfprintf(fp, \"%*s : %s\\n\", FIELD_LEN, \"state\", \"job_active\");\n+\tif (layer->state == ML_CNXK_LAYER_STATE_STARTED)\n+\t\tfprintf(fp, \"%*s : %s\\n\", FIELD_LEN, \"state\", \"started\");\n+\n+\tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"num_inputs\", layer->info.nb_inputs);\n+\tfprintf(fp, \"%*s : %u\\n\", FIELD_LEN, \"num_outputs\", layer->info.nb_outputs);\n+\tfprintf(fp, \"\\n\");\n+\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \"%8s  %16s  %12s\\n\", \"input\", \"input_name\", \"input_type\");\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfor (i = 0; i < layer->info.nb_inputs; i++) {\n+\t\tfprintf(fp, \"%8u  \", i);\n+\t\tfprintf(fp, \"%*s  \", 16, layer->info.input[i].name);\n+\t\trte_ml_io_type_to_str(layer->info.input[i].qtype, str, STR_LEN);\n+\t\tfprintf(fp, \"%*s  \", 12, str);\n+\t}\n+\tfprintf(fp, \"\\n\");\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \"\\n\");\n+\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \"%8s  %16s  %12s\\n\", \"output\", \"output_name\", \"output_type\");\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfor (i = 0; i < layer->info.nb_outputs; i++) {\n+\t\tfprintf(fp, \"%8u  \", i);\n+\t\tfprintf(fp, \"%*s  \", 16, layer->info.output[i].name);\n+\t\trte_ml_io_type_to_str(layer->info.output[i].qtype, str, STR_LEN);\n+\t\tfprintf(fp, \"%*s  \", 12, str);\n+\t\tfprintf(fp, \"\\n\");\n+\t}\n+\tfprintf(fp, \"\\n\");\n+\tcnxk_ml_print_line(fp, LINE_LEN);\n+\tfprintf(fp, \"\\n\");\n+}\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_model.h b/drivers/ml/cnxk/mvtvm_ml_model.h\nindex a1247ffbde..900ba44fa0 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_model.h\n+++ b/drivers/ml/cnxk/mvtvm_ml_model.h\n@@ -13,6 +13,7 @@\n \n struct cnxk_ml_dev;\n struct cnxk_ml_model;\n+struct cnxk_ml_layer;\n \n /* Maximum number of objects per model */\n #define ML_MVTVM_MODEL_OBJECT_MAX 3\n@@ -54,5 +55,6 @@ int mvtvm_ml_model_get_layer_id(struct cnxk_ml_model *model, const char *layer_n\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+void mvtvm_ml_layer_print(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer, FILE *fp);\n \n #endif /* _MVTVM_ML_MODEL_H_ */\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_stubs.c b/drivers/ml/cnxk/mvtvm_ml_stubs.c\nindex b8c2e6a1fc..260a051b08 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_stubs.c\n+++ b/drivers/ml/cnxk/mvtvm_ml_stubs.c\n@@ -36,6 +36,14 @@ mvtvm_ml_model_io_info_get(struct cnxk_ml_model *model, uint16_t layer_id)\n \treturn NULL;\n }\n \n+void\n+mvtvm_ml_layer_print(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer, FILE *fp)\n+{\n+\tRTE_SET_USED(cnxk_mldev);\n+\tRTE_SET_USED(layer);\n+\tRTE_SET_USED(fp);\n+}\n+\n int\n mvtvm_ml_dev_configure(struct cnxk_ml_dev *cnxk_mldev, const struct rte_ml_dev_config *conf)\n {\ndiff --git a/drivers/ml/cnxk/mvtvm_ml_stubs.h b/drivers/ml/cnxk/mvtvm_ml_stubs.h\nindex 1eb663b1d1..d6d0edbcf1 100644\n--- a/drivers/ml/cnxk/mvtvm_ml_stubs.h\n+++ b/drivers/ml/cnxk/mvtvm_ml_stubs.h\n@@ -9,6 +9,7 @@\n \n struct cnxk_ml_dev;\n struct cnxk_ml_model;\n+struct cnxk_ml_layer;\n \n enum cnxk_ml_model_type mvtvm_ml_model_type_get(struct rte_ml_model_params *params);\n int mvtvm_ml_dev_configure(struct cnxk_ml_dev *cnxk_mldev, const struct rte_ml_dev_config *conf);\n@@ -22,5 +23,6 @@ int mvtvm_ml_model_stop(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_model *mo\n int mvtvm_ml_model_get_layer_id(struct cnxk_ml_model *model, const char *layer_name,\n \t\t\t\tuint16_t *layer_id);\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_layer_print(struct cnxk_ml_dev *cnxk_mldev, struct cnxk_ml_layer *layer, FILE *fp);\n \n #endif /* _MVTVM_ML_STUBS_H_ */\n",
    "prefixes": [
        "v9",
        "28/34"
    ]
}