get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/7395/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 7395,
    "url": "https://patches.dpdk.org/api/patches/7395/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/6adb4f88d40f15d87b686ec287f74cb2d57f1e20.1443737626.git.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": "<6adb4f88d40f15d87b686ec287f74cb2d57f1e20.1443737626.git.viktorin@rehivetech.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/6adb4f88d40f15d87b686ec287f74cb2d57f1e20.1443737626.git.viktorin@rehivetech.com",
    "date": "2015-10-03T08:58:17",
    "name": "[dpdk-dev,v1,11/12] 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/6adb4f88d40f15d87b686ec287f74cb2d57f1e20.1443737626.git.viktorin@rehivetech.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/7395/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/7395/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 C075991AB;\n\tSat,  3 Oct 2015 10:59:05 +0200 (CEST)",
            "from we2-f167.wedos.net (w-smtp-out-7.wedos.net [46.28.106.5])\n\tby dpdk.org (Postfix) with ESMTP id 5331D8E79\n\tfor <dev@dpdk.org>; Sat,  3 Oct 2015 10:58:55 +0200 (CEST)",
            "from ([147.229.13.147])\n\tby we2-f167.wedos.net (WEDOS Mail Server mail2) with ASMTP (SSL) id\n\tQWJ00151; Sat, 03 Oct 2015 10:58:51 +0200"
        ],
        "From": "Jan Viktorin <viktorin@rehivetech.com>",
        "To": "dev@dpdk.org",
        "Date": "Sat,  3 Oct 2015 10:58:17 +0200",
        "Message-Id": "<6adb4f88d40f15d87b686ec287f74cb2d57f1e20.1443737626.git.viktorin@rehivetech.com>",
        "X-Mailer": "git-send-email 2.6.0",
        "In-Reply-To": [
            "<cover.1443737626.git.viktorin@rehivetech.com>",
            "<cover.1443737626.git.viktorin@rehivetech.com>"
        ],
        "References": [
            "<cover.1443737626.git.viktorin@rehivetech.com>",
            "<cover.1443737626.git.viktorin@rehivetech.com>"
        ],
        "Cc": "Vlastimil Kosar <kosar@rehivetech.com>,\n\tJan Viktorin <viktorin@rehivetech.com>",
        "Subject": "[dpdk-dev] [PATCH v1 11/12] 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 a466d13..c434429 100644\n--- a/config/defconfig_arm-armv7-a-linuxapp-gcc\n+++ b/config/defconfig_arm-armv7-a-linuxapp-gcc\n@@ -56,7 +56,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 11f0c04..81d23a2 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@@ -369,6 +371,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@@ -483,6 +486,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",
        "v1",
        "11/12"
    ]
}