Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48655/?format=api
http://patches.dpdk.org/api/patches/48655/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/271055f8b29eafbf0638fcf63e3eac9ef323bc1e.1544550999.git.anatoly.burakov@intel.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": "<271055f8b29eafbf0638fcf63e3eac9ef323bc1e.1544550999.git.anatoly.burakov@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/271055f8b29eafbf0638fcf63e3eac9ef323bc1e.1544550999.git.anatoly.burakov@intel.com", "date": "2018-12-11T17:57:14", "name": "[6/6] test/common: extend autotest to newly added functions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "69bd018274c4701660d1efe7a91a10a5e56e5a9a", "submitter": { "id": 4, "url": "http://patches.dpdk.org/api/people/4/?format=api", "name": "Anatoly Burakov", "email": "anatoly.burakov@intel.com" }, "delegate": { "id": 1, "url": "http://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/271055f8b29eafbf0638fcf63e3eac9ef323bc1e.1544550999.git.anatoly.burakov@intel.com/mbox/", "series": [ { "id": 2733, "url": "http://patches.dpdk.org/api/series/2733/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2733", "date": "2018-12-11T17:57:12", "name": "[1/6] bitmap: remove deprecated bsf64 function", "version": 1, "mbox": "http://patches.dpdk.org/series/2733/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/48655/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/48655/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<dev-bounces@dpdk.org>", "X-Original-To": "patchwork@dpdk.org", "Delivered-To": "patchwork@dpdk.org", "Received": [ "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 724041B118;\n\tTue, 11 Dec 2018 18:57:40 +0100 (CET)", "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 1C8455F72\n\tfor <dev@dpdk.org>; Tue, 11 Dec 2018 18:57:32 +0100 (CET)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Dec 2018 09:57:32 -0800", "from irvmail001.ir.intel.com ([163.33.26.43])\n\tby orsmga004.jf.intel.com with ESMTP; 11 Dec 2018 09:57:30 -0800", "from sivswdev05.ir.intel.com (sivswdev05.ir.intel.com\n\t[10.243.17.64])\n\tby irvmail001.ir.intel.com (8.14.3/8.13.6/MailSET/Hub) with ESMTP id\n\twBBHvU1l014333; Tue, 11 Dec 2018 17:57:30 GMT", "from sivswdev05.ir.intel.com (localhost [127.0.0.1])\n\tby sivswdev05.ir.intel.com with ESMTP id wBBHvU0W024680;\n\tTue, 11 Dec 2018 17:57:30 GMT", "(from aburakov@localhost)\n\tby sivswdev05.ir.intel.com with LOCAL id wBBHvTCR024672;\n\tTue, 11 Dec 2018 17:57:29 GMT" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.56,343,1539673200\"; d=\"scan'208\";a=\"258636221\"", "From": "Anatoly Burakov <anatoly.burakov@intel.com>", "To": "dev@dpdk.org", "Cc": "thomas@monjalon.net, jasvinder.singh@intel.com,\n\tcristian.dumitrescu@intel.com, jerin.jacob@caviumnetworks.com", "Date": "Tue, 11 Dec 2018 17:57:14 +0000", "Message-Id": "<271055f8b29eafbf0638fcf63e3eac9ef323bc1e.1544550999.git.anatoly.burakov@intel.com>", "X-Mailer": "git-send-email 1.7.0.7", "In-Reply-To": [ "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>", "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>" ], "References": [ "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>", "<1cf22c82b6ca7561966be674afb8a02add0913b9.1544550999.git.anatoly.burakov@intel.com>" ], "Subject": "[dpdk-dev] [PATCH 6/6] test/common: extend autotest to newly added\n\tfunctions", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Add a new autotest for bsf32, bsf64, bsf32_safe and bsf64_safe\nfunctions, and extend existing fls and log2 autotests to also\ncover 64-bit versions.\n\nSigned-off-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n test/test/test_common.c | 82 +++++++++++++++++++++++++++++++++++++++--\n 1 file changed, 79 insertions(+), 3 deletions(-)", "diff": "diff --git a/test/test/test_common.c b/test/test/test_common.c\nindex c6d17baae..94d367471 100644\n--- a/test/test/test_common.c\n+++ b/test/test/test_common.c\n@@ -50,12 +50,48 @@ test_macros(int __rte_unused unused_parm)\n \treturn 0;\n }\n \n+static int\n+test_bsf(void)\n+{\n+\tuint32_t shift, pos;\n+\n+\t/* safe versions should be able to handle 0 */\n+\tif (rte_bsf32_safe(0, &pos) != 0)\n+\t\tFAIL(\"rte_bsf32_safe\");\n+\tif (rte_bsf64_safe(0, &pos) != 0)\n+\t\tFAIL(\"rte_bsf64_safe\");\n+\n+\tfor (shift = 0; shift < 63; shift++) {\n+\t\tuint32_t val32;\n+\t\tuint64_t val64;\n+\n+\t\tval64 = 1ULL << shift;\n+\t\tif ((uint32_t)rte_bsf64(val64) != shift)\n+\t\t\tFAIL(\"rte_bsf64\");\n+\t\tif (rte_bsf64_safe(val64, &pos) != 1)\n+\t\t\tFAIL(\"rte_bsf64_safe\");\n+\t\tif (pos != shift)\n+\t\t\tFAIL(\"rte_bsf64_safe\");\n+\n+\t\tif (shift > 31)\n+\t\t\tcontinue;\n+\n+\t\tval32 = 1U << shift;\n+\t\tif ((uint32_t)rte_bsf32(val32) != shift)\n+\t\t\tFAIL(\"rte_bsf32\");\n+\t\tif (rte_bsf32_safe(val32, &pos) != 1)\n+\t\t\tFAIL(\"rte_bsf32_safe\");\n+\t\tif (pos != shift)\n+\t\t\tFAIL(\"rte_bsf32_safe\");\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n test_misc(void)\n {\n \tchar memdump[] = \"memdump_test\";\n-\tif (rte_bsf32(129))\n-\t\tFAIL(\"rte_bsf32\");\n \n \trte_memdump(stdout, \"test\", memdump, sizeof(memdump));\n \trte_hexdump(stdout, \"test\", memdump, sizeof(memdump));\n@@ -177,13 +213,31 @@ test_log2(void)\n \tconst uint32_t step = 1;\n \n \tfor (i = 0; i < max; i = i + step) {\n+\t\tuint64_t i64;\n+\n+\t\t/* extend range for 64-bit */\n+\t\ti64 = (uint64_t)i << 32;\n+\t\tbase = (uint32_t)ceilf(log2(i64));\n+\t\tcompare = rte_log2_u64(i64);\n+\t\tif (base != compare) {\n+\t\t\tprintf(\"Wrong rte_log2_u64(%\" PRIx64 \") val %x, expected %x\\n\",\n+\t\t\t\ti64, compare, base);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n \t\tbase = (uint32_t)ceilf(log2((uint32_t)i));\n-\t\tcompare = rte_log2_u32(i);\n+\t\tcompare = rte_log2_u32((uint32_t)i);\n \t\tif (base != compare) {\n \t\t\tprintf(\"Wrong rte_log2_u32(%x) val %x, expected %x\\n\",\n \t\t\t\ti, compare, base);\n \t\t\treturn TEST_FAILED;\n \t\t}\n+\t\tcompare = rte_log2_u64((uint64_t)i);\n+\t\tif (base != compare) {\n+\t\t\tprintf(\"Wrong rte_log2_u64(%x) val %x, expected %x\\n\",\n+\t\t\t\ti, compare, base);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n \t}\n \treturn 0;\n }\n@@ -206,6 +260,8 @@ test_fls(void)\n \t};\n \n \tfor (i = 0; i < RTE_DIM(test); i++) {\n+\t\tuint64_t arg64;\n+\n \t\targ = test[i].arg;\n \t\trc = rte_fls_u32(arg);\n \t\texpected = test[i].rc;\n@@ -214,6 +270,25 @@ test_fls(void)\n \t\t\t\targ, rc, expected);\n \t\t\treturn TEST_FAILED;\n \t\t}\n+\t\t/* 64-bit version */\n+\t\targ = test[i].arg;\n+\t\trc = rte_fls_u64(arg);\n+\t\texpected = test[i].rc;\n+\t\tif (rc != expected) {\n+\t\t\tprintf(\"Wrong rte_fls_u64(0x%x) rc=%d, expected=%d\\n\",\n+\t\t\t\targ, rc, expected);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\t\t/* 64-bit version shifted by 32 bits */\n+\t\targ64 = (uint64_t)test[i].arg << 32;\n+\t\trc = rte_fls_u64(arg64);\n+\t\t/* don't shift zero */\n+\t\texpected = test[i].rc == 0 ? 0 : test[i].rc + 32;\n+\t\tif (rc != expected) {\n+\t\t\tprintf(\"Wrong rte_fls_u64(0x%\" PRIx64 \") rc=%d, expected=%d\\n\",\n+\t\t\t\targ64, rc, expected);\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n \t}\n \n \treturn 0;\n@@ -226,6 +301,7 @@ test_common(void)\n \tret |= test_align();\n \tret |= test_macros(0);\n \tret |= test_misc();\n+\tret |= test_bsf();\n \tret |= test_log2();\n \tret |= test_fls();\n \n", "prefixes": [ "6/6" ] }{ "id": 48655, "url": "