Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/28253/?format=api
https://patches.dpdk.org/api/patches/28253/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1504256222-32969-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": "<1504256222-32969-4-git-send-email-xiaoyun.li@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1504256222-32969-4-git-send-email-xiaoyun.li@intel.com", "date": "2017-09-01T08:57:02", "name": "[dpdk-dev,v2,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/1504256222-32969-4-git-send-email-xiaoyun.li@intel.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/28253/comments/", "check": "fail", "checks": "https://patches.dpdk.org/api/patches/28253/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 4701F7CE2;\n\tFri, 1 Sep 2017 10:58:07 +0200 (CEST)", "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 50E0A7CF5\n\tfor <dev@dpdk.org>; Fri, 1 Sep 2017 10:58:05 +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:04 -0700", "from dpdk-lixiaoyun.sh.intel.com ([10.67.110.162])\n\tby orsmga004.jf.intel.com with ESMTP; 01 Sep 2017 01:58:03 -0700" ], "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.41,457,1498546800\"; d=\"scan'208\";a=\"124641552\"", "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:02 +0800", "Message-Id": "<1504256222-32969-4-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 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", "v2", "3/3" ] }{ "id": 28253, "url": "