Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/66408/?format=api
http://patches.dpdk.org/api/patches/66408/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200309095410.28983-3-joyce.kong@arm.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": "<20200309095410.28983-3-joyce.kong@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200309095410.28983-3-joyce.kong@arm.com", "date": "2020-03-09T09:54:06", "name": "[v7,2/6] test/pmdbitops: add PMD bit operation test case", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "8f195af71d5bc78c1cff9d56df4eddae297eb891", "submitter": { "id": 970, "url": "http://patches.dpdk.org/api/people/970/?format=api", "name": "Joyce Kong", "email": "joyce.kong@arm.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/20200309095410.28983-3-joyce.kong@arm.com/mbox/", "series": [ { "id": 8838, "url": "http://patches.dpdk.org/api/series/8838/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8838", "date": "2020-03-09T09:54:04", "name": "implement common rte bit operation APIs in PMDs", "version": 7, "mbox": "http://patches.dpdk.org/series/8838/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/66408/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/66408/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 6AC65A052E;\n\tMon, 9 Mar 2020 10:54:50 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 94AEF1C0C5;\n\tMon, 9 Mar 2020 10:54:43 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 170E31C0C5\n for <dev@dpdk.org>; Mon, 9 Mar 2020 10:54:42 +0100 (CET)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8F2C3101E;\n Mon, 9 Mar 2020 02:54:41 -0700 (PDT)", "from net-arm-thunderx2-03.shanghai.arm.com\n (net-arm-thunderx2-03.shanghai.arm.com [10.169.41.185])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E163F3F67D;\n Mon, 9 Mar 2020 02:54:35 -0700 (PDT)" ], "From": "Joyce Kong <joyce.kong@arm.com>", "To": "thomas@monjalon.net, stephen@networkplumber.org,\n david.marchand@redhat.com,\n mb@smartsharesystems.com, jerinj@marvell.com, bruce.richardson@intel.com,\n ravi1.kumar@amd.com, rmody@marvell.com, shshaikh@marvell.com,\n xuanziyang2@huawei.com, cloud.wangxiaoyun@huawei.com,\n zhouguoyang@huawei.com, honnappa.nagarahalli@arm.com, phil.yang@arm.com,\n gavin.hu@arm.com", "Cc": "nd@arm.com,\n\tdev@dpdk.org", "Date": "Mon, 9 Mar 2020 17:54:06 +0800", "Message-Id": "<20200309095410.28983-3-joyce.kong@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": [ "<20200309095410.28983-1-joyce.kong@arm.com>", "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>" ], "References": [ "<20200309095410.28983-1-joyce.kong@arm.com>", "<1571125801-45773-1-git-send-email-joyce.kong@arm.com>" ], "Subject": "[dpdk-dev] [PATCH v7 2/6] test/pmdbitops: add PMD bit operation\n\ttest case", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "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", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add test cases of bit operations which used by PMDs.\n\nSigned-off-by: Joyce Kong <joyce.kong@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\n---\n MAINTAINERS | 1 +\n app/test/Makefile | 1 +\n app/test/autotest_data.py | 6 ++\n app/test/meson.build | 2 +\n app/test/test_pmd_bitops.c | 137 +++++++++++++++++++++++++++++++++++++\n 5 files changed, 147 insertions(+)\n create mode 100644 app/test/test_pmd_bitops.c", "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex 071daf887..876cb2bfd 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -247,6 +247,7 @@ F: app/test/test_bitmap.c\n PMD Bitops\n M: Joyce Kong <joyce.kong@arm.com>\n F: lib/librte_eal/common/include/rte_pmd_bitops.h\n+F: app/test/test_pmd_bitops.c\n \n MCSlock - EXPERIMENTAL\n M: Phil Yang <phil.yang@arm.com>\ndiff --git a/app/test/Makefile b/app/test/Makefile\nindex 1f080d162..3bdcbfdcf 100644\n--- a/app/test/Makefile\n+++ b/app/test/Makefile\n@@ -78,6 +78,7 @@ SRCS-y += test_rand_perf.c\n \n SRCS-y += test_ring.c\n SRCS-y += test_ring_perf.c\n+SRCS-y += test_pmd_bitops.c\n SRCS-y += test_pmd_perf.c\n \n ifeq ($(CONFIG_RTE_LIBRTE_TABLE),y)\ndiff --git a/app/test/autotest_data.py b/app/test/autotest_data.py\nindex 7b1d01389..143b59097 100644\n--- a/app/test/autotest_data.py\n+++ b/app/test/autotest_data.py\n@@ -284,6 +284,12 @@\n \"Func\": default_autotest,\n \"Report\": None,\n },\n+ {\n+ \"Name\": \"PMD bitops autotest\",\n+ \"Command\": \"pmd_bitops_autotest\",\n+ \"Func\": default_autotest,\n+ \"Report\": None,\n+ }\n {\n \"Name\": \"PMD ring autotest\",\n \"Command\": \"ring_pmd_autotest\",\ndiff --git a/app/test/meson.build b/app/test/meson.build\nindex 0a2ce710f..5567b9d1c 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -84,6 +84,7 @@ test_sources = files('commands.c',\n \t'test_mcslock.c',\n \t'test_mp_secondary.c',\n \t'test_per_lcore.c',\n+\t'test_pmd_bitops.c',\n \t'test_pmd_perf.c',\n \t'test_power.c',\n \t'test_power_cpufreq.c',\n@@ -198,6 +199,7 @@ fast_test_names = [\n 'meter_autotest',\n 'multiprocess_autotest',\n 'per_lcore_autotest',\n+ 'pmd_bitops_autotest',\n 'prefetch_autotest',\n 'rcu_qsbr_autotest',\n 'red_autotest',\ndiff --git a/app/test/test_pmd_bitops.c b/app/test/test_pmd_bitops.c\nnew file mode 100644\nindex 000000000..f84c582be\n--- /dev/null\n+++ b/app/test/test_pmd_bitops.c\n@@ -0,0 +1,137 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2019 Arm Limited\n+ */\n+\n+#include <rte_launch.h>\n+#include <rte_pmd_bitops.h>\n+#include \"test.h\"\n+\n+uint32_t val32;\n+uint64_t val64;\n+\n+#define MAX_BITS_32 32\n+#define MAX_BITS_64 64\n+/*\n+ * Bitops functions\n+ * ================\n+ *\n+ * - The main test function performs several subtests.\n+ * - For relaxed version, check bit operations on one core.\n+ * - Initialize valXX to specified values, then set each bit of valXX\n+ * to 1 one by one in \"test_bitops_set_relaxed\".\n+ *\n+ * - Clear each bit of valXX to 0 one by one in \"test_bitops_clear_relaxed\".\n+ *\n+ * - Function \"test_bitops_test_set_clear_relaxed\" checks whether each bit\n+ * of valXX can do \"test and set\" and \"test and clear\" correctly.\n+ */\n+\n+static int\n+test_bitops_set_relaxed(void)\n+{\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\trte_set_bit32_relaxed(i, &val32);\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\tif (!rte_get_bit32_relaxed(i, &val32)) {\n+\t\t\tprintf(\"Failed to set bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\trte_set_bit64_relaxed(i, &val64);\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\tif (!rte_get_bit64_relaxed(i, &val64)) {\n+\t\t\tprintf(\"Failed to set bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_bitops_clear_relaxed(void)\n+{\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\trte_clear_bit32_relaxed(i, &val32);\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\tif (rte_get_bit32_relaxed(i, &val32)) {\n+\t\t\tprintf(\"Failed to clear bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\trte_clear_bit64_relaxed(i, &val64);\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\tif (rte_get_bit64_relaxed(i, &val64)) {\n+\t\t\tprintf(\"Failed to clear bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_bitops_test_set_clear_relaxed(void)\n+{\n+\tunsigned int i;\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\trte_test_and_set_bit32_relaxed(i, &val32);\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\tif (!rte_test_and_clear_bit32_relaxed(i, &val32)) {\n+\t\t\tprintf(\"Failed to set and test bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t}\n+\n+\tfor (i = 0; i < MAX_BITS_32; i++)\n+\t\tif (rte_get_bit32_relaxed(i, &val32)) {\n+\t\t\tprintf(\"Failed to test and clear bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\trte_test_and_set_bit64_relaxed(i, &val64);\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\tif (!rte_test_and_clear_bit64_relaxed(i, &val64)) {\n+\t\t\tprintf(\"Failed to set and test bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\tfor (i = 0; i < MAX_BITS_64; i++)\n+\t\tif (rte_get_bit64_relaxed(i, &val64)) {\n+\t\t\tprintf(\"Failed to test and clear bit in relaxed version.\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_bitops(void)\n+{\n+\tval32 = 0;\n+\tval64 = 0;\n+\n+\tif (test_bitops_set_relaxed() < 0)\n+\t\treturn TEST_FAILED;\n+\n+\tif (test_bitops_clear_relaxed() < 0)\n+\t\treturn TEST_FAILED;\n+\n+\tif (test_bitops_test_set_clear_relaxed() < 0)\n+\t\treturn TEST_FAILED;\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+REGISTER_TEST_COMMAND(bitops_autotest, test_bitops);\n", "prefixes": [ "v7", "2/6" ] }{ "id": 66408, "url": "