Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/8033/?format=api
https://patches.dpdk.org/api/patches/8033/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/1445877458-31052-16-git-send-email-viktorin@rehivetech.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": "<1445877458-31052-16-git-send-email-viktorin@rehivetech.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1445877458-31052-16-git-send-email-viktorin@rehivetech.com", "date": "2015-10-26T16:37:37", "name": "[dpdk-dev,v2,15/16] lpm/arm: implement rte_lpm_lookupx4 using rte_lpm_lookup_bulk on for-x86", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "23ea0b4615e3564db6adc7b03039e55673216c3d", "submitter": { "id": 292, "url": "https://patches.dpdk.org/api/people/292/?format=api", "name": "Jan Viktorin", "email": "viktorin@rehivetech.com" }, "delegate": null, "mbox": "https://patches.dpdk.org/project/dpdk/patch/1445877458-31052-16-git-send-email-viktorin@rehivetech.com/mbox/", "series": [], "comments": "https://patches.dpdk.org/api/patches/8033/comments/", "check": "pending", "checks": "https://patches.dpdk.org/api/patches/8033/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 26D208EA0;\n\tMon, 26 Oct 2015 17:39:48 +0100 (CET)", "from wes1-so1.wedos.net (wes1-so1.wedos.net [46.28.106.15])\n\tby dpdk.org (Postfix) with ESMTP id 35A118D9B\n\tfor <dev@dpdk.org>; Mon, 26 Oct 2015 17:39:32 +0100 (CET)", "from pcviktorin.fit.vutbr.cz (pcviktorin.fit.vutbr.cz\n\t[147.229.13.147])\n\tby wes1-so1.wedos.net (Postfix) with ESMTPSA id 3nl21v6t9Mz59J;\n\tMon, 26 Oct 2015 17:39:31 +0100 (CET)" ], "From": "Jan Viktorin <viktorin@rehivetech.com>", "To": "Thomas Monjalon <thomas.monjalon@6wind.com>,\n\tDavid Hunt <david.hunt@intel.com>, dev@dpdk.org", "Date": "Mon, 26 Oct 2015 17:37:37 +0100", "Message-Id": "<1445877458-31052-16-git-send-email-viktorin@rehivetech.com>", "X-Mailer": "git-send-email 2.6.1", "In-Reply-To": "<1445877458-31052-1-git-send-email-viktorin@rehivetech.com>", "References": "<1445877458-31052-1-git-send-email-viktorin@rehivetech.com>", "Cc": "Vlastimil Kosar <kosar@rehivetech.com>", "Subject": "[dpdk-dev] [PATCH v2 15/16] lpm/arm: implement rte_lpm_lookupx4\n\tusing rte_lpm_lookup_bulk on for-x86", "X-BeenThere": "dev@dpdk.org", "X-Mailman-Version": "2.1.15", "Precedence": "list", "List-Id": "patches and discussions about DPDK <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": "From: Vlastimil Kosar <kosar@rehivetech.com>\n\nLPM function rte_lpm_lookupx4() uses i686/x86_64 SIMD intrinsics. Therefore,\nthe function is reimplemented using non-vector operations for non-x86\narchitectures. In the future, each architecture should have vectorized code.\nThis patch includes rudimentary emulation of intrinsic functions _mm_set_epi32(),\n_mm_loadu_si128() and _mm_load_si128() for easy portability of existing\napplications.\n\nLPM builds now when on ARM.\n\nFIXME: to be reworked\n\nSigned-off-by: Vlastimil Kosar <kosar@rehivetech.com>\nSigned-off-by: Jan Viktorin <viktorin@rehivetech.com>\n---\n config/defconfig_arm-armv7-a-linuxapp-gcc | 1 -\n lib/librte_lpm/rte_lpm.h | 71 +++++++++++++++++++++++++++++++\n 2 files changed, 71 insertions(+), 1 deletion(-)", "diff": "diff --git a/config/defconfig_arm-armv7-a-linuxapp-gcc b/config/defconfig_arm-armv7-a-linuxapp-gcc\nindex 5b582a8..33afb33 100644\n--- a/config/defconfig_arm-armv7-a-linuxapp-gcc\n+++ b/config/defconfig_arm-armv7-a-linuxapp-gcc\n@@ -58,7 +58,6 @@ CONFIG_XMM_SIZE=16\n \n # fails to compile on ARM\n CONFIG_RTE_LIBRTE_ACL=n\n-CONFIG_RTE_LIBRTE_LPM=n\n \n # cannot use those on ARM\n CONFIG_RTE_KNI_KMOD=n\ndiff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h\nindex c299ce2..4619992 100644\n--- a/lib/librte_lpm/rte_lpm.h\n+++ b/lib/librte_lpm/rte_lpm.h\n@@ -47,7 +47,9 @@\n #include <rte_byteorder.h>\n #include <rte_memory.h>\n #include <rte_common.h>\n+#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)\n #include <rte_vect.h>\n+#endif\n \n #ifdef __cplusplus\n extern \"C\" {\n@@ -358,6 +360,7 @@ rte_lpm_lookup_bulk_func(const struct rte_lpm *lpm, const uint32_t * ips,\n \treturn 0;\n }\n \n+#if defined(RTE_ARCH_X86_64) || defined(RTE_ARCH_I686)\n /* Mask four results. */\n #define\t RTE_LPM_MASKX4_RES\tUINT64_C(0x00ff00ff00ff00ff)\n \n@@ -472,6 +475,74 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, __m128i ip, uint16_t hop[4],\n \thop[2] = (tbl[2] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)tbl[2] : defv;\n \thop[3] = (tbl[3] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)tbl[3] : defv;\n }\n+#else\n+// TODO: this code should be reworked.\n+\n+typedef struct {\n+\tunion uint128 {\n+\t\tuint8_t uint8[16];\n+\t\tuint32_t uint32[4];\n+\t} val;\n+} __m128i;\n+\n+static inline __m128i\n+_mm_set_epi32(uint32_t v0, uint32_t v1, uint32_t v2, uint32_t v3)\n+{\n+\t__m128i res;\n+\tres.val.uint32[0] = v0;\n+\tres.val.uint32[1] = v1;\n+\tres.val.uint32[2] = v2;\n+\tres.val.uint32[3] = v3;\n+\treturn res;\n+}\n+\n+static inline __m128i\n+_mm_loadu_si128(__m128i * v)\n+{\n+\t__m128i res;\n+\tres = *v;\n+\treturn res;\n+}\n+\n+static inline __m128i\n+_mm_load_si128(__m128i * v)\n+{\n+\t__m128i res;\n+\tres = *v;\n+\treturn res;\n+}\n+\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 succesfull 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(const struct rte_lpm *lpm, __m128i ip, uint16_t hop[4],\n+\tuint16_t defv)\n+{\n+\trte_lpm_lookup_bulk(lpm, ip.val.uint32, hop, 4);\n+\n+\thop[0] = (hop[0] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)hop[0] : defv;\n+\thop[1] = (hop[1] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)hop[1] : defv;\n+\thop[2] = (hop[2] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)hop[2] : defv;\n+\thop[3] = (hop[3] & RTE_LPM_LOOKUP_SUCCESS) ? (uint8_t)hop[3] : defv;\n+}\n+#endif\n \n #ifdef __cplusplus\n }\n", "prefixes": [ "dpdk-dev", "v2", "15/16" ] }{ "id": 8033, "url": "