get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 67546,
    "url": "https://patches.dpdk.org/api/patches/67546/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200331192945.2466880-21-jerinj@marvell.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": "<20200331192945.2466880-21-jerinj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200331192945.2466880-21-jerinj@marvell.com",
    "date": "2020-03-31T19:29:36",
    "name": "[v3,20/29] node: ipv4 lookup for arm64",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b5bb07fa6cd0679a67780eedbc4de523731a6bdc",
    "submitter": {
        "id": 1188,
        "url": "https://patches.dpdk.org/api/people/1188/?format=api",
        "name": "Jerin Jacob Kollanukkaran",
        "email": "jerinj@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200331192945.2466880-21-jerinj@marvell.com/mbox/",
    "series": [
        {
            "id": 9135,
            "url": "https://patches.dpdk.org/api/series/9135/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=9135",
            "date": "2020-03-31T19:29:16",
            "name": "graph: introduce graph subsystem",
            "version": 3,
            "mbox": "https://patches.dpdk.org/series/9135/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/67546/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/67546/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 C8EC5A0562;\n\tTue, 31 Mar 2020 21:33:07 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 997521C247;\n\tTue, 31 Mar 2020 21:30:57 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com\n [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id C5C7D1C1A9\n for <dev@dpdk.org>; Tue, 31 Mar 2020 21:30:54 +0200 (CEST)",
            "from pps.filterd (m0045849.ppops.net [127.0.0.1])\n by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n 02VJTNcb030443; Tue, 31 Mar 2020 12:30:52 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n by mx0a-0016f401.pphosted.com with ESMTP id 304855h77g-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Tue, 31 Mar 2020 12:30:52 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by SC-EXCH02.marvell.com\n (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Tue, 31 Mar 2020 12:30:51 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.2;\n Tue, 31 Mar 2020 12:30:50 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n (10.93.176.81) with Microsoft SMTP Server id 15.0.1497.2 via Frontend\n Transport; Tue, 31 Mar 2020 12:30:49 -0700",
            "from jerin-lab.marvell.com (jerin-lab.marvell.com [10.28.34.14])\n by maili.marvell.com (Postfix) with ESMTP id 9955A3F7040;\n Tue, 31 Mar 2020 12:30:47 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0818;\n bh=nBt79rs1ihZx4VetWTqmBQh/cVZYrGvK2Arcpw9BSSM=;\n b=swT1hc/+4Uex8ejz/Lf4O67Ykf7ispaPsYhqhra1Ex87t8lQx6q44kQgmslJPxLUf8Lt\n WwSJrPGBMmitCC8fYACYW1aloc3Illl9M6hRwWVZj0jpqzI19UC/xndYEjddu3fBufNP\n F5m7Qb27mgGxoGE6SDR6QAFEyMgG1ZP0hDcVE78yXcjVNBgRvrK/xi03rXksWBaO0pXv\n Z4wqHmYBLcsgGCBbR9jup9mBLs8bkgxvVsWqVMDa8zxDAcciG8lquByzGdIxfqa54LjE\n tjHo1Zdb4kgg3a8V2FiVRsDoVFIqTnTdeasvGlMWhzkJPjtNRk1RRUpVvYtd9F5DLwo9 6g==",
        "From": "<jerinj@marvell.com>",
        "To": "Nithin Dabilpuram <ndabilpuram@marvell.com>, Pavan Nikhilesh\n <pbhagavatula@marvell.com>",
        "CC": "<dev@dpdk.org>, <thomas@monjalon.net>, <david.marchand@redhat.com>,\n <mdr@ashroe.eu>, <mattias.ronnblom@ericsson.com>, <kirankumark@marvell.com>",
        "Date": "Wed, 1 Apr 2020 00:59:36 +0530",
        "Message-ID": "<20200331192945.2466880-21-jerinj@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20200331192945.2466880-1-jerinj@marvell.com>",
        "References": "<20200326165644.866053-1-jerinj@marvell.com>\n <20200331192945.2466880-1-jerinj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676\n definitions=2020-03-31_07:2020-03-31,\n 2020-03-31 signatures=0",
        "Subject": "[dpdk-dev]  [PATCH v3 20/29] node: ipv4 lookup for arm64",
        "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": "From: Nithin Dabilpuram <ndabilpuram@marvell.com>\n\nAdd arm64 specific IPv4 lookup process function\nfor ip4_lookup node. This node performs LPM lookup\non every packet received and forwards it to a next\nnode that is identified by lookup result.\n\nSigned-off-by: Nithin Dabilpuram <ndabilpuram@marvell.com>\nSigned-off-by: Kiran Kumar K <kirankumark@marvell.com>\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n lib/librte_node/ip4_lookup.c      |   6 +\n lib/librte_node/ip4_lookup_neon.h | 238 ++++++++++++++++++++++++++++++\n 2 files changed, 244 insertions(+)\n create mode 100644 lib/librte_node/ip4_lookup_neon.h",
    "diff": "diff --git a/lib/librte_node/ip4_lookup.c b/lib/librte_node/ip4_lookup.c\nindex a91d42423..e8732e31b 100644\n--- a/lib/librte_node/ip4_lookup.c\n+++ b/lib/librte_node/ip4_lookup.c\n@@ -28,6 +28,10 @@ struct ip4_lookup_node_main {\n \tstruct rte_lpm *lpm_tbl[RTE_MAX_NUMA_NODES];\n };\n \n+#if defined(RTE_MACHINE_CPUFLAG_NEON)\n+#include \"ip4_lookup_neon.h\"\n+#else\n+\n static uint16_t\n ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,\n \t\t\tvoid **objs, uint16_t nb_objs)\n@@ -101,6 +105,8 @@ ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,\n \treturn nb_objs;\n }\n \n+#endif\n+\n static int\n ip4_lookup_node_init(const struct rte_graph *graph, struct rte_node *node)\n {\ndiff --git a/lib/librte_node/ip4_lookup_neon.h b/lib/librte_node/ip4_lookup_neon.h\nnew file mode 100644\nindex 000000000..0aafe4db2\n--- /dev/null\n+++ b/lib/librte_node/ip4_lookup_neon.h\n@@ -0,0 +1,238 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(C) 2020 Marvell International Ltd.\n+ */\n+\n+#ifndef __INCLUDE_IP4_LOOKUP_NEON_H__\n+#define __INCLUDE_IP4_LOOKUP_NEON_H__\n+\n+/* ARM64 NEON */\n+static uint16_t\n+ip4_lookup_node_process(struct rte_graph *graph, struct rte_node *node,\n+\t\t\tvoid **objs, uint16_t nb_objs)\n+{\n+\tstruct rte_mbuf *mbuf0, *mbuf1, *mbuf2, *mbuf3, **pkts;\n+\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\tvoid **to_next, **from;\n+\tuint16_t last_spec = 0;\n+\trte_edge_t next_index;\n+\tuint16_t n_left_from;\n+\tstruct rte_lpm *lpm;\n+\tuint16_t held = 0;\n+\tuint32_t drop_nh;\n+\trte_xmm_t result;\n+\trte_xmm_t priv01;\n+\trte_xmm_t priv23;\n+\tint32x4_t dip;\n+\tint rc, i;\n+\n+\t/* Speculative next */\n+\tnext_index = RTE_NODE_IP4_LOOKUP_NEXT_REWRITE;\n+\t/* Drop node */\n+\tdrop_nh = ((uint32_t)RTE_NODE_IP4_LOOKUP_NEXT_PKT_DROP) << 16;\n+\n+\t/* Get socket specific LPM from ctx */\n+\tlpm = *((struct rte_lpm **)node->ctx);\n+\n+\tpkts = (struct rte_mbuf **)objs;\n+\tfrom = objs;\n+\tn_left_from = nb_objs;\n+\n+#define OBJS_PER_CLINE (RTE_CACHE_LINE_SIZE / sizeof(void *))\n+\tfor (i = OBJS_PER_CLINE; i < RTE_GRAPH_BURST_SIZE; i += OBJS_PER_CLINE)\n+\t\trte_prefetch0(&objs[i]);\n+\n+\tfor (i = 0; i < 4 && i < n_left_from; i++)\n+\t\trte_prefetch0(rte_pktmbuf_mtod_offset(pkts[i], void *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr)));\n+\n+\t/* Get stream for the speculated next node */\n+\tto_next = rte_node_next_stream_get(graph, node, next_index, nb_objs);\n+\twhile (n_left_from >= 4) {\n+#if RTE_GRAPH_BURST_SIZE > 64\n+\t\t/* Prefetch next-next mbufs */\n+\t\tif (likely(n_left_from > 11)) {\n+\t\t\trte_prefetch0(pkts[8]);\n+\t\t\trte_prefetch0(pkts[9]);\n+\t\t\trte_prefetch0(pkts[10]);\n+\t\t\trte_prefetch0(pkts[11]);\n+\t\t}\n+#endif\n+\t\t/* Prefetch next mbuf data */\n+\t\tif (likely(n_left_from > 7)) {\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod_offset(pkts[4], void *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr)));\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod_offset(pkts[5], void *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr)));\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod_offset(pkts[6], void *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr)));\n+\t\t\trte_prefetch0(rte_pktmbuf_mtod_offset(pkts[7], void *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr)));\n+\t\t}\n+\n+\t\tmbuf0 = pkts[0];\n+\t\tmbuf1 = pkts[1];\n+\t\tmbuf2 = pkts[2];\n+\t\tmbuf3 = pkts[3];\n+\n+\t\tpkts += 4;\n+\t\tn_left_from -= 4;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf0, struct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 0);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv01.u16[1] = ipv4_hdr->time_to_live;\n+\t\tpriv01.u32[1] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf1 */\n+\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf1, struct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 1);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv01.u16[5] = ipv4_hdr->time_to_live;\n+\t\tpriv01.u32[3] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf2 */\n+\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf2, struct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 2);\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv23.u16[1] = ipv4_hdr->time_to_live;\n+\t\tpriv23.u32[1] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Extract DIP of mbuf3 */\n+\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf3, struct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\tdip = vsetq_lane_s32(ipv4_hdr->dst_addr, dip, 3);\n+\n+\t\tdip = vreinterpretq_s32_u8(\n+\t\t\tvrev32q_u8(vreinterpretq_u8_s32(dip)));\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\tpriv23.u16[5] = ipv4_hdr->time_to_live;\n+\t\tpriv23.u32[3] = ipv4_hdr->hdr_checksum;\n+\n+\t\t/* Perform LPM lookup to get NH and next node */\n+\t\trte_lpm_lookupx4(lpm, dip, result.u32, drop_nh);\n+\t\tpriv01.u16[0] = result.u16[0];\n+\t\tpriv01.u16[4] = result.u16[2];\n+\t\tpriv23.u16[0] = result.u16[4];\n+\t\tpriv23.u16[4] = result.u16[6];\n+\n+\t\trte_node_mbuf_priv1(mbuf0)->u = priv01.u64[0];\n+\t\trte_node_mbuf_priv1(mbuf1)->u = priv01.u64[1];\n+\t\trte_node_mbuf_priv1(mbuf2)->u = priv23.u64[0];\n+\t\trte_node_mbuf_priv1(mbuf3)->u = priv23.u64[1];\n+\n+\t\t/* Enqueue four to next node */\n+\t\trte_edge_t fix_spec = ((next_index == result.u16[1]) &&\n+\t\t\t\t       (result.u16[1] == result.u16[3]) &&\n+\t\t\t\t       (result.u16[3] == result.u16[5]) &&\n+\t\t\t\t       (result.u16[5] == result.u16[7]));\n+\n+\t\tif (unlikely(fix_spec == 0)) {\n+\t\t\t/* Copy things successfully speculated till now */\n+\t\t\trte_memcpy(to_next, from, last_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\t/* Next0 */\n+\t\t\tif (next_index == result.u16[1]) {\n+\t\t\t\tto_next[0] = from[0];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node, result.u16[1],\n+\t\t\t\t\t\t    from[0]);\n+\t\t\t}\n+\n+\t\t\t/* Next1 */\n+\t\t\tif (next_index == result.u16[3]) {\n+\t\t\t\tto_next[0] = from[1];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node, result.u16[3],\n+\t\t\t\t\t\t    from[1]);\n+\t\t\t}\n+\n+\t\t\t/* Next2 */\n+\t\t\tif (next_index == result.u16[5]) {\n+\t\t\t\tto_next[0] = from[2];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node, result.u16[5],\n+\t\t\t\t\t\t    from[2]);\n+\t\t\t}\n+\n+\t\t\t/* Next3 */\n+\t\t\tif (next_index == result.u16[7]) {\n+\t\t\t\tto_next[0] = from[3];\n+\t\t\t\tto_next++;\n+\t\t\t\theld++;\n+\t\t\t} else {\n+\t\t\t\trte_node_enqueue_x1(graph, node, result.u16[7],\n+\t\t\t\t\t\t    from[3]);\n+\t\t\t}\n+\n+\t\t\tfrom += 4;\n+\t\t} else {\n+\t\t\tlast_spec += 4;\n+\t\t}\n+\t}\n+\n+\twhile (n_left_from > 0) {\n+\t\tuint32_t next_hop;\n+\t\tuint16_t next0;\n+\n+\t\tmbuf0 = pkts[0];\n+\n+\t\tpkts += 1;\n+\t\tn_left_from -= 1;\n+\n+\t\t/* Extract DIP of mbuf0 */\n+\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf0, struct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\t\t/* Extract cksum, ttl as ipv4 hdr is in cache */\n+\t\trte_node_mbuf_priv1(mbuf0)->cksum = ipv4_hdr->hdr_checksum;\n+\t\trte_node_mbuf_priv1(mbuf0)->ttl = ipv4_hdr->time_to_live;\n+\n+\t\trc = rte_lpm_lookup(lpm, rte_be_to_cpu_32(ipv4_hdr->dst_addr),\n+\t\t\t\t    &next_hop);\n+\t\tnext_hop = (rc == 0) ? next_hop : drop_nh;\n+\n+\t\trte_node_mbuf_priv1(mbuf0)->nh = (uint16_t)next_hop;\n+\t\tnext_hop = next_hop >> 16;\n+\t\tnext0 = (uint16_t)next_hop;\n+\n+\t\tif (unlikely(next_index ^ next0)) {\n+\t\t\t/* Copy things successfully speculated till now */\n+\t\t\trte_memcpy(to_next, from, last_spec * sizeof(from[0]));\n+\t\t\tfrom += last_spec;\n+\t\t\tto_next += last_spec;\n+\t\t\theld += last_spec;\n+\t\t\tlast_spec = 0;\n+\n+\t\t\trte_node_enqueue_x1(graph, node, next0, from[0]);\n+\t\t\tfrom += 1;\n+\t\t} else {\n+\t\t\tlast_spec += 1;\n+\t\t}\n+\t}\n+\n+\t/* !!! Home run !!! */\n+\tif (likely(last_spec == nb_objs)) {\n+\t\trte_node_next_stream_move(graph, node, next_index);\n+\t\treturn nb_objs;\n+\t}\n+\theld += last_spec;\n+\trte_memcpy(to_next, from, last_spec * sizeof(from[0]));\n+\trte_node_next_stream_put(graph, node, next_index, held);\n+\n+\treturn nb_objs;\n+}\n+\n+#endif /* __INCLUDE_IP4_LOOKUP_NEON_H__ */\n",
    "prefixes": [
        "v3",
        "20/29"
    ]
}