get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6037,
    "url": "https://patches.dpdk.org/api/patches/6037/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1435912347-19499-12-git-send-email-helin.zhang@intel.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": "<1435912347-19499-12-git-send-email-helin.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1435912347-19499-12-git-send-email-helin.zhang@intel.com",
    "date": "2015-07-03T08:32:19",
    "name": "[dpdk-dev,v9,11/19] app/testpmd: replace bit mask based packet type with unified packet type",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8de139c929dac41329e1c4dac1a376e075866d01",
    "submitter": {
        "id": 14,
        "url": "https://patches.dpdk.org/api/people/14/?format=api",
        "name": "Zhang, Helin",
        "email": "helin.zhang@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1435912347-19499-12-git-send-email-helin.zhang@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6037/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6037/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 B75FA5A53;\n\tFri,  3 Jul 2015 10:33:11 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 761EF6849\n\tfor <dev@dpdk.org>; Fri,  3 Jul 2015 10:33:08 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby fmsmga103.fm.intel.com with ESMTP; 03 Jul 2015 01:33:09 -0700",
            "from shvmail01.sh.intel.com ([10.239.29.42])\n\tby orsmga003.jf.intel.com with ESMTP; 03 Jul 2015 01:33:07 -0700",
            "from shecgisg004.sh.intel.com (shecgisg004.sh.intel.com\n\t[10.239.29.89])\n\tby shvmail01.sh.intel.com with ESMTP id t638X4si029913;\n\tFri, 3 Jul 2015 16:33:04 +0800",
            "from shecgisg004.sh.intel.com (localhost [127.0.0.1])\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/SuSE Linux 0.8) with ESMTP\n\tid t638X0V0019611; Fri, 3 Jul 2015 16:33:02 +0800",
            "(from hzhan75@localhost)\n\tby shecgisg004.sh.intel.com (8.13.6/8.13.6/Submit) id t638X0Jb019607; \n\tFri, 3 Jul 2015 16:33:00 +0800"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.15,398,1432623600\"; d=\"scan'208\";a=\"599478468\"",
        "From": "Helin Zhang <helin.zhang@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  3 Jul 2015 16:32:19 +0800",
        "Message-Id": "<1435912347-19499-12-git-send-email-helin.zhang@intel.com>",
        "X-Mailer": "git-send-email 1.7.4.1",
        "In-Reply-To": "<1435912347-19499-1-git-send-email-helin.zhang@intel.com>",
        "References": "<1435024235-19483-1-git-send-email-helin.zhang@intel.com>\n\t<1435912347-19499-1-git-send-email-helin.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v9 11/19] app/testpmd: replace bit mask based\n\tpacket type with unified packet type",
        "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": "To unify packet types among all PMDs, bit masks of packet type for\n'ol_flags' are replaced by unified packet type.\nTo avoid breaking ABI compatibility, all the changes would be\nenabled by RTE_NEXT_ABI, which is disabled by default.\n\nSigned-off-by: Helin Zhang <helin.zhang@intel.com>\nSigned-off-by: Jijiang Liu <jijiang.liu@intel.com>\n---\n app/test-pmd/csumonly.c |  14 ++++\n app/test-pmd/rxonly.c   | 183 ++++++++++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 197 insertions(+)\n\nv2 changes:\n* Used redefined packet types and enlarged packet_type field in mbuf.\n\nv4 changes:\n* Added printing logs of packet types of each received packet in rxonly mode.\n\nv5 changes:\n* Re-worded the commit logs.\n\nv6 changes:\n* Disabled the code changes for unified packet type by default, to\n  avoid breaking ABI compatibility.\n\nv7 changes:\n* Renamed RTE_UNIFIED_PKT_TYPE to RTE_NEXT_ABI.\n\nv9 changes:\n* Renamed MAC to ETHER in packet type names.",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex 4287940..1bf3485 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -202,8 +202,14 @@ parse_ethernet(struct ether_hdr *eth_hdr, struct testpmd_offload_info *info)\n \n /* Parse a vxlan header */\n static void\n+#ifdef RTE_NEXT_ABI\n+parse_vxlan(struct udp_hdr *udp_hdr,\n+\t    struct testpmd_offload_info *info,\n+\t    uint32_t pkt_type)\n+#else\n parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info,\n \tuint64_t mbuf_olflags)\n+#endif\n {\n \tstruct ether_hdr *eth_hdr;\n \n@@ -211,8 +217,12 @@ parse_vxlan(struct udp_hdr *udp_hdr, struct testpmd_offload_info *info,\n \t * (rfc7348) or that the rx offload flag is set (i40e only\n \t * currently) */\n \tif (udp_hdr->dst_port != _htons(4789) &&\n+#ifdef RTE_NEXT_ABI\n+\t\tRTE_ETH_IS_TUNNEL_PKT(pkt_type) == 0)\n+#else\n \t\t(mbuf_olflags & (PKT_RX_TUNNEL_IPV4_HDR |\n \t\t\tPKT_RX_TUNNEL_IPV6_HDR)) == 0)\n+#endif\n \t\treturn;\n \n \tinfo->is_tunnel = 1;\n@@ -549,7 +559,11 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\t\t\tstruct udp_hdr *udp_hdr;\n \t\t\t\tudp_hdr = (struct udp_hdr *)((char *)l3_hdr +\n \t\t\t\t\tinfo.l3_len);\n+#ifdef RTE_NEXT_ABI\n+\t\t\t\tparse_vxlan(udp_hdr, &info, m->packet_type);\n+#else\n \t\t\t\tparse_vxlan(udp_hdr, &info, m->ol_flags);\n+#endif\n \t\t\t} else if (info.l4_proto == IPPROTO_GRE) {\n \t\t\t\tstruct simple_gre_hdr *gre_hdr;\n \t\t\t\tgre_hdr = (struct simple_gre_hdr *)\ndiff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c\nindex 4a9f86e..632056d 100644\n--- a/app/test-pmd/rxonly.c\n+++ b/app/test-pmd/rxonly.c\n@@ -91,7 +91,11 @@ pkt_burst_receive(struct fwd_stream *fs)\n \tuint64_t ol_flags;\n \tuint16_t nb_rx;\n \tuint16_t i, packet_type;\n+#ifdef RTE_NEXT_ABI\n+\tuint16_t is_encapsulation;\n+#else\n \tuint64_t is_encapsulation;\n+#endif\n \n #ifdef RTE_TEST_PMD_RECORD_CORE_CYCLES\n \tuint64_t start_tsc;\n@@ -135,8 +139,12 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t\tol_flags = mb->ol_flags;\n \t\tpacket_type = mb->packet_type;\n \n+#ifdef RTE_NEXT_ABI\n+\t\tis_encapsulation = RTE_ETH_IS_TUNNEL_PKT(packet_type);\n+#else\n \t\tis_encapsulation = ol_flags & (PKT_RX_TUNNEL_IPV4_HDR |\n \t\t\t\tPKT_RX_TUNNEL_IPV6_HDR);\n+#endif\n \n \t\tprint_ether_addr(\"  src=\", &eth_hdr->s_addr);\n \t\tprint_ether_addr(\" - dst=\", &eth_hdr->d_addr);\n@@ -163,6 +171,177 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t\tif (ol_flags & PKT_RX_QINQ_PKT)\n \t\t\tprintf(\" - QinQ VLAN tci=0x%x, VLAN tci outer=0x%x\",\n \t\t\t\t\tmb->vlan_tci, mb->vlan_tci_outer);\n+#ifdef RTE_NEXT_ABI\n+\t\tif (mb->packet_type) {\n+\t\t\tuint32_t ptype;\n+\n+\t\t\t/* (outer) L2 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_L2_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_L2_ETHER:\n+\t\t\t\tprintf(\" - (outer) L2 type: ETHER\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L2_ETHER_TIMESYNC:\n+\t\t\t\tprintf(\" - (outer) L2 type: ETHER_Timesync\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L2_ETHER_ARP:\n+\t\t\t\tprintf(\" - (outer) L2 type: ETHER_ARP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L2_ETHER_LLDP:\n+\t\t\t\tprintf(\" - (outer) L2 type: ETHER_LLDP\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - (outer) L2 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* (outer) L3 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_L3_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_L3_IPV4:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV4\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L3_IPV4_EXT:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV4_EXT\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L3_IPV6:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV6\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L3_IPV4_EXT_UNKNOWN:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV4_EXT_UNKNOWN\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L3_IPV6_EXT:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV6_EXT\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L3_IPV6_EXT_UNKNOWN:\n+\t\t\t\tprintf(\" - (outer) L3 type: IPV6_EXT_UNKNOWN\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - (outer) L3 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* (outer) L4 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_L4_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_L4_TCP:\n+\t\t\t\tprintf(\" - (outer) L4 type: TCP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L4_UDP:\n+\t\t\t\tprintf(\" - (outer) L4 type: UDP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L4_FRAG:\n+\t\t\t\tprintf(\" - (outer) L4 type: L4_FRAG\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L4_SCTP:\n+\t\t\t\tprintf(\" - (outer) L4 type: SCTP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L4_ICMP:\n+\t\t\t\tprintf(\" - (outer) L4 type: ICMP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_L4_NONFRAG:\n+\t\t\t\tprintf(\" - (outer) L4 type: L4_NONFRAG\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - (outer) L4 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* packet tunnel type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_TUNNEL_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_TUNNEL_IP:\n+\t\t\t\tprintf(\" - Tunnel type: IP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_TUNNEL_GRE:\n+\t\t\t\tprintf(\" - Tunnel type: GRE\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_TUNNEL_VXLAN:\n+\t\t\t\tprintf(\" - Tunnel type: VXLAN\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_TUNNEL_NVGRE:\n+\t\t\t\tprintf(\" - Tunnel type: NVGRE\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_TUNNEL_GENEVE:\n+\t\t\t\tprintf(\" - Tunnel type: GENEVE\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_TUNNEL_GRENAT:\n+\t\t\t\tprintf(\" - Tunnel type: GRENAT\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - Tunnel type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* inner L2 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_INNER_L2_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_INNER_L2_ETHER:\n+\t\t\t\tprintf(\" - Inner L2 type: ETHER\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L2_ETHER_VLAN:\n+\t\t\t\tprintf(\" - Inner L2 type: ETHER_VLAN\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - Inner L2 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* inner L3 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_INNER_INNER_L3_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV4:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV4\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV4_EXT:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV4_EXT\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV6:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV6\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV4_EXT_UNKNOWN:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV4_EXT_UNKNOWN\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV6_EXT:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV6_EXT\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L3_IPV6_EXT_UNKNOWN:\n+\t\t\t\tprintf(\" - Inner L3 type: IPV6_EXT_UNKOWN\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - Inner L3 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\n+\t\t\t/* inner L4 packet type */\n+\t\t\tptype = mb->packet_type & RTE_PTYPE_INNER_L4_MASK;\n+\t\t\tswitch (ptype) {\n+\t\t\tcase RTE_PTYPE_INNER_L4_TCP:\n+\t\t\t\tprintf(\" - Inner L4 type: TCP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L4_UDP:\n+\t\t\t\tprintf(\" - Inner L4 type: UDP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L4_FRAG:\n+\t\t\t\tprintf(\" - Inner L4 type: L4_FRAG\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L4_SCTP:\n+\t\t\t\tprintf(\" - Inner L4 type: SCTP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L4_ICMP:\n+\t\t\t\tprintf(\" - Inner L4 type: ICMP\");\n+\t\t\t\tbreak;\n+\t\t\tcase RTE_PTYPE_INNER_L4_NONFRAG:\n+\t\t\t\tprintf(\" - Inner L4 type: L4_NONFRAG\");\n+\t\t\t\tbreak;\n+\t\t\tdefault:\n+\t\t\t\tprintf(\" - Inner L4 type: Unknown\");\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\tprintf(\"\\n\");\n+\t\t} else\n+\t\t\tprintf(\"Unknown packet type\\n\");\n+#endif /* RTE_NEXT_ABI */\n \t\tif (is_encapsulation) {\n \t\t\tstruct ipv4_hdr *ipv4_hdr;\n \t\t\tstruct ipv6_hdr *ipv6_hdr;\n@@ -176,7 +355,11 @@ pkt_burst_receive(struct fwd_stream *fs)\n \t\t\tl2_len  = sizeof(struct ether_hdr);\n \n \t\t\t /* Do not support ipv4 option field */\n+#ifdef RTE_NEXT_ABI\n+\t\t\tif (RTE_ETH_IS_IPV4_HDR(packet_type)) {\n+#else\n \t\t\tif (ol_flags & PKT_RX_TUNNEL_IPV4_HDR) {\n+#endif\n \t\t\t\tl3_len = sizeof(struct ipv4_hdr);\n \t\t\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mb,\n \t\t\t\t\t\t\t\t   struct ipv4_hdr *,\n",
    "prefixes": [
        "dpdk-dev",
        "v9",
        "11/19"
    ]
}