Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79709/?format=api
http://patches.dpdk.org/api/patches/79709/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201005184526.7465-7-konstantin.ananyev@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": "<20201005184526.7465-7-konstantin.ananyev@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20201005184526.7465-7-konstantin.ananyev@intel.com", "date": "2020-10-05T18:45:18", "name": "[v3,06/14] test/acl: expand classify test coverage", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "7993cf6c8ccb114a4ee1a6c6fcd23819db5f4b15", "submitter": { "id": 33, "url": "http://patches.dpdk.org/api/people/33/?format=api", "name": "Ananyev, Konstantin", "email": "konstantin.ananyev@intel.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/20201005184526.7465-7-konstantin.ananyev@intel.com/mbox/", "series": [ { "id": 12702, "url": "http://patches.dpdk.org/api/series/12702/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12702", "date": "2020-10-05T18:45:21", "name": "acl: introduce AVX512 classify methods", "version": 3, "mbox": "http://patches.dpdk.org/series/12702/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/79709/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/79709/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 B4612A04B1;\n\tMon, 5 Oct 2020 21:45:34 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id E22681BAFD;\n\tMon, 5 Oct 2020 21:43:23 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by dpdk.org (Postfix) with ESMTP id A65151BACD\n for <dev@dpdk.org>; Mon, 5 Oct 2020 21:43:21 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 05 Oct 2020 12:27:57 -0700", "from sivswdev08.ir.intel.com ([10.237.217.47])\n by orsmga005.jf.intel.com with ESMTP; 05 Oct 2020 11:46:14 -0700" ], "IronPort-SDR": [ "\n VWPc2gG/HLUj5wQfmCaC8nAISZSlSuAlBmgnuTEVyJdWJor2t817wf/4vvZewXXkPab7Th+qQs\n MDhDk9LpaSMA==", "\n 2BUtJE1X7kh/yYFMbGWAXENM2ppDDbNZNyiyfbbdTK9ahw4dBMyTEZrbdp1Xdxge0GoBitARUT\n A9MkJF4oghsg==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9765\"; a=\"228046081\"", "E=Sophos;i=\"5.77,340,1596524400\"; d=\"scan'208\";a=\"228046081\"", "E=Sophos;i=\"5.77,340,1596524400\"; d=\"scan'208\";a=\"526624978\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Konstantin Ananyev <konstantin.ananyev@intel.com>", "To": "dev@dpdk.org", "Cc": "jerinj@marvell.com, ruifeng.wang@arm.com, vladimir.medvedkin@intel.com,\n Konstantin Ananyev <konstantin.ananyev@intel.com>", "Date": "Mon, 5 Oct 2020 19:45:18 +0100", "Message-Id": "<20201005184526.7465-7-konstantin.ananyev@intel.com>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20201005184526.7465-1-konstantin.ananyev@intel.com>", "References": "<20200915165025.543-1-konstantin.ananyev@intel.com>\n <20201005184526.7465-1-konstantin.ananyev@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 06/14] test/acl: expand classify test coverage", "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": "Make classify test to run for all supported methods.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n app/test/test_acl.c | 103 ++++++++++++++++++++++----------------------\n 1 file changed, 51 insertions(+), 52 deletions(-)", "diff": "diff --git a/app/test/test_acl.c b/app/test/test_acl.c\nindex 316bf4d065..333b347579 100644\n--- a/app/test/test_acl.c\n+++ b/app/test/test_acl.c\n@@ -266,22 +266,20 @@ rte_acl_ipv4vlan_build(struct rte_acl_ctx *ctx,\n }\n \n /*\n- * Test scalar and SSE ACL lookup.\n+ * Test ACL lookup (selected alg).\n */\n static int\n-test_classify_run(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[],\n-\tsize_t dim)\n+test_classify_alg(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[],\n+\tconst uint8_t *data[], size_t dim, enum rte_acl_classify_alg alg)\n {\n-\tint ret, i;\n-\tuint32_t result, count;\n+\tint32_t ret;\n+\tuint32_t i, result, count;\n \tuint32_t results[dim * RTE_ACL_MAX_CATEGORIES];\n-\tconst uint8_t *data[dim];\n-\t/* swap all bytes in the data to network order */\n-\tbswap_test_data(test_data, dim, 1);\n \n-\t/* store pointers to test data */\n-\tfor (i = 0; i < (int) dim; i++)\n-\t\tdata[i] = (uint8_t *)&test_data[i];\n+\t/* set given classify alg, skip test if alg is not supported */\n+\tret = rte_acl_set_ctx_classify(acx, alg);\n+\tif (ret == -ENOTSUP)\n+\t\treturn 0;\n \n \t/**\n \t * these will run quite a few times, it's necessary to test code paths\n@@ -291,12 +289,13 @@ test_classify_run(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[],\n \t\tret = rte_acl_classify(acx, data, results,\n \t\t\t\tcount, RTE_ACL_MAX_CATEGORIES);\n \t\tif (ret != 0) {\n-\t\t\tprintf(\"Line %i: SSE classify failed!\\n\", __LINE__);\n-\t\t\tgoto err;\n+\t\t\tprintf(\"Line %i: classify(alg=%d) failed!\\n\",\n+\t\t\t\t__LINE__, alg);\n+\t\t\treturn ret;\n \t\t}\n \n \t\t/* check if we allow everything we should allow */\n-\t\tfor (i = 0; i < (int) count; i++) {\n+\t\tfor (i = 0; i < count; i++) {\n \t\t\tresult =\n \t\t\t\tresults[i * RTE_ACL_MAX_CATEGORIES + ACL_ALLOW];\n \t\t\tif (result != test_data[i].allow) {\n@@ -304,63 +303,63 @@ test_classify_run(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[],\n \t\t\t\t\t\"(expected %\"PRIu32\" got %\"PRIu32\")!\\n\",\n \t\t\t\t\t__LINE__, i, test_data[i].allow,\n \t\t\t\t\tresult);\n-\t\t\t\tret = -EINVAL;\n-\t\t\t\tgoto err;\n+\t\t\t\treturn -EINVAL;\n \t\t\t}\n \t\t}\n \n \t\t/* check if we deny everything we should deny */\n-\t\tfor (i = 0; i < (int) count; i++) {\n+\t\tfor (i = 0; i < count; i++) {\n \t\t\tresult = results[i * RTE_ACL_MAX_CATEGORIES + ACL_DENY];\n \t\t\tif (result != test_data[i].deny) {\n \t\t\t\tprintf(\"Line %i: Error in deny results at %i \"\n \t\t\t\t\t\"(expected %\"PRIu32\" got %\"PRIu32\")!\\n\",\n \t\t\t\t\t__LINE__, i, test_data[i].deny,\n \t\t\t\t\tresult);\n-\t\t\t\tret = -EINVAL;\n-\t\t\t\tgoto err;\n+\t\t\t\treturn -EINVAL;\n \t\t\t}\n \t\t}\n \t}\n \n-\t/* make a quick check for scalar */\n-\tret = rte_acl_classify_alg(acx, data, results,\n-\t\t\tdim, RTE_ACL_MAX_CATEGORIES,\n-\t\t\tRTE_ACL_CLASSIFY_SCALAR);\n-\tif (ret != 0) {\n-\t\tprintf(\"Line %i: scalar classify failed!\\n\", __LINE__);\n-\t\tgoto err;\n-\t}\n+\t/* restore default classify alg */\n+\treturn rte_acl_set_ctx_classify(acx, RTE_ACL_CLASSIFY_DEFAULT);\n+}\n \n-\t/* check if we allow everything we should allow */\n-\tfor (i = 0; i < (int) dim; i++) {\n-\t\tresult = results[i * RTE_ACL_MAX_CATEGORIES + ACL_ALLOW];\n-\t\tif (result != test_data[i].allow) {\n-\t\t\tprintf(\"Line %i: Error in allow results at %i \"\n-\t\t\t\t\t\"(expected %\"PRIu32\" got %\"PRIu32\")!\\n\",\n-\t\t\t\t\t__LINE__, i, test_data[i].allow,\n-\t\t\t\t\tresult);\n-\t\t\tret = -EINVAL;\n-\t\t\tgoto err;\n-\t\t}\n-\t}\n+/*\n+ * Test ACL lookup (all possible methods).\n+ */\n+static int\n+test_classify_run(struct rte_acl_ctx *acx, struct ipv4_7tuple test_data[],\n+\tsize_t dim)\n+{\n+\tint32_t ret;\n+\tuint32_t i;\n+\tconst uint8_t *data[dim];\n \n-\t/* check if we deny everything we should deny */\n-\tfor (i = 0; i < (int) dim; i++) {\n-\t\tresult = results[i * RTE_ACL_MAX_CATEGORIES + ACL_DENY];\n-\t\tif (result != test_data[i].deny) {\n-\t\t\tprintf(\"Line %i: Error in deny results at %i \"\n-\t\t\t\t\t\"(expected %\"PRIu32\" got %\"PRIu32\")!\\n\",\n-\t\t\t\t\t__LINE__, i, test_data[i].deny,\n-\t\t\t\t\tresult);\n-\t\t\tret = -EINVAL;\n-\t\t\tgoto err;\n-\t\t}\n-\t}\n+\tstatic const enum rte_acl_classify_alg alg[] = {\n+\t\tRTE_ACL_CLASSIFY_SCALAR,\n+\t\tRTE_ACL_CLASSIFY_SSE,\n+\t\tRTE_ACL_CLASSIFY_AVX2,\n+\t\tRTE_ACL_CLASSIFY_NEON,\n+\t\tRTE_ACL_CLASSIFY_ALTIVEC,\n+\t};\n+\n+\t/* swap all bytes in the data to network order */\n+\tbswap_test_data(test_data, dim, 1);\n+\n+\t/* store pointers to test data */\n+\tfor (i = 0; i < dim; i++)\n+\t\tdata[i] = (uint8_t *)&test_data[i];\n \n \tret = 0;\n+\tfor (i = 0; i != RTE_DIM(alg); i++) {\n+\t\tret = test_classify_alg(acx, test_data, data, dim, alg[i]);\n+\t\tif (ret < 0) {\n+\t\t\tprintf(\"Line %i: %s() for alg=%d failed, errno=%d\\n\",\n+\t\t\t\t__LINE__, __func__, alg[i], -ret);\n+\t\t\tbreak;\n+\t\t}\n+\t}\n \n-err:\n \t/* swap data back to cpu order so that next time tests don't fail */\n \tbswap_test_data(test_data, dim, 0);\n \treturn ret;\n", "prefixes": [ "v3", "06/14" ] }{ "id": 79709, "url": "