get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 117704,
    "url": "http://patches.dpdk.org/api/patches/117704/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20221008115833.29247-3-fengchengwen@huawei.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": "<20221008115833.29247-3-fengchengwen@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20221008115833.29247-3-fengchengwen@huawei.com",
    "date": "2022-10-08T11:58:25",
    "name": "[v7,02/10] test/memarea: support memarea test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "658509e94ef6b03c5d8d7e2ec5dc1ef0bf462859",
    "submitter": {
        "id": 2146,
        "url": "http://patches.dpdk.org/api/people/2146/?format=api",
        "name": "fengchengwen",
        "email": "fengchengwen@huawei.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20221008115833.29247-3-fengchengwen@huawei.com/mbox/",
    "series": [
        {
            "id": 25050,
            "url": "http://patches.dpdk.org/api/series/25050/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=25050",
            "date": "2022-10-08T11:58:29",
            "name": "introduce memarea library",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/25050/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/117704/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/117704/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 A49EDA0542;\n\tSat,  8 Oct 2022 14:04:32 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A37DF42BBB;\n\tSat,  8 Oct 2022 14:04:17 +0200 (CEST)",
            "from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189])\n by mails.dpdk.org (Postfix) with ESMTP id 456F942B93\n for <dev@dpdk.org>; Sat,  8 Oct 2022 14:04:13 +0200 (CEST)",
            "from dggpeml500024.china.huawei.com (unknown [172.30.72.57])\n by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Ml3gW5vGbzkXwC;\n Sat,  8 Oct 2022 20:01:43 +0800 (CST)",
            "from localhost.localdomain (10.67.165.24) by\n dggpeml500024.china.huawei.com (7.185.36.10) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.31; Sat, 8 Oct 2022 20:04:11 +0800"
        ],
        "From": "Chengwen Feng <fengchengwen@huawei.com>",
        "To": "<david.marchand@redhat.com>, <mb@smartsharesystems.com>,\n <anatoly.burakov@intel.com>, <dmitry.kozliuk@gmail.com>,\n <jerinjacobk@gmail.com>, <hofors@lysator.liu.se>",
        "CC": "<thomas@monjalon.net>, <dev@dpdk.org>",
        "Subject": "[PATCH v7 02/10] test/memarea: support memarea test",
        "Date": "Sat, 8 Oct 2022 11:58:25 +0000",
        "Message-ID": "<20221008115833.29247-3-fengchengwen@huawei.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20221008115833.29247-1-fengchengwen@huawei.com>",
        "References": "<20220721044648.6817-1-fengchengwen@huawei.com>\n <20221008115833.29247-1-fengchengwen@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.24]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n dggpeml500024.china.huawei.com (7.185.36.10)",
        "X-CFilter-Loop": "Reflected",
        "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": "This patch supports memarea test about API rte_memarea_create and\nrte_memarea_destroy.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\n---\n MAINTAINERS             |   1 +\n app/test/meson.build    |   2 +\n app/test/test_memarea.c | 168 ++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 171 insertions(+)\n create mode 100644 app/test/test_memarea.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 6c1cb637b0..7adeef31bf 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1566,6 +1566,7 @@ Memarea - EXPERIMENTAL\n M: Chengwen Feng <fengchengwen@huawei.com>\n F: lib/memarea\n F: doc/guides/prog_guide/memarea_lib.rst\n+F: app/test/test_memarea*\n \n Membership - EXPERIMENTAL\n M: Yipeng Wang <yipeng1.wang@intel.com>\ndiff --git a/app/test/meson.build b/app/test/meson.build\nindex d5cad72116..778de8d65d 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -84,6 +84,7 @@ test_sources = files(\n         'test_malloc.c',\n         'test_malloc_perf.c',\n         'test_mbuf.c',\n+        'test_memarea.c',\n         'test_member.c',\n         'test_member_perf.c',\n         'test_memcpy.c',\n@@ -199,6 +200,7 @@ fast_tests = [\n         ['malloc_autotest', false, true],\n         ['mbuf_autotest', false, true],\n         ['mcslock_autotest', false, true],\n+        ['memarea_autotest', true, true],\n         ['memcpy_autotest', true, true],\n         ['memory_autotest', false, true],\n         ['mempool_autotest', false, true],\ndiff --git a/app/test/test_memarea.c b/app/test/test_memarea.c\nnew file mode 100644\nindex 0000000000..6b6612dc82\n--- /dev/null\n+++ b/app/test/test_memarea.c\n@@ -0,0 +1,168 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2022 HiSilicon Limited\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+\n+#include \"test.h\"\n+\n+#ifdef RTE_EXEC_ENV_WINDOWS\n+static int\n+test_memarea(void)\n+{\n+\tprintf(\"memarea not supported on Windows, skipping test\\n\");\n+\treturn TEST_SKIPPED;\n+}\n+\n+#else\n+\n+#include <rte_memory.h>\n+#include <rte_memarea.h>\n+\n+#define MEMAREA_TEST_DEFAULT_SIZE\t0x1000\n+\n+#define MEMAREA_TEST_API_RUN(test_func) \\\n+\tdo { \\\n+\t\tint ret = test_func(); \\\n+\t\tif (ret < 0) { \\\n+\t\t\tprintf(\"%s Failed\\n\", #test_func); \\\n+\t\t\tfails++; \\\n+\t\t} else { \\\n+\t\t\tprintf(\"%s Passed\\n\", #test_func); \\\n+\t\t} \\\n+\t} while (0)\n+\n+static int fails;\n+\n+static void\n+test_memarea_prepare(void)\n+{\n+\tfails = 0;\n+}\n+\n+static int\n+test_memarea_retcode(void)\n+{\n+\treturn fails > 0 ? -1 : 0;\n+}\n+\n+static void\n+test_memarea_init_def_param(struct rte_memarea_param *init)\n+{\n+\tmemset(init, 0, sizeof(struct rte_memarea_param));\n+\tsprintf(init->name, \"%s\", \"test-memarea\");\n+\tinit->source = RTE_MEMAREA_SOURCE_LIBC;\n+\tinit->total_sz = MEMAREA_TEST_DEFAULT_SIZE;\n+\tinit->mt_safe = 1;\n+}\n+\n+static int\n+test_memarea_create_bad_param(void)\n+{\n+\tstruct rte_memarea_param init;\n+\tstruct rte_memarea *ma;\n+\tint i;\n+\n+\t/* test for NULL */\n+\tma = rte_memarea_create(NULL);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for invalid name */\n+\tmemset(&init, 0, sizeof(init));\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tmemset(&init.name, 1, sizeof(init.name));\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for invalid source */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_USER_MEMAREA + 1;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for total_sz */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.total_sz = 0;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for user address NULL */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_USER;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for user address align invalid */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_USER;\n+\tfor (i = 1; i < RTE_CACHE_LINE_SIZE; i++) {\n+\t\tinit.user_addr = (void *)((uintptr_t)i);\n+\t\tma = rte_memarea_create(&init);\n+\t\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\t}\n+\n+\t/* test for user memarea NULL */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_USER_MEMAREA;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\t/* test for alg invalid */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.alg = RTE_MEMAREA_ALG_DEFAULT + 1;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_memarea_create_destroy(void)\n+{\n+\tuint8_t user_buffer[MEMAREA_TEST_DEFAULT_SIZE + RTE_CACHE_LINE_SIZE];\n+\tstruct rte_memarea_param init;\n+\tstruct rte_memarea *ma;\n+\n+\t/* test for create with HEAP */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_HEAP;\n+\tinit.numa_socket = SOCKET_ID_ANY;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma != NULL, \"Expected Non-NULL\");\n+\trte_memarea_destroy(ma);\n+\n+\t/* test for create with LIBC */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_LIBC;\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma != NULL, \"Expected Non-NULL\");\n+\trte_memarea_destroy(ma);\n+\n+\t/* test for create with user-provided */\n+\ttest_memarea_init_def_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_USER;\n+\tinit.user_addr = (void *)(((uintptr_t)user_buffer + RTE_CACHE_LINE_SIZE) &\n+\t\t\t\t  ~(RTE_CACHE_LINE_SIZE - 1));\n+\tma = rte_memarea_create(&init);\n+\tRTE_TEST_ASSERT(ma != NULL, \"Expected Non-NULL\");\n+\trte_memarea_destroy(ma);\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_memarea(void)\n+{\n+\ttest_memarea_prepare();\n+\n+\tMEMAREA_TEST_API_RUN(test_memarea_create_bad_param);\n+\tMEMAREA_TEST_API_RUN(test_memarea_create_destroy);\n+\n+\treturn test_memarea_retcode();\n+}\n+\n+#endif /* !RTE_EXEC_ENV_WINDOWS */\n+\n+REGISTER_TEST_COMMAND(memarea_autotest, test_memarea);\n",
    "prefixes": [
        "v7",
        "02/10"
    ]
}