Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/75314/?format=api
http://patches.dpdk.org/api/patches/75314/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200807162829.11690-5-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": "<20200807162829.11690-5-konstantin.ananyev@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200807162829.11690-5-konstantin.ananyev@intel.com", "date": "2020-08-07T16:28:26", "name": "[20.11,4/7] acl: add infrastructure to support AVX512 classify", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "e075a39eb0f3e4c36d245f769d8e719c25ba4315", "submitter": { "id": 33, "url": "http://patches.dpdk.org/api/people/33/?format=api", "name": "Ananyev, Konstantin", "email": "konstantin.ananyev@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/20200807162829.11690-5-konstantin.ananyev@intel.com/mbox/", "series": [ { "id": 11551, "url": "http://patches.dpdk.org/api/series/11551/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11551", "date": "2020-08-07T16:28:22", "name": "acl: introduce AVX512 classify method", "version": 1, "mbox": "http://patches.dpdk.org/series/11551/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/75314/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/75314/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 4D69BA04B0;\n\tFri, 7 Aug 2020 18:29:25 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id B40161C0C2;\n\tFri, 7 Aug 2020 18:28:59 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 861921C0BC\n for <dev@dpdk.org>; Fri, 7 Aug 2020 18:28:58 +0200 (CEST)", "from orsmga008.jf.intel.com ([10.7.209.65])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 07 Aug 2020 09:28:58 -0700", "from sivswdev08.ir.intel.com ([10.237.217.47])\n by orsmga008.jf.intel.com with ESMTP; 07 Aug 2020 09:28:56 -0700" ], "IronPort-SDR": [ "\n XBFACAqq8vpD1VmmC/Qv7JixxPipMNY1eYcFZi9u+20WjxJShh8VauX99UTLZ+WKycJpx8DfRF\n fLW30Oa7FZXw==", "\n F+B6XTHL0Z+4S6QajgiT+avQVQEs1MsWQuYrZ5ynFxlENU/tRVTflYy7wzKbDkrRWT925LmvqH\n kL1y4bpI+A0Q==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9706\"; a=\"141003400\"", "E=Sophos;i=\"5.75,446,1589266800\"; d=\"scan'208\";a=\"141003400\"", "E=Sophos;i=\"5.75,446,1589266800\"; d=\"scan'208\";a=\"323799717\"" ], "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": "Fri, 7 Aug 2020 17:28:26 +0100", "Message-Id": "<20200807162829.11690-5-konstantin.ananyev@intel.com>", "X-Mailer": "git-send-email 2.18.0", "In-Reply-To": "<20200807162829.11690-1-konstantin.ananyev@intel.com>", "References": "<20200807162829.11690-1-konstantin.ananyev@intel.com>", "Subject": "[dpdk-dev] [PATCH 20.11 4/7] acl: add infrastructure to support\n\tAVX512 classify", "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": "Add necessary changes to support new AVX512 specific ACL classify\nalgorithm:\n - changes in meson.build and Makefile to check that build tools\n (compiler, assembler, etc.) do properly support AVX512.\n - dummy rte_acl_classify_avx512() for targets where AVX512\n implementation couldn't be properly supported.\n\nSigned-off-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\n---\n config/x86/meson.build | 3 ++-\n lib/librte_acl/Makefile | 26 ++++++++++++++++++++++\n lib/librte_acl/acl.h | 4 ++++\n lib/librte_acl/acl_run_avx512.c | 17 ++++++++++++++\n lib/librte_acl/meson.build | 39 +++++++++++++++++++++++++++++++++\n lib/librte_acl/rte_acl.c | 17 ++++++++++++++\n lib/librte_acl/rte_acl.h | 1 +\n 7 files changed, 106 insertions(+), 1 deletion(-)\n create mode 100644 lib/librte_acl/acl_run_avx512.c", "diff": "diff --git a/config/x86/meson.build b/config/x86/meson.build\nindex 6ec020ef6..c5626e914 100644\n--- a/config/x86/meson.build\n+++ b/config/x86/meson.build\n@@ -23,7 +23,8 @@ foreach f:base_flags\n endforeach\n \n optional_flags = ['AES', 'PCLMUL',\n-\t\t'AVX', 'AVX2', 'AVX512F',\n+\t\t'AVX', 'AVX2',\n+\t\t'AVX512F', 'AVX512VL', 'AVX512CD', 'AVX512BW',\n \t\t'RDRND', 'RDSEED']\n foreach f:optional_flags\n \tif cc.get_define('__@0@__'.format(f), args: machine_args) == '1'\ndiff --git a/lib/librte_acl/Makefile b/lib/librte_acl/Makefile\nindex f4332b044..8bd469c2b 100644\n--- a/lib/librte_acl/Makefile\n+++ b/lib/librte_acl/Makefile\n@@ -58,6 +58,32 @@ ifeq ($(CC_AVX2_SUPPORT), 1)\n \tCFLAGS_rte_acl.o += -DCC_AVX2_SUPPORT\n endif\n \n+# compile AVX512 version if:\n+# we are building 64-bit binary AND binutils can generate proper code\n+ifeq ($(CONFIG_RTE_ARCH_X86_64),y)\n+\n+\tBINUTIL_OK=$(shell AS=as; \\\n+\t\t$(RTE_SDK)/buildtools/binutils-avx512-check.sh && \\\n+\t\techo 1)\n+\tifeq ($(BINUTIL_OK), 1)\n+\n+\t\t# If the compiler supports AVX512 instructions,\n+\t\t# then add support for AVX512 classify method.\n+\n+\t\tCC_AVX512_FLAGS=$(shell $(CC) \\\n+\t\t-mavx512f -mavx512vl -mavx512cd -mavx512bw \\\n+\t\t-dM -E - </dev/null 2>&1 | grep AVX512 | wc -l)\n+\t\tifeq ($(CC_AVX512_FLAGS), 4)\n+\t\t\tCFLAGS_acl_run_avx512.o += -mavx512f\n+\t\t\tCFLAGS_acl_run_avx512.o += -mavx512vl\n+\t\t\tCFLAGS_acl_run_avx512.o += -mavx512cd\n+\t\t\tCFLAGS_acl_run_avx512.o += -mavx512bw\n+\t\t\tSRCS-$(CONFIG_RTE_LIBRTE_ACL) += acl_run_avx512.c\n+\t\t\tCFLAGS_rte_acl.o += -DCC_AVX512_SUPPORT\n+\t\tendif\n+\tendif\n+endif\n+\n # install this header file\n SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include := rte_acl_osdep.h\n SYMLINK-$(CONFIG_RTE_LIBRTE_ACL)-include += rte_acl.h\ndiff --git a/lib/librte_acl/acl.h b/lib/librte_acl/acl.h\nindex 39d45a0c2..2022cf253 100644\n--- a/lib/librte_acl/acl.h\n+++ b/lib/librte_acl/acl.h\n@@ -201,6 +201,10 @@ int\n rte_acl_classify_avx2(const struct rte_acl_ctx *ctx, const uint8_t **data,\n \tuint32_t *results, uint32_t num, uint32_t categories);\n \n+int\n+rte_acl_classify_avx512(const struct rte_acl_ctx *ctx, const uint8_t **data,\n+\tuint32_t *results, uint32_t num, uint32_t categories);\n+\n int\n rte_acl_classify_neon(const struct rte_acl_ctx *ctx, const uint8_t **data,\n \tuint32_t *results, uint32_t num, uint32_t categories);\ndiff --git a/lib/librte_acl/acl_run_avx512.c b/lib/librte_acl/acl_run_avx512.c\nnew file mode 100644\nindex 000000000..67274989d\n--- /dev/null\n+++ b/lib/librte_acl/acl_run_avx512.c\n@@ -0,0 +1,17 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Intel Corporation\n+ */\n+\n+#include \"acl_run_sse.h\"\n+\n+int\n+rte_acl_classify_avx512(const struct rte_acl_ctx *ctx, const uint8_t **data,\n+\tuint32_t *results, uint32_t num, uint32_t categories)\n+{\n+\tif (num >= MAX_SEARCHES_SSE8)\n+\t\treturn search_sse_8(ctx, data, results, num, categories);\n+\tif (num >= MAX_SEARCHES_SSE4)\n+\t\treturn search_sse_4(ctx, data, results, num, categories);\n+\n+\treturn rte_acl_classify_scalar(ctx, data, results, num, categories);\n+}\ndiff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build\nindex d1e2c184c..b2fd61cad 100644\n--- a/lib/librte_acl/meson.build\n+++ b/lib/librte_acl/meson.build\n@@ -27,6 +27,45 @@ if dpdk_conf.has('RTE_ARCH_X86')\n \t\tcflags += '-DCC_AVX2_SUPPORT'\n \tendif\n \n+\t# compile AVX512 version if:\n+\t# we are building 64-bit binary AND binutils can generate proper code\n+\n+\tif dpdk_conf.has('RTE_ARCH_X86_64') and binutils_ok.returncode() == 0\n+\n+\t\t# compile AVX512 version if either:\n+\t\t# a. we have AVX512 supported in minimum instruction set\n+\t\t# baseline\n+\t\t# b. it's not minimum instruction set, but supported by\n+\t\t# compiler\n+\t\t#\n+\t\t# in former case, just add avx512 C file to files list\n+\t\t# in latter case, compile c file to static lib, using correct\n+\t\t# compiler flags, and then have the .o file from static lib\n+\t\t# linked into main lib.\n+\n+\t\tif dpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512F') and \\\n+\t\t\tdpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512VL') and \\\n+\t\t\tdpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512CD') and \\\n+\t\t\tdpdk_conf.has('RTE_MACHINE_CPUFLAG_AVX512BW')\n+\n+\t\t\tsources += files('acl_run_avx512.c')\n+\t\t\tcflags += '-DCC_AVX512_SUPPORT'\n+\n+\t\telif cc.has_multi_arguments('-mavx512f', '-mavx512vl',\n+\t\t\t\t\t'-mavx512cd', '-mavx512bw')\n+\n+\t\t\tavx512_tmplib = static_library('avx512_tmp',\n+\t\t\t\t'acl_run_avx512.c',\n+\t\t\t\tdependencies: static_rte_eal,\n+\t\t\t\tc_args: cflags +\n+\t\t\t\t\t['-mavx512f', '-mavx512vl',\n+\t\t\t\t\t '-mavx512cd', '-mavx512bw'])\n+\t\t\tobjs += avx512_tmplib.extract_objects(\n+\t\t\t\t\t'acl_run_avx512.c')\n+\t\t\tcflags += '-DCC_AVX512_SUPPORT'\n+\t\tendif\n+\tendif\n+\n elif dpdk_conf.has('RTE_ARCH_ARM') or dpdk_conf.has('RTE_ARCH_ARM64')\n \tcflags += '-flax-vector-conversions'\n \tsources += files('acl_run_neon.c')\ndiff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c\nindex 715b02359..71b4afb08 100644\n--- a/lib/librte_acl/rte_acl.c\n+++ b/lib/librte_acl/rte_acl.c\n@@ -16,6 +16,22 @@ static struct rte_tailq_elem rte_acl_tailq = {\n };\n EAL_REGISTER_TAILQ(rte_acl_tailq)\n \n+#ifndef CC_AVX512_SUPPORT\n+/*\n+ * If the compiler doesn't support AVX512 instructions,\n+ * then the dummy one would be used instead for AVX512 classify method.\n+ */\n+int\n+rte_acl_classify_avx512(__rte_unused const struct rte_acl_ctx *ctx,\n+\t__rte_unused const uint8_t **data,\n+\t__rte_unused uint32_t *results,\n+\t__rte_unused uint32_t num,\n+\t__rte_unused uint32_t categories)\n+{\n+\treturn -ENOTSUP;\n+}\n+#endif\n+\n #ifndef CC_AVX2_SUPPORT\n /*\n * If the compiler doesn't support AVX2 instructions,\n@@ -77,6 +93,7 @@ static const rte_acl_classify_t classify_fns[] = {\n \t[RTE_ACL_CLASSIFY_AVX2] = rte_acl_classify_avx2,\n \t[RTE_ACL_CLASSIFY_NEON] = rte_acl_classify_neon,\n \t[RTE_ACL_CLASSIFY_ALTIVEC] = rte_acl_classify_altivec,\n+\t[RTE_ACL_CLASSIFY_AVX512] = rte_acl_classify_avx512,\n };\n \n /* by default, use always available scalar code path. */\ndiff --git a/lib/librte_acl/rte_acl.h b/lib/librte_acl/rte_acl.h\nindex b814423a6..6f39042fc 100644\n--- a/lib/librte_acl/rte_acl.h\n+++ b/lib/librte_acl/rte_acl.h\n@@ -241,6 +241,7 @@ enum rte_acl_classify_alg {\n \tRTE_ACL_CLASSIFY_AVX2 = 3, /**< requires AVX2 support. */\n \tRTE_ACL_CLASSIFY_NEON = 4, /**< requires NEON support. */\n \tRTE_ACL_CLASSIFY_ALTIVEC = 5, /**< requires ALTIVEC support. */\n+\tRTE_ACL_CLASSIFY_AVX512 = 6, /**< requires AVX512 support. */\n };\n \n /**\n", "prefixes": [ "20.11", "4/7" ] }{ "id": 75314, "url": "