get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 120585,
    "url": "https://patches.dpdk.org/api/patches/120585/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20221208192918.25022-2-syalavarthi@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20221208192918.25022-2-syalavarthi@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221208192918.25022-2-syalavarthi@marvell.com",
    "date": "2022-12-08T19:29:08",
    "name": "[v3,02/12] app/mldev: add common test functions",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d837fd789e013c1b87ccebb99b7ef8b13ee9df5e",
    "submitter": {
        "id": 2480,
        "url": "https://patches.dpdk.org/api/people/2480/?format=api",
        "name": "Srikanth Yalavarthi",
        "email": "syalavarthi@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20221208192918.25022-2-syalavarthi@marvell.com/mbox/",
    "series": [
        {
            "id": 26046,
            "url": "https://patches.dpdk.org/api/series/26046/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26046",
            "date": "2022-12-08T19:29:07",
            "name": "[v3,01/12] app/mldev: implement test framework for mldev",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/26046/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/120585/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/120585/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 9F710A00C2;\n\tThu,  8 Dec 2022 20:30:02 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 576E342D24;\n\tThu,  8 Dec 2022 20:29:51 +0100 (CET)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 8259D410FB\n for <dev@dpdk.org>; Thu,  8 Dec 2022 20:29:47 +0100 (CET)",
            "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 2B8J8Kbv009591 for <dev@dpdk.org>; Thu, 8 Dec 2022 11:29:46 -0800",
            "from dc5-exch01.marvell.com ([199.233.59.181])\n by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3m86usnccx-2\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT)\n for <dev@dpdk.org>; Thu, 08 Dec 2022 11:29:46 -0800",
            "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.2;\n Thu, 8 Dec 2022 11:29:44 -0800",
            "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.18 via Frontend\n Transport; Thu, 8 Dec 2022 11:29:44 -0800",
            "from ml-host-33.caveonetworks.com (unknown [10.110.143.233])\n by maili.marvell.com (Postfix) with ESMTP id 04C9E3F7058;\n Thu,  8 Dec 2022 11:29:43 -0800 (PST)"
        ],
        "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-type; s=pfpt0220; bh=tjn1Wk2XSLsoTquAuOMxYDjJYoCDJb13EqpMpwTjKzc=;\n b=Z+hDxyD2x/craDhxuyYOvyGDmQphEtCu20Muk4qI9CuapIBM/ptgDkjYRFisR5Yhu4Ct\n qRvjnk9FyRvKHxUuu/pz7fK/0CyL+pwPmbBFGLe27is7xZfVp1Y01657PZnUnbBDl1OE\n 53B6aYqkesCWhbdGgETPoC+0ezenhAynmXFlqojPTBb6iBTMdaNLDiHRjEDSYMwromvq\n TDIJBT+6CwDPVfGEtwljxQgJnNg1/+9e5dFfWFAPnWZiyKeflc9NakGjauAmpIGW990p\n IC0kDIVgllLaCxsx4ucYkeyqL4++yZER6lnY7SCfGQNup2dmMndp3qdOyWJ8jz3gJhpZ Vw==",
        "From": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "To": "Srikanth Yalavarthi <syalavarthi@marvell.com>",
        "CC": "<dev@dpdk.org>, <sshankarnara@marvell.com>, <jerinj@marvell.com>,\n <aprabhu@marvell.com>",
        "Subject": "[PATCH v3 02/12] app/mldev: add common test functions",
        "Date": "Thu, 8 Dec 2022 11:29:08 -0800",
        "Message-ID": "<20221208192918.25022-2-syalavarthi@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20221208192918.25022-1-syalavarthi@marvell.com>",
        "References": "<20221129082109.6809-1-syalavarthi@marvell.com>\n <20221208192918.25022-1-syalavarthi@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Proofpoint-GUID": "i769wIJxQnA5G90pX_8p2WeOtuzNNiz1",
        "X-Proofpoint-ORIG-GUID": "i769wIJxQnA5G90pX_8p2WeOtuzNNiz1",
        "X-Proofpoint-Virus-Version": "vendor=baseguard\n engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1\n definitions=2022-12-08_11,2022-12-08_01,2022-06-22_01",
        "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": "Added common functions used by all tests. Common code\nincludes functions to check capabilities, options, and\nhandle ML devices.\n\nSigned-off-by: Srikanth Yalavarthi <syalavarthi@marvell.com>\n---\n app/test-mldev/meson.build   |   1 +\n app/test-mldev/test_common.c | 139 +++++++++++++++++++++++++++++++++++\n app/test-mldev/test_common.h |  27 +++++++\n 3 files changed, 167 insertions(+)\n create mode 100644 app/test-mldev/test_common.c\n create mode 100644 app/test-mldev/test_common.h",
    "diff": "diff --git a/app/test-mldev/meson.build b/app/test-mldev/meson.build\nindex 8ca2e1a1c1..964bb9ddc4 100644\n--- a/app/test-mldev/meson.build\n+++ b/app/test-mldev/meson.build\n@@ -12,6 +12,7 @@ sources = files(\n         'ml_options.c',\n         'ml_test.c',\n         'parser.c',\n+        'test_common.c',\n )\n \n deps += ['mldev']\ndiff --git a/app/test-mldev/test_common.c b/app/test-mldev/test_common.c\nnew file mode 100644\nindex 0000000000..b6b32904e4\n--- /dev/null\n+++ b/app/test-mldev/test_common.c\n@@ -0,0 +1,139 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2022 Marvell.\n+ */\n+\n+#include <errno.h>\n+#include <stdbool.h>\n+#include <stdint.h>\n+\n+#include <rte_common.h>\n+#include <rte_memory.h>\n+#include <rte_mldev.h>\n+\n+#include \"ml_common.h\"\n+#include \"ml_options.h\"\n+#include \"test_common.h\"\n+\n+bool\n+ml_test_cap_check(struct ml_options *opt)\n+{\n+\tstruct rte_ml_dev_info dev_info;\n+\n+\trte_ml_dev_info_get(opt->dev_id, &dev_info);\n+\tif (dev_info.max_models == 0) {\n+\t\tml_err(\"Not enough mldev models supported = %d\", dev_info.max_models);\n+\t\treturn false;\n+\t}\n+\n+\treturn true;\n+}\n+\n+int\n+ml_test_opt_check(struct ml_options *opt)\n+{\n+\tuint16_t dev_count;\n+\tint socket_id;\n+\n+\tRTE_SET_USED(opt);\n+\n+\tdev_count = rte_ml_dev_count();\n+\tif (dev_count == 0) {\n+\t\tml_err(\"No ML devices found\");\n+\t\treturn -ENODEV;\n+\t}\n+\n+\tif (opt->dev_id >= dev_count) {\n+\t\tml_err(\"Invalid option dev_id = %d\", opt->dev_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tsocket_id = rte_ml_dev_socket_id(opt->dev_id);\n+\tif (!((opt->socket_id != SOCKET_ID_ANY) || (opt->socket_id != socket_id))) {\n+\t\tml_err(\"Invalid option, socket_id = %d\\n\", opt->socket_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+void\n+ml_test_opt_dump(struct ml_options *opt)\n+{\n+\tml_options_dump(opt);\n+}\n+\n+int\n+ml_test_device_configure(struct ml_test *test, struct ml_options *opt)\n+{\n+\tstruct test_common *t = ml_test_priv(test);\n+\tstruct rte_ml_dev_config dev_config;\n+\tint ret;\n+\n+\tret = rte_ml_dev_info_get(opt->dev_id, &t->dev_info);\n+\tif (ret != 0) {\n+\t\tml_err(\"Failed to get mldev info, dev_id = %d\\n\", opt->dev_id);\n+\t\treturn ret;\n+\t}\n+\n+\t/* configure device */\n+\tdev_config.socket_id = opt->socket_id;\n+\tdev_config.nb_models = t->dev_info.max_models;\n+\tdev_config.nb_queue_pairs = t->dev_info.max_queue_pairs;\n+\tret = rte_ml_dev_configure(opt->dev_id, &dev_config);\n+\tif (ret != 0) {\n+\t\tml_err(\"Failed to configure ml device, dev_id = %d\\n\", opt->dev_id);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+ml_test_device_close(struct ml_test *test, struct ml_options *opt)\n+{\n+\tstruct test_common *t = ml_test_priv(test);\n+\tint ret = 0;\n+\n+\tRTE_SET_USED(t);\n+\n+\t/* close device */\n+\tret = rte_ml_dev_close(opt->dev_id);\n+\tif (ret != 0)\n+\t\tml_err(\"Failed to close ML device, dev_id = %d\\n\", opt->dev_id);\n+\n+\treturn ret;\n+}\n+\n+int\n+ml_test_device_start(struct ml_test *test, struct ml_options *opt)\n+{\n+\tstruct test_common *t = ml_test_priv(test);\n+\tint ret;\n+\n+\tRTE_SET_USED(t);\n+\n+\t/* start device */\n+\tret = rte_ml_dev_start(opt->dev_id);\n+\tif (ret != 0) {\n+\t\tml_err(\"Failed to start ml device, dev_id = %d\\n\", opt->dev_id);\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n+int\n+ml_test_device_stop(struct ml_test *test, struct ml_options *opt)\n+{\n+\tstruct test_common *t = ml_test_priv(test);\n+\tint ret = 0;\n+\n+\tRTE_SET_USED(t);\n+\n+\t/* stop device */\n+\tret = rte_ml_dev_stop(opt->dev_id);\n+\tif (ret != 0)\n+\t\tml_err(\"Failed to stop ML device, dev_id = %d\\n\", opt->dev_id);\n+\n+\treturn ret;\n+}\ndiff --git a/app/test-mldev/test_common.h b/app/test-mldev/test_common.h\nnew file mode 100644\nindex 0000000000..05a2e43e2f\n--- /dev/null\n+++ b/app/test-mldev/test_common.h\n@@ -0,0 +1,27 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2022 Marvell.\n+ */\n+\n+#ifndef _ML_TEST_COMMON_\n+#define _ML_TEST_COMMON_\n+\n+#include <rte_mldev.h>\n+\n+#include \"ml_options.h\"\n+#include \"ml_test.h\"\n+\n+struct test_common {\n+\tstruct ml_options *opt;\n+\tenum ml_test_result result;\n+\tstruct rte_ml_dev_info dev_info;\n+};\n+\n+bool ml_test_cap_check(struct ml_options *opt);\n+int ml_test_opt_check(struct ml_options *opt);\n+void ml_test_opt_dump(struct ml_options *opt);\n+int ml_test_device_configure(struct ml_test *test, struct ml_options *opt);\n+int ml_test_device_close(struct ml_test *test, struct ml_options *opt);\n+int ml_test_device_start(struct ml_test *test, struct ml_options *opt);\n+int ml_test_device_stop(struct ml_test *test, struct ml_options *opt);\n+\n+#endif /* _ML_TEST_COMMON_ */\n",
    "prefixes": [
        "v3",
        "02/12"
    ]
}