get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 85442,
    "url": "https://patches.dpdk.org/api/patches/85442/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20201218101210.356836-1-ruifeng.wang@arm.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": "<20201218101210.356836-1-ruifeng.wang@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201218101210.356836-1-ruifeng.wang@arm.com",
    "date": "2020-12-18T10:12:10",
    "name": "[RFC] lpm: add sve support for lookup on Arm platform",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "9efca668c592ff9b9dd8115c1e6b2458e1adcb08",
    "submitter": {
        "id": 1198,
        "url": "https://patches.dpdk.org/api/people/1198/?format=api",
        "name": "Ruifeng Wang",
        "email": "ruifeng.wang@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20201218101210.356836-1-ruifeng.wang@arm.com/mbox/",
    "series": [
        {
            "id": 14364,
            "url": "https://patches.dpdk.org/api/series/14364/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=14364",
            "date": "2020-12-18T10:12:10",
            "name": "[RFC] lpm: add sve support for lookup on Arm platform",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/14364/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/85442/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/85442/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 1E8BCA09F6;\n\tFri, 18 Dec 2020 11:12:49 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 747B1CA5D;\n\tFri, 18 Dec 2020 11:12:47 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id A3C4BCA30\n for <dev@dpdk.org>; Fri, 18 Dec 2020 11:12:44 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 2933730E;\n Fri, 18 Dec 2020 02:12:44 -0800 (PST)",
            "from net-arm-n1amp-01.shanghai.arm.com\n (net-arm-n1amp-01.shanghai.arm.com [10.169.208.218])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 33B713F66E;\n Fri, 18 Dec 2020 02:12:40 -0800 (PST)"
        ],
        "From": "Ruifeng Wang <ruifeng.wang@arm.com>",
        "To": "Jan Viktorin <viktorin@rehivetech.com>,\n Ruifeng Wang <ruifeng.wang@arm.com>, Jerin Jacob <jerinj@marvell.com>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>",
        "Cc": "dev@dpdk.org, hemant.agrawal@nxp.com, honnappa.nagarahalli@arm.com,\n nd@arm.com",
        "Date": "Fri, 18 Dec 2020 10:12:10 +0000",
        "Message-Id": "<20201218101210.356836-1-ruifeng.wang@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [RFC PATCH] lpm: add sve support for lookup on Arm\n\tplatform",
        "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": "Added new path to do lpm4 lookup by using scalable vector extension.\nThe SVE path will be selected if compiler has flag SVE set.\n\nSigned-off-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n lib/librte_eal/arm/include/rte_vect.h |  3 +\n lib/librte_lpm/meson.build            |  2 +-\n lib/librte_lpm/rte_lpm.h              |  4 ++\n lib/librte_lpm/rte_lpm_sve.h          | 83 +++++++++++++++++++++++++++\n 4 files changed, 91 insertions(+), 1 deletion(-)\n create mode 100644 lib/librte_lpm/rte_lpm_sve.h",
    "diff": "diff --git a/lib/librte_eal/arm/include/rte_vect.h b/lib/librte_eal/arm/include/rte_vect.h\nindex a739e6e66..093e9122a 100644\n--- a/lib/librte_eal/arm/include/rte_vect.h\n+++ b/lib/librte_eal/arm/include/rte_vect.h\n@@ -9,6 +9,9 @@\n #include \"generic/rte_vect.h\"\n #include \"rte_debug.h\"\n #include \"arm_neon.h\"\n+#ifdef __ARM_FEATURE_SVE\n+#include <arm_sve.h>\n+#endif\n \n #ifdef __cplusplus\n extern \"C\" {\ndiff --git a/lib/librte_lpm/meson.build b/lib/librte_lpm/meson.build\nindex 6cfc083c5..f93c86640 100644\n--- a/lib/librte_lpm/meson.build\n+++ b/lib/librte_lpm/meson.build\n@@ -5,6 +5,6 @@ sources = files('rte_lpm.c', 'rte_lpm6.c')\n headers = files('rte_lpm.h', 'rte_lpm6.h')\n # since header files have different names, we can install all vector headers\n # without worrying about which architecture we actually need\n-headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h')\n+headers += files('rte_lpm_altivec.h', 'rte_lpm_neon.h', 'rte_lpm_sse.h', 'rte_lpm_sve.h')\n deps += ['hash']\n deps += ['rcu']\ndiff --git a/lib/librte_lpm/rte_lpm.h b/lib/librte_lpm/rte_lpm.h\nindex 1afe55cdc..28b57683b 100644\n--- a/lib/librte_lpm/rte_lpm.h\n+++ b/lib/librte_lpm/rte_lpm.h\n@@ -402,7 +402,11 @@ rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n \tuint32_t defv);\n \n #if defined(RTE_ARCH_ARM)\n+#ifdef __ARM_FEATURE_SVE\n+#include \"rte_lpm_sve.h\"\n+#else\n #include \"rte_lpm_neon.h\"\n+#endif\n #elif defined(RTE_ARCH_PPC_64)\n #include \"rte_lpm_altivec.h\"\n #else\ndiff --git a/lib/librte_lpm/rte_lpm_sve.h b/lib/librte_lpm/rte_lpm_sve.h\nnew file mode 100644\nindex 000000000..86576ec52\n--- /dev/null\n+++ b/lib/librte_lpm/rte_lpm_sve.h\n@@ -0,0 +1,83 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2020 Arm Limited\n+ */\n+\n+#ifndef _RTE_LPM_SVE_H_\n+#define _RTE_LPM_SVE_H_\n+\n+#include <rte_vect.h>\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+__rte_internal\n+static void\n+__rte_lpm_lookup_vec(const struct rte_lpm *lpm, const uint32_t *ips,\n+\t\tuint32_t *__rte_restrict next_hops, const uint32_t n)\n+{\n+\tuint32_t i = 0;\n+\tsvuint32_t v_ip, v_idx, v_tbl24, v_tbl8, v_hop;\n+\tsvuint32_t v_mask_xv, v_mask_v, v_mask_hop;\n+\tsvbool_t pg = svwhilelt_b32(i, n);\n+\tsvbool_t pv;\n+\n+\tdo {\n+\t\tv_ip = svld1(pg, &ips[i]);\n+\t\t/* Get indices for tbl24[] */\n+\t\tv_idx = svlsr_x(pg, v_ip, 8);\n+\t\t/* Extract values from tbl24[] */\n+\t\tv_tbl24 = svld1_gather_index(pg, (const uint32_t *)lpm->tbl24,\n+\t\t\t\t\t\tv_idx);\n+\n+\t\t/* Create mask with valid set */\n+\t\tv_mask_v = svdup_u32_z(pg, RTE_LPM_LOOKUP_SUCCESS);\n+\t\t/* Create mask with valid and valid_group set */\n+\t\tv_mask_xv = svdup_u32_z(pg, RTE_LPM_VALID_EXT_ENTRY_BITMASK);\n+\t\t/* Create predicate for tbl24 entries: (valid && !valid_group) */\n+\t\tpv = svcmpeq(pg, svand_z(pg, v_tbl24, v_mask_xv), v_mask_v);\n+\t\t/* Create mask for next_hop in table entry */\n+\t\tv_mask_hop = svdup_u32_z(pg, 0x00ffffff);\n+\t\t/* Extract next_hop and write back */\n+\t\tv_hop = svand_x(pv, v_tbl24, v_mask_hop);\n+\t\tsvst1(pv, &next_hops[i], v_hop);\n+\n+\t\t/* Update predicate for tbl24 entries: (valid && valid_group) */\n+\t\tpv = svcmpeq(pg, svand_z(pg, v_tbl24, v_mask_xv), v_mask_xv);\n+\t\t/* Compute tbl8 index */\n+\t\tv_idx = svand_x(pv, v_tbl24, svdup_u32_z(pv, 0xff));\n+\t\tv_idx = svmul_x(pv, v_idx, RTE_LPM_TBL8_GROUP_NUM_ENTRIES);\n+\t\tv_idx = svadd_x(pv, svand_x(pv, v_ip, svdup_u32_z(pv, 0xff)),\n+\t\t\t\tv_idx);\n+\t\t/* Extract values from tbl8[] */\n+\t\tv_tbl8 = svld1_gather_index(pv, (const uint32_t *)lpm->tbl8,\n+\t\t\t\t\t\tv_idx);\n+\t\t/* Update predicate for tbl8 entries: (valid) */\n+\t\tpv = svcmpeq(pv, svand_z(pv, v_tbl8, v_mask_v), v_mask_v);\n+\t\t/* Extract next_hop and write back */\n+\t\tv_hop = svand_x(pv, v_tbl8, v_mask_hop);\n+\t\tsvst1(pv, &next_hops[i], v_hop);\n+\n+\t\ti += svlen(v_ip);\n+\t\tpg = svwhilelt_b32(i, n);\n+\t} while (svptest_any(svptrue_b32(), pg));\n+}\n+\n+static inline void\n+rte_lpm_lookupx4(const struct rte_lpm *lpm, xmm_t ip, uint32_t hop[4],\n+\t\tuint32_t defv)\n+{\n+\tuint32_t i, ips[4];\n+\n+\tvst1q_s32((int32_t *)ips, ip);\n+\tfor (i = 0; i < 4; i++)\n+\t\thop[i] = defv;\n+\n+\t__rte_lpm_lookup_vec(lpm, ips, hop, 4);\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_LPM_SVE_H_ */\n",
    "prefixes": [
        "RFC"
    ]
}