Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/29492/?format=api
https://patches.dpdk.org/api/patches/29492/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1506960796-71620-4-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": "<1506960796-71620-4-git-send-email-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1506960796-71620-4-git-send-email-xiaoyun.li@intel.com", "date": "2017-10-02T16:13:16", "name": "[dpdk-dev,v4,3/3] efd: run-time dispatch over x86 EFD functions", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "ccddb7ccccd9e4b53df523fa057c7f8aedcf857e", "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/1506960796-71620-4-git-send-email-xiaoyun.li@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/29492/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/29492/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 EA74D1B285;\n\tMon, 2 Oct 2017 18:15:28 +0200 (CEST)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id E4E231B277\n\tfor <dev@dpdk.org>; Mon, 2 Oct 2017 18:15:26 +0200 (CEST)", "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t02 Oct 2017 09:15:26 -0700", "from dpdk-lixiaoyun.sh.intel.com ([10.67.111.93])\n\tby orsmga005.jf.intel.com with ESMTP; 02 Oct 2017 09:15:24 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.42,470,1500966000\"; d=\"scan'208\";a=\"155733475\"", "From": "Xiaoyun Li <xiaoyun.li@intel.com>", "To": "konstantin.ananyev@intel.com,\n\tbruce.richardson@intel.com", "Cc": "wenzhuo.lu@intel.com, helin.zhang@intel.com, dev@dpdk.org,\n\tXiaoyun Li <xiaoyun.li@intel.com>", "Date": "Tue, 3 Oct 2017 00:13:16 +0800", "Message-Id": "<1506960796-71620-4-git-send-email-xiaoyun.li@intel.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1506960796-71620-1-git-send-email-xiaoyun.li@intel.com>", "References": "<1506411689-94690-1-git-send-email-xiaoyun.li@intel.com>\n\t<1506960796-71620-1-git-send-email-xiaoyun.li@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 3/3] efd: run-time dispatch over x86 EFD\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": "<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 dynamically selects x86 EFD functions at run-time.\nThis patch uses function pointer and binds it to the relative\nfunction based on CPU flags at constructor time.\n\nSigned-off-by: Xiaoyun Li <xiaoyun.li@intel.com>\n---\n lib/librte_efd/rte_efd_x86.h | 41 ++++++++++++++++++++++++++++++++++++++---\n 1 file changed, 38 insertions(+), 3 deletions(-)", "diff": "diff --git a/lib/librte_efd/rte_efd_x86.h b/lib/librte_efd/rte_efd_x86.h\nindex 34f37d7..93b6743 100644\n--- a/lib/librte_efd/rte_efd_x86.h\n+++ b/lib/librte_efd/rte_efd_x86.h\n@@ -43,12 +43,29 @@\n #define EFD_LOAD_SI128(val) _mm_lddqu_si128(val)\n #endif\n \n+typedef efd_value_t\n+(*efd_lookup_internal_avx2_t)(const efd_hashfunc_t *group_hash_idx,\n+\t\tconst efd_lookuptbl_t *group_lookup_table,\n+\t\tconst uint32_t hash_val_a, const uint32_t hash_val_b);\n+\n+static efd_lookup_internal_avx2_t efd_lookup_internal_avx2_ptr;\n+\n static inline efd_value_t\n efd_lookup_internal_avx2(const efd_hashfunc_t *group_hash_idx,\n \t\tconst efd_lookuptbl_t *group_lookup_table,\n \t\tconst uint32_t hash_val_a, const uint32_t hash_val_b)\n {\n-#ifdef RTE_MACHINE_CPUFLAG_AVX2\n+\treturn (*efd_lookup_internal_avx2_ptr)(group_hash_idx,\n+\t\t\t\t\t group_lookup_table,\n+\t\t\t\t\t hash_val_a, hash_val_b);\n+}\n+\n+#ifdef CC_SUPPORT_AVX2\n+static inline efd_value_t\n+efd_lookup_internal_avx2_AVX2(const efd_hashfunc_t *group_hash_idx,\n+\t\tconst efd_lookuptbl_t *group_lookup_table,\n+\t\tconst uint32_t hash_val_a, const uint32_t hash_val_b)\n+{\n \tefd_value_t value = 0;\n \tuint32_t i = 0;\n \t__m256i vhash_val_a = _mm256_set1_epi32(hash_val_a);\n@@ -74,13 +91,31 @@ efd_lookup_internal_avx2(const efd_hashfunc_t *group_hash_idx,\n \t}\n \n \treturn value;\n-#else\n+}\n+#endif\n+\n+static inline efd_value_t\n+efd_lookup_internal_avx2_DEFAULT(const efd_hashfunc_t *group_hash_idx,\n+\t\tconst efd_lookuptbl_t *group_lookup_table,\n+\t\tconst uint32_t hash_val_a, const uint32_t hash_val_b)\n+{\n \tRTE_SET_USED(group_hash_idx);\n \tRTE_SET_USED(group_lookup_table);\n \tRTE_SET_USED(hash_val_a);\n \tRTE_SET_USED(hash_val_b);\n \t/* Return dummy value, only to avoid compilation breakage */\n \treturn 0;\n-#endif\n+}\n \n+static void __attribute__((constructor))\n+rte_efd_x86_init(void)\n+{\n+#ifdef CC_SUPPORT_AVX2\n+\tif (rte_cpu_get_flag_enabled(RTE_CPUFLAG_AVX2))\n+\t\tefd_lookup_internal_avx2_ptr = efd_lookup_internal_avx2_AVX2;\n+\telse\n+\t\tefd_lookup_internal_avx2_ptr = efd_lookup_internal_avx2_DEFAULT;\n+#else\n+\tefd_lookup_internal_avx2_ptr = efd_lookup_internal_avx2_DEFAULT;\n+#endif\n }\n", "prefixes": [ "dpdk-dev", "v4", "3/3" ] }{ "id": 29492, "url": "