Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/129400/?format=api
http://patchwork.dpdk.org/api/patches/129400/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230709130041.8736-3-fengchengwen@huawei.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230709130041.8736-3-fengchengwen@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230709130041.8736-3-fengchengwen@huawei.com", "date": "2023-07-09T13:00:37", "name": "[v15,2/6] test/memarea: support memarea test", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "c3644d37431954192868a00fd77f49198daf8f4d", "submitter": { "id": 2146, "url": "http://patchwork.dpdk.org/api/people/2146/?format=api", "name": "fengchengwen", "email": "fengchengwen@huawei.com" }, "delegate": { "id": 1, "url": "http://patchwork.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230709130041.8736-3-fengchengwen@huawei.com/mbox/", "series": [ { "id": 28880, "url": "http://patchwork.dpdk.org/api/series/28880/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28880", "date": "2023-07-09T13:00:39", "name": "introduce memarea library", "version": 15, "mbox": "http://patchwork.dpdk.org/series/28880/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/129400/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/129400/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 B96FB42E2C;\n\tSun, 9 Jul 2023 15:08:57 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 53433427EE;\n\tSun, 9 Jul 2023 15:08:52 +0200 (CEST)", "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 127EE41138\n for <dev@dpdk.org>; Sun, 9 Jul 2023 15:08:48 +0200 (CEST)", "from dggpeml100024.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4QzS9p6rnpzqV1L;\n Sun, 9 Jul 2023 21:08:14 +0800 (CST)", "from localhost.localdomain (10.50.163.32) by\n dggpeml100024.china.huawei.com (7.185.36.115) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.27; Sun, 9 Jul 2023 21:08:46 +0800" ], "From": "Chengwen Feng <fengchengwen@huawei.com>", "To": "<thomas@monjalon.net>, <david.marchand@redhat.com>", "CC": "<dev@dpdk.org>, <mb@smartsharesystems.com>, <anatoly.burakov@intel.com>,\n <dmitry.kozliuk@gmail.com>, <jerinjacobk@gmail.com>, <hofors@lysator.liu.se>,\n <stephen@networkplumber.org>", "Subject": "[PATCH v15 2/6] test/memarea: support memarea test", "Date": "Sun, 9 Jul 2023 13:00:37 +0000", "Message-ID": "<20230709130041.8736-3-fengchengwen@huawei.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20230709130041.8736-1-fengchengwen@huawei.com>", "References": "<20220721044648.6817-1-fengchengwen@huawei.com>\n <20230709130041.8736-1-fengchengwen@huawei.com>", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=\"UTF-8\"", "Content-Transfer-Encoding": "8bit", "X-Originating-IP": "[10.50.163.32]", "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n dggpeml100024.china.huawei.com (7.185.36.115)", "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 of rte_memarea_create() and\nrte_memarea_destroy() API.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nReviewed-by: Dongdong Liu <liudongdong3@huawei.com>\nAcked-by: Morten Brørup <mb@smartsharesystems.com>\n---\n MAINTAINERS | 1 +\n app/test/meson.build | 2 +\n app/test/test_memarea.c | 122 ++++++++++++++++++++++++++++++++++++++++\n 3 files changed, 125 insertions(+)\n create mode 100644 app/test/test_memarea.c", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 93de0876f1..cc082ae821 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1616,6 +1616,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 3e0a2360a3..5e3012328d 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -83,6 +83,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@@ -200,6 +201,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..90117caa38\n--- /dev/null\n+++ b/app/test/test_memarea.c\n@@ -0,0 +1,122 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 HiSilicon Limited\n+ */\n+\n+#include <stdio.h>\n+#include <string.h>\n+\n+#include <rte_errno.h>\n+#include <rte_memory.h>\n+#include <rte_memarea.h>\n+\n+#include \"test.h\"\n+\n+#define MEMAREA_TEST_DEFAULT_SIZE\t0x1000\n+\n+static void\n+test_memarea_init_param(struct rte_memarea_param *init)\n+{\n+\tmemset(init, 0, sizeof(struct rte_memarea_param));\n+\tsprintf(init->name, \"%s\", \"autotest\");\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+\n+\t/* test for NULL */\n+\tma = rte_memarea_create(NULL);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\t/* test for invalid name */\n+\tmemset(&init, 0, sizeof(init));\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\tmemset(&init.name, 1, sizeof(init.name));\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\t/* test for invalid source */\n+\ttest_memarea_init_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_MEMAREA + 1;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\t/* test for total_sz */\n+\ttest_memarea_init_param(&init);\n+\tinit.total_sz = 0;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\t/* test for memarea NULL */\n+\ttest_memarea_init_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_MEMAREA;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\t/* test for algorithm invalid */\n+\ttest_memarea_init_param(&init);\n+\tinit.alg = RTE_MEMAREA_ALGORITHM_NEXTFIT + 1;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma == NULL, \"Expected NULL\");\n+\tTEST_ASSERT(rte_errno == EINVAL, \"Expected EINVAL\");\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_memarea_create_destroy(void)\n+{\n+\tstruct rte_memarea *ma;\n+\tstruct rte_memarea_param init;\n+\n+\trte_errno = 0;\n+\n+\t/* test for create with HEAP */\n+\ttest_memarea_init_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_HEAP;\n+\tinit.heap.socket_id = SOCKET_ID_ANY;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma != NULL, \"Expected Non-NULL\");\n+\trte_memarea_destroy(ma);\n+\n+\t/* test for create with LIBC */\n+\ttest_memarea_init_param(&init);\n+\tinit.source = RTE_MEMAREA_SOURCE_LIBC;\n+\tma = rte_memarea_create(&init);\n+\tTEST_ASSERT(ma != NULL, \"Expected Non-NULL\");\n+\trte_memarea_destroy(ma);\n+\n+\treturn 0;\n+}\n+\n+static struct unit_test_suite memarea_test_suite = {\n+\t.suite_name = \"Memarea Unit Test Suite\",\n+\t.setup = NULL,\n+\t.teardown = NULL,\n+\t.unit_test_cases = {\n+\t\tTEST_CASE(test_memarea_create_bad_param),\n+\t\tTEST_CASE(test_memarea_create_destroy),\n+\n+\t\tTEST_CASES_END() /**< NULL terminate unit test array */\n+\t}\n+};\n+\n+static int\n+test_memarea(void)\n+{\n+\treturn unit_test_suite_runner(&memarea_test_suite);\n+}\n+\n+REGISTER_TEST_COMMAND(memarea_autotest, test_memarea);\n", "prefixes": [ "v15", "2/6" ] }{ "id": 129400, "url": "