Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28252/?format=api
https://patches.dpdk.org/api/patches/28252/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1504256222-32969-3-git-send-email-xiaoyun.li@intel.com/", "project": { "id": 1, "url": "https://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": "<1504256222-32969-3-git-send-email-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1504256222-32969-3-git-send-email-xiaoyun.li@intel.com", "date": "2017-09-01T08:57:01", "name": "[dpdk-dev,v2,2/3] app/test: run-time dispatch over memcpy perf test", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "181a81bda6d98fc41bd72a5984a60498005ebb1c", "submitter": { "id": 798, "url": "https://patches.dpdk.org/api/people/798/?format=api", "name": "Li, Xiaoyun", "email": "xiaoyun.li@intel.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1504256222-32969-3-git-send-email-xiaoyun.li@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/28252/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/28252/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id 7DBE07CEE;\n\tFri, 1 Sep 2017 10:58:04 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id CC0BC7CD2\n\tfor <dev@dpdk.org>; Fri, 1 Sep 2017 10:58:02 +0200 (CEST)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t01 Sep 2017 01:58:02 -0700", "from dpdk-lixiaoyun.sh.intel.com ([10.67.110.162])\n\tby orsmga004.jf.intel.com with ESMTP; 01 Sep 2017 01:58:01 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.41,457,1498546800\"; d=\"scan'208\";a=\"124641543\"", "From": "Xiaoyun Li <xiaoyun.li@intel.com>", "To": "bruce.richardson@intel.com", "Cc": "dev@dpdk.org, zhihong.wang@intel.com, qi.z.zhang@intel.com,\n\twenzhuo.lu@intel.com, Xiaoyun Li <xiaoyun.li@intel.com>", "Date": "Fri, 1 Sep 2017 16:57:01 +0800", "Message-Id": "<1504256222-32969-3-git-send-email-xiaoyun.li@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1504256222-32969-1-git-send-email-xiaoyun.li@intel.com>", "References": "<1503626773-184682-1-git-send-email-xiaoyun.li@intel.com>\n\t<1504256222-32969-1-git-send-email-xiaoyun.li@intel.com>", "Subject": "[dpdk-dev] [PATCH v2 2/3] app/test: run-time dispatch over memcpy\n\tperf test", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "DPDK patches and discussions <dev.dpdk.org>", "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>", "List-Archive": "<http://dpdk.org/ml/archives/dev/>", "List-Post": "<mailto:dev@dpdk.org>", "List-Help": "<mailto:dev-request@dpdk.org?subject=help>", "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "This patch modifies assignment of alignment unit from build-time\nto run-time based on CPU flags that machine supports.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\n test/test/test_memcpy_perf.c | 40 +++++++++++++++++++++++++++-------------\n 1 file changed, 27 insertions(+), 13 deletions(-)", "diff": "diff --git a/test/test/test_memcpy_perf.c b/test/test/test_memcpy_perf.c\nindex ff3aaaa..33def3b 100644\n--- a/test/test/test_memcpy_perf.c\n+++ b/test/test/test_memcpy_perf.c\n@@ -79,13 +79,7 @@ static size_t buf_sizes[TEST_VALUE_RANGE];\n #define TEST_BATCH_SIZE 100\n \n /* Data is aligned on this many bytes (power of 2) */\n-#ifdef RTE_MACHINE_CPUFLAG_AVX512F\n-#define ALIGNMENT_UNIT 64\n-#elif defined RTE_MACHINE_CPUFLAG_AVX2\n-#define ALIGNMENT_UNIT 32\n-#else /* RTE_MACHINE_CPUFLAG */\n-#define ALIGNMENT_UNIT 16\n-#endif /* RTE_MACHINE_CPUFLAG */\n+static uint8_t alignment_unit = 16;\n \n /*\n * Pointers used in performance tests. The two large buffers are for uncached\n@@ -100,20 +94,39 @@ static int\n init_buffers(void)\n {\n \tunsigned i;\n+#ifdef CC_SUPPORT_AVX512\n+\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX512F))\n+\t\talignment_unit = 64;\n+\telse\n+#endif\n+#ifdef CC_SUPPORT_AVX2\n+\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))\n+\t\talignment_unit = 32;\n+\telse\n+#endif\n+\t\talignment_unit = 16;\n \n-\tlarge_buf_read = rte_malloc(\"memcpy\", LARGE_BUFFER_SIZE + ALIGNMENT_UNIT, ALIGNMENT_UNIT);\n+\tlarge_buf_read = rte_malloc(\"memcpy\",\n+\t\t\t\t LARGE_BUFFER_SIZE + alignment_unit,\n+\t\t\t\t alignment_unit);\n \tif (large_buf_read == NULL)\n \t\tgoto error_large_buf_read;\n \n-\tlarge_buf_write = rte_malloc(\"memcpy\", LARGE_BUFFER_SIZE + ALIGNMENT_UNIT, ALIGNMENT_UNIT);\n+\tlarge_buf_write = rte_malloc(\"memcpy\",\n+\t\t\t\t LARGE_BUFFER_SIZE + alignment_unit,\n+\t\t\t\t alignment_unit);\n \tif (large_buf_write == NULL)\n \t\tgoto error_large_buf_write;\n \n-\tsmall_buf_read = rte_malloc(\"memcpy\", SMALL_BUFFER_SIZE + ALIGNMENT_UNIT, ALIGNMENT_UNIT);\n+\tsmall_buf_read = rte_malloc(\"memcpy\",\n+\t\t\t\t SMALL_BUFFER_SIZE + alignment_unit,\n+\t\t\t\t alignment_unit);\n \tif (small_buf_read == NULL)\n \t\tgoto error_small_buf_read;\n \n-\tsmall_buf_write = rte_malloc(\"memcpy\", SMALL_BUFFER_SIZE + ALIGNMENT_UNIT, ALIGNMENT_UNIT);\n+\tsmall_buf_write = rte_malloc(\"memcpy\",\n+\t\t\t\t SMALL_BUFFER_SIZE + alignment_unit,\n+\t\t\t\t alignment_unit);\n \tif (small_buf_write == NULL)\n \t\tgoto error_small_buf_write;\n \n@@ -153,7 +166,7 @@ static inline size_t\n get_rand_offset(size_t uoffset)\n {\n \treturn ((rte_rand() % (LARGE_BUFFER_SIZE - SMALL_BUFFER_SIZE)) &\n-\t\t\t~(ALIGNMENT_UNIT - 1)) + uoffset;\n+\t\t\t~(alignment_unit - 1)) + uoffset;\n }\n \n /* Fill in source and destination addresses. */\n@@ -321,7 +334,8 @@ perf_test(void)\n \t\t \"(bytes) (ticks) (ticks) (ticks) (ticks)\\n\"\n \t\t \"------- -------------- -------------- -------------- --------------\");\n \n-\tprintf(\"\\n========================== %2dB aligned ============================\", ALIGNMENT_UNIT);\n+\tprintf(\"\\n========================= %2dB aligned ============================\",\n+\t\talignment_unit);\n \t/* Do aligned tests where size is a variable */\n \tperf_test_variable_aligned();\n \tprintf(\"\\n------- -------------- -------------- -------------- --------------\");\n", "prefixes": [ "dpdk-dev", "v2", "2/3" ] }{ "id": 28252, "url": "