Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/79355/?format=api
http://patches.dpdk.org/api/patches/79355/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200930130415.11211-19-ciara.power@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": "<20200930130415.11211-19-ciara.power@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200930130415.11211-19-ciara.power@intel.com", "date": "2020-09-30T13:04:14", "name": "[v3,18/18] lpm: choose vector path at runtime", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "bbc97f53ca1f33c98123e572c59b357f1726d150", "submitter": { "id": 978, "url": "http://patches.dpdk.org/api/people/978/?format=api", "name": "Power, Ciara", "email": "ciara.power@intel.com" }, "delegate": { "id": 24651, "url": "http://patches.dpdk.org/api/users/24651/?format=api", "username": "dmarchand", "first_name": "David", "last_name": "Marchand", "email": "david.marchand@redhat.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200930130415.11211-19-ciara.power@intel.com/mbox/", "series": [ { "id": 12621, "url": "http://patches.dpdk.org/api/series/12621/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12621", "date": "2020-09-30T13:03:56", "name": "add max SIMD bitwidth to EAL", "version": 3, "mbox": "http://patches.dpdk.org/series/12621/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/79355/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/79355/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 B8BB8A04B5;\n\tWed, 30 Sep 2020 15:14:19 +0200 (CEST)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 321F21DBA3;\n\tWed, 30 Sep 2020 15:08:48 +0200 (CEST)", "from mga18.intel.com (mga18.intel.com [134.134.136.126])\n by dpdk.org (Postfix) with ESMTP id 700251DB69\n for <dev@dpdk.org>; Wed, 30 Sep 2020 15:08:31 +0200 (CEST)", "from fmsmga008.fm.intel.com ([10.253.24.58])\n by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 30 Sep 2020 06:08:30 -0700", "from silpixa00399953.ir.intel.com (HELO\n silpixa00399953.ger.corp.intel.com) ([10.237.222.53])\n by fmsmga008.fm.intel.com with ESMTP; 30 Sep 2020 06:08:29 -0700" ], "IronPort-SDR": [ "\n FV+b+4P7kMAuRCOiVVKgUFcw1+WSZogbbXOeRQJmkh0af7lDTioAra7QBjh4mVDQnRH++BK7we\n CxocF9TM+Mjg==", "\n GUzG9J+IIRnW/o3gdcIxhUIFJBYvgysAv/oJSiBiQaTNYyC/tO4ejejVoxTaAmdsVCfx2K2hED\n AxDIjaY6zCCw==" ], "X-IronPort-AV": [ "E=McAfee;i=\"6000,8403,9759\"; a=\"150223515\"", "E=Sophos;i=\"5.77,322,1596524400\"; d=\"scan'208\";a=\"150223515\"", "E=Sophos;i=\"5.77,322,1596524400\"; d=\"scan'208\";a=\"294603292\"" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "From": "Ciara Power <ciara.power@intel.com>", "To": "dev@dpdk.org", "Cc": "Ciara Power <ciara.power@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Jerin Jacob <jerinj@marvell.com>, Ruifeng Wang <ruifeng.wang@arm.com>", "Date": "Wed, 30 Sep 2020 14:04:14 +0100", "Message-Id": "<20200930130415.11211-19-ciara.power@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20200930130415.11211-1-ciara.power@intel.com>", "References": "<20200807155859.63888-1-ciara.power@intel.com>\n <20200930130415.11211-1-ciara.power@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 18/18] lpm: choose vector path at runtime", "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": "When choosing the vector path, max SIMD bitwidth is now checked to\nensure a vector path is allowable. To do this, rather than the vector\nlookup functions being called directly from apps, a generic lookup\nfunction is called which will call the vector functions if suitable.\n\nSigned-off-by: Ciara Power <ciara.power@intel.com>\n---\n lib/librte_lpm/rte_lpm.h | 57 ++++++++++++++++++++++++++------\n lib/librte_lpm/rte_lpm_altivec.h | 2 +-\n lib/librte_lpm/rte_lpm_neon.h | 2 +-\n lib/librte_lpm/rte_lpm_sse.h | 2 +-\n 4 files changed, 50 insertions(+), 13 deletions(-)", "diff": "diff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h\nindex 03da2d37e0..edba7cafd5 100644\n--- a/lib/librte_lpm/rte_lpm.h\n+++ b/lib/librte_lpm/rte_lpm.h\n@@ -397,8 +397,18 @@ rte_lpm_lookup_bulk_func(const struct rte_lpm *lpm, const uint32_t *ips,\n /* Mask four results. */\n #define\t RTE_LPM_MASKX4_RES\tUINT64_C(0x00ffffff00ffffff)\n \n+#if defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)\n+#include \"rte_lpm_neon.h\"\n+#elif defined(RTE_ARCH_PPC_64)\n+#include \"rte_lpm_altivec.h\"\n+#else\n+#include \"rte_lpm_sse.h\"\n+#endif\n+\n /**\n- * Lookup four IP addresses in an LPM table.\n+ * Lookup four IP addresses in an LPM table individually by calling the\n+ * lookup function for each ip. This is used when lookupx4 is called but\n+ * the vector path is not suitable.\n *\n * @param lpm\n * LPM object handle\n@@ -417,16 +427,43 @@ rte_lpm_lookup_bulk_func(const struct rte_lpm *lpm, const uint32_t *ips,\n * if lookup would fail.\n */\n static inline void\n-rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n-\tuint32_t defv);\n+rte_lpm_lookupx4_scalar(struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+\tuint32_t defv)\n+{\n+\tint i;\n+\tfor (i = 0; i < 4; i++)\n+\t\tif (rte_lpm_lookup(lpm, ((uint32_t *) &ip)[i], &hop[i]) < 0)\n+\t\t\thop[i] = defv; /* lookupx4 expected to set on failure */\n+}\n \n-#if defined(RTE_ARCH_ARM) || defined(RTE_ARCH_ARM64)\n-#include \"rte_lpm_neon.h\"\n-#elif defined(RTE_ARCH_PPC_64)\n-#include \"rte_lpm_altivec.h\"\n-#else\n-#include \"rte_lpm_sse.h\"\n-#endif\n+/**\n+ * Lookup four IP addresses in an LPM table.\n+ *\n+ * @param lpm\n+ * LPM object handle\n+ * @param ip\n+ * Four IPs to be looked up in the LPM table\n+ * @param hop\n+ * Next hop of the most specific rule found for IP (valid on lookup hit only).\n+ * This is an 4 elements array of two byte values.\n+ * If the lookup was successful for the given IP, then least significant byte\n+ * of the corresponding element is the actual next hop and the most\n+ * significant byte is zero.\n+ * If the lookup for the given IP failed, then corresponding element would\n+ * contain default value, see description of then next parameter.\n+ * @param defv\n+ * Default value to populate into corresponding element of hop[] array,\n+ * if lookup would fail.\n+ */\n+static inline void\n+rte_lpm_lookupx4(struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+\tuint32_t defv)\n+{\n+\tif (rte_get_max_simd_bitwidth() >= RTE_MAX_128_SIMD)\n+\t\trte_lpm_lookupx4_vec(lpm, ip, hop, defv);\n+\telse\n+\t\trte_lpm_lookupx4_scalar(lpm, ip, hop, defv);\n+}\n \n #ifdef __cplusplus\n }\ndiff --git a/lib/librte_lpm/rte_lpm_altivec.h b/lib/librte_lpm/rte_lpm_altivec.h\nindex 228c41b38e..82142d3351 100644\n--- a/lib/librte_lpm/rte_lpm_altivec.h\n+++ b/lib/librte_lpm/rte_lpm_altivec.h\n@@ -16,7 +16,7 @@ extern \"C\" {\n #endif\n \n static inline void\n-rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+rte_lpm_lookupx4_vec(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n \tuint32_t defv)\n {\n \tvector signed int i24;\ndiff --git a/lib/librte_lpm/rte_lpm_neon.h b/lib/librte_lpm/rte_lpm_neon.h\nindex 6c131d3125..14b184515d 100644\n--- a/lib/librte_lpm/rte_lpm_neon.h\n+++ b/lib/librte_lpm/rte_lpm_neon.h\n@@ -16,7 +16,7 @@ extern \"C\" {\n #endif\n \n static inline void\n-rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+rte_lpm_lookupx4_vec(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n \tuint32_t defv)\n {\n \tuint32x4_t i24;\ndiff --git a/lib/librte_lpm/rte_lpm_sse.h b/lib/librte_lpm/rte_lpm_sse.h\nindex 44770b6ff8..cb5477c6cf 100644\n--- a/lib/librte_lpm/rte_lpm_sse.h\n+++ b/lib/librte_lpm/rte_lpm_sse.h\n@@ -15,7 +15,7 @@ extern \"C\" {\n #endif\n \n static inline void\n-rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+rte_lpm_lookupx4_vec(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n \tuint32_t defv)\n {\n \t__m128i i24;\n", "prefixes": [ "v3", "18/18" ] }{ "id": 79355, "url": "