Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/52598/?format=api
http://patches.dpdk.org/api/patches/52598/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190410134517.63896-2-bruce.richardson@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": "<20190410134517.63896-2-bruce.richardson@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190410134517.63896-2-bruce.richardson@intel.com", "date": "2019-04-10T13:45:16", "name": "[1/2] acl: remove use of weak functions", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "4c0fdf6993144b3cfffcf2ff44f1da0ca4400f61", "submitter": { "id": 20, "url": "http://patches.dpdk.org/api/people/20/?format=api", "name": "Bruce Richardson", "email": "bruce.richardson@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/20190410134517.63896-2-bruce.richardson@intel.com/mbox/", "series": [ { "id": 4242, "url": "http://patches.dpdk.org/api/series/4242/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4242", "date": "2019-04-10T13:45:15", "name": "remove use of weak functions from libraries", "version": 1, "mbox": "http://patches.dpdk.org/series/4242/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/52598/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/52598/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 F22A21B0F7;\n\tWed, 10 Apr 2019 15:45:30 +0200 (CEST)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 67F2A7D4A\n\tfor <dev@dpdk.org>; Wed, 10 Apr 2019 15:45:28 +0200 (CEST)", "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t10 Apr 2019 06:45:28 -0700", "from silpixa00399126.ir.intel.com (HELO\n\tsilpixa00399126.ger.corp.intel.com) ([10.237.222.236])\n\tby orsmga003.jf.intel.com with ESMTP; 10 Apr 2019 06:45:26 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.60,332,1549958400\"; d=\"scan'208\";a=\"141569335\"", "From": "Bruce Richardson <bruce.richardson@intel.com>", "To": "konstantin.ananyev@intel.com,\n\taconole@redhat.com", "Cc": "dev@dpdk.org,\n\tBruce Richardson <bruce.richardson@intel.com>", "Date": "Wed, 10 Apr 2019 14:45:16 +0100", "Message-Id": "<20190410134517.63896-2-bruce.richardson@intel.com>", "X-Mailer": "git-send-email 2.20.1", "In-Reply-To": "<20190410134517.63896-1-bruce.richardson@intel.com>", "References": "<20190410134517.63896-1-bruce.richardson@intel.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[dpdk-dev] [PATCH 1/2] acl: remove use of weak functions", "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>", "Errors-To": "dev-bounces@dpdk.org", "Sender": "\"dev\" <dev-bounces@dpdk.org>" }, "content": "Weak functions don't work well with static libraries and require the use of\n\"whole-archive\" flag to ensure that the correct function is used when\nlinking. Since the weak functions are only used as placeholders within\nthis library alone, we can replace them with non-weak functions using\npreprocessor ifdefs.\n\nSigned-off-by: Bruce Richardson <bruce.richardson@intel.com>\n---\n lib/librte_acl/meson.build | 7 ++++++-\n lib/librte_acl/rte_acl.c | 18 ++++++++++++++----\n mk/rte.app.mk | 3 ---\n 3 files changed, 20 insertions(+), 8 deletions(-)", "diff": "diff --git a/lib/librte_acl/meson.build b/lib/librte_acl/meson.build\nindex 2207dbafe..98ece7d85 100644\n--- a/lib/librte_acl/meson.build\n+++ b/lib/librte_acl/meson.build\n@@ -6,7 +6,7 @@ sources = files('acl_bld.c', 'acl_gen.c', 'acl_run_scalar.c',\n \t\t'rte_acl.c', 'tb_mem.c')\n headers = files('rte_acl.h', 'rte_acl_osdep.h')\n \n-if arch_subdir == 'x86'\n+if dpdk_conf.has('RTE_ARCH_X86')\n \tsources += files('acl_run_sse.c')\n \n \t# compile AVX2 version if either:\n@@ -28,4 +28,9 @@ if arch_subdir == 'x86'\n \t\tcflags += '-DCC_AVX2_SUPPORT'\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')\n+elif dpdk_conf.has('RTE_ARCH_PPC_64')\n+\tsources += files('acl_run_altivec.c')\n endif\ndiff --git a/lib/librte_acl/rte_acl.c b/lib/librte_acl/rte_acl.c\nindex c436a9bfd..fd5bd5e4e 100644\n--- a/lib/librte_acl/rte_acl.c\n+++ b/lib/librte_acl/rte_acl.c\n@@ -13,11 +13,13 @@ static struct rte_tailq_elem rte_acl_tailq = {\n };\n EAL_REGISTER_TAILQ(rte_acl_tailq)\n \n+#ifndef RTE_ARCH_X86\n+#ifndef CC_AVX2_SUPPORT\n /*\n * If the compiler doesn't support AVX2 instructions,\n * then the dummy one would be used instead for AVX2 classify method.\n */\n-__rte_weak int\n+int\n rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx,\n \t__rte_unused const uint8_t **data,\n \t__rte_unused uint32_t *results,\n@@ -26,8 +28,9 @@ rte_acl_classify_avx2(__rte_unused const struct rte_acl_ctx *ctx,\n {\n \treturn -ENOTSUP;\n }\n+#endif\n \n-__rte_weak int\n+int\n rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx,\n \t__rte_unused const uint8_t **data,\n \t__rte_unused uint32_t *results,\n@@ -36,8 +39,11 @@ rte_acl_classify_sse(__rte_unused const struct rte_acl_ctx *ctx,\n {\n \treturn -ENOTSUP;\n }\n+#endif\n \n-__rte_weak int\n+#ifndef RTE_ARCH_ARM\n+#ifndef RTE_ARCH_ARM64\n+int\n rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,\n \t__rte_unused const uint8_t **data,\n \t__rte_unused uint32_t *results,\n@@ -46,8 +52,11 @@ rte_acl_classify_neon(__rte_unused const struct rte_acl_ctx *ctx,\n {\n \treturn -ENOTSUP;\n }\n+#endif\n+#endif\n \n-__rte_weak int\n+#ifndef RTE_ARCH_PPC_64\n+int\n rte_acl_classify_altivec(__rte_unused const struct rte_acl_ctx *ctx,\n \t__rte_unused const uint8_t **data,\n \t__rte_unused uint32_t *results,\n@@ -56,6 +65,7 @@ rte_acl_classify_altivec(__rte_unused const struct rte_acl_ctx *ctx,\n {\n \treturn -ENOTSUP;\n }\n+#endif\n \n static const rte_acl_classify_t classify_fns[] = {\n \t[RTE_ACL_CLASSIFY_DEFAULT] = rte_acl_classify_scalar,\ndiff --git a/mk/rte.app.mk b/mk/rte.app.mk\nindex 7d994bece..fdec636b4 100644\n--- a/mk/rte.app.mk\n+++ b/mk/rte.app.mk\n@@ -46,10 +46,7 @@ _LDLIBS-$(CONFIG_RTE_LIBRTE_DISTRIBUTOR) += -lrte_distributor\n _LDLIBS-$(CONFIG_RTE_LIBRTE_IP_FRAG) += -lrte_ip_frag\n _LDLIBS-$(CONFIG_RTE_LIBRTE_METER) += -lrte_meter\n _LDLIBS-$(CONFIG_RTE_LIBRTE_LPM) += -lrte_lpm\n-# librte_acl needs --whole-archive because of weak functions\n-_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += --whole-archive\n _LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += -lrte_acl\n-_LDLIBS-$(CONFIG_RTE_LIBRTE_ACL) += --no-whole-archive\n _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --no-as-needed\n _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += --whole-archive\n _LDLIBS-$(CONFIG_RTE_LIBRTE_TELEMETRY) += -lrte_telemetry -ljansson\n", "prefixes": [ "1/2" ] }{ "id": 52598, "url": "