get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61363,
    "url": "http://patches.dpdk.org/api/patches/61363/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191017161558.59405-1-ting.xu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20191017161558.59405-1-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191017161558.59405-1-ting.xu@intel.com",
    "date": "2019-10-17T16:15:58",
    "name": "[v2] app/testpmd: enable GTP header parse and Tx checksum offload",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "feb0cc05bea6ae5199bc77ca2770d9fafcf4ecb2",
    "submitter": {
        "id": 1363,
        "url": "http://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191017161558.59405-1-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 6900,
            "url": "http://patches.dpdk.org/api/series/6900/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6900",
            "date": "2019-10-17T16:15:58",
            "name": "[v2] app/testpmd: enable GTP header parse and Tx checksum offload",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/6900/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/61363/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/61363/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 [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 608861E8E1;\n\tThu, 17 Oct 2019 11:15:48 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 9F1751E8D5\n\tfor <dev@dpdk.org>; Thu, 17 Oct 2019 11:15:45 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Oct 2019 02:15:30 -0700",
            "from dpdk-xuting-main.sh.intel.com ([10.67.117.83])\n\tby fmsmga002.fm.intel.com with ESMTP; 17 Oct 2019 02:15:28 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.67,307,1566889200\"; d=\"scan'208\";a=\"226095391\"",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com,\n\tqi.z.zhang@intel.com",
        "Date": "Thu, 17 Oct 2019 16:15:58 +0000",
        "Message-Id": "<20191017161558.59405-1-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191017152648.18947-1-ting.xu@intel.com>",
        "References": "<20191017152648.18947-1-ting.xu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2] app/testpmd: enable GTP header parse and Tx\n\tchecksum offload",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch enables testpmd to forward GTP packet in csum fwd mode.\nGTP header structure (without optional fields and extension header)\nand parser function are added. GTPU and GTPC packets are both\nsupported, with respective UDP destination port and GTP message\ntype.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n app/test-pmd/csumonly.c | 109 ++++++++++++++++++++++++++++++++++++----\n 1 file changed, 100 insertions(+), 9 deletions(-)",
    "diff": "diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c\nindex e1cb7fb70..d34116f0b 100644\n--- a/app/test-pmd/csumonly.c\n+++ b/app/test-pmd/csumonly.c\n@@ -179,6 +179,84 @@ parse_ethernet(struct rte_ether_hdr *eth_hdr, struct testpmd_offload_info *info)\n \t}\n }\n \n+/*\n+ * Parse a GTP protocol header.\n+ * No optional fields and next extension header type.\n+ */\n+struct rte_gtp_hdr {\n+\tuint8_t gtp_hdr_info;\n+\tuint8_t msg_type;\n+\tuint16_t msg_len;\n+\tuint32_t teid;\n+} __attribute__((__packed__));\n+\n+/* GTP header length */\n+#define RTE_ETHER_GTP_HLEN \\\n+\t(sizeof(struct rte_udp_hdr) + sizeof(struct rte_gtp_hdr))\n+/* GTP next protocal type */\n+#define RTE_GTP_TYPE_IPV4 0x40\n+#define RTE_GTP_TYPE_IPV6 0x60\n+\n+static void\n+parse_gtp(struct rte_udp_hdr *udp_hdr,\n+\t  struct testpmd_offload_info *info)\n+{\n+\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\tstruct rte_ipv6_hdr *ipv6_hdr;\n+\tstruct rte_gtp_hdr *gtp_hdr;\n+\tuint8_t gtp_len = sizeof(*gtp_hdr);\n+\tuint8_t ip_ver;\n+\t/* GTP destination port number */\n+\tuint16_t gtpc_udp_port = 2123;\n+\tuint16_t gtpu_udp_port = 2152;\n+\n+\t/* Check udp destination port. */\n+\tif (udp_hdr->dst_port != _htons(gtpc_udp_port) &&\n+\t    udp_hdr->src_port != _htons(gtpc_udp_port) &&\n+\t    udp_hdr->dst_port != _htons(gtpu_udp_port))\n+\t\treturn;\n+\n+\tinfo->is_tunnel = 1;\n+\tinfo->outer_ethertype = info->ethertype;\n+\tinfo->outer_l2_len = info->l2_len;\n+\tinfo->outer_l3_len = info->l3_len;\n+\tinfo->outer_l4_proto = info->l4_proto;\n+\tinfo->l2_len = 0;\n+\n+\tgtp_hdr = (struct rte_gtp_hdr *)((char *)udp_hdr +\n+\t\t  sizeof(struct rte_udp_hdr));\n+\n+\t/*\n+\t * Check message type. If message type is 0xff, it is\n+\t * a GTP data packet. If not, it is a GTP control packet\n+\t */\n+\tif (gtp_hdr->msg_type == 0xff) {\n+\t\tip_ver = *(uint8_t *)((char *)udp_hdr +\n+\t\t\t sizeof(struct rte_udp_hdr) +\n+\t\t\t sizeof(struct rte_gtp_hdr));\n+\t\tip_ver = (ip_ver) & 0xf0;\n+\n+\t\tif (ip_ver == RTE_GTP_TYPE_IPV4) {\n+\t\t\tipv4_hdr = (struct rte_ipv4_hdr *)((char *)gtp_hdr +\n+\t\t\t\t   gtp_len);\n+\t\t\tinfo->ethertype = _htons(RTE_ETHER_TYPE_IPV4);\n+\t\t\tparse_ipv4(ipv4_hdr, info);\n+\t\t} else if (ip_ver == RTE_GTP_TYPE_IPV6) {\n+\t\t\tipv6_hdr = (struct rte_ipv6_hdr *)((char *)gtp_hdr +\n+\t\t\t\t   gtp_len);\n+\t\t\tinfo->ethertype = _htons(RTE_ETHER_TYPE_IPV6);\n+\t\t\tparse_ipv6(ipv6_hdr, info);\n+\t\t}\n+\t} else {\n+\t\tinfo->ethertype = 0;\n+\t\tinfo->l4_len = 0;\n+\t\tinfo->l3_len = 0;\n+\t\tinfo->l4_proto = 0;\n+\t}\n+\n+\tinfo->l2_len += RTE_ETHER_GTP_HLEN;\n+}\n+\n /* Parse a vxlan header */\n static void\n parse_vxlan(struct rte_udp_hdr *udp_hdr,\n@@ -478,15 +556,22 @@ process_outer_cksums(void *outer_l3_hdr, struct testpmd_offload_info *info,\n \tif (info->outer_l4_proto != IPPROTO_UDP)\n \t\treturn ol_flags;\n \n+\tudp_hdr = (struct rte_udp_hdr *)\n+\t\t((char *)outer_l3_hdr + info->outer_l3_len);\n+\n \t/* Skip SW outer UDP checksum generation if HW supports it */\n \tif (tx_offloads & DEV_TX_OFFLOAD_OUTER_UDP_CKSUM) {\n+\t\tif (info->outer_ethertype == _htons(RTE_ETHER_TYPE_IPV4))\n+\t\t\tudp_hdr->dgram_cksum\n+\t\t\t\t= rte_ipv4_phdr_cksum(ipv4_hdr, ol_flags);\n+\t\telse\n+\t\t\tudp_hdr->dgram_cksum\n+\t\t\t\t= rte_ipv6_phdr_cksum(ipv6_hdr, ol_flags);\n+\n \t\tol_flags |= PKT_TX_OUTER_UDP_CKSUM;\n \t\treturn ol_flags;\n \t}\n \n-\tudp_hdr = (struct rte_udp_hdr *)\n-\t\t((char *)outer_l3_hdr + info->outer_l3_len);\n-\n \t/* outer UDP checksum is done in software. In the other side, for\n \t * UDP tunneling, like VXLAN or Geneve, outer UDP checksum can be\n \t * set to zero.\n@@ -679,6 +764,7 @@ pkt_copy_split(const struct rte_mbuf *pkt)\n  *           UDP|TCP|SCTP\n  *   Ether / (vlan) / outer IP|IP6 / outer UDP / VXLAN-GPE / IP|IP6 /\n  *           UDP|TCP|SCTP\n+ *   Ether / (vlan) / outer IP / outer UDP / GTP / IP|IP6 / UDP|TCP|SCTP\n  *   Ether / (vlan) / outer IP|IP6 / GRE / Ether / IP|IP6 / UDP|TCP|SCTP\n  *   Ether / (vlan) / outer IP|IP6 / GRE / IP|IP6 / UDP|TCP|SCTP\n  *   Ether / (vlan) / outer IP|IP6 / IP|IP6 / UDP|TCP|SCTP\n@@ -784,18 +870,23 @@ pkt_burst_checksum_forward(struct fwd_stream *fs)\n \t\tif (txp->parse_tunnel) {\n \t\t\tif (info.l4_proto == IPPROTO_UDP) {\n \t\t\t\tstruct rte_udp_hdr *udp_hdr;\n-\n \t\t\t\tudp_hdr = (struct rte_udp_hdr *)\n \t\t\t\t\t((char *)l3_hdr + info.l3_len);\n-\t\t\t\tparse_vxlan_gpe(udp_hdr, &info);\n+\t\t\t\tparse_gtp(udp_hdr, &info);\n \t\t\t\tif (info.is_tunnel) {\n-\t\t\t\t\ttx_ol_flags |= PKT_TX_TUNNEL_VXLAN_GPE;\n+\t\t\t\t\ttx_ol_flags |= PKT_TX_TUNNEL_GTP;\n \t\t\t\t} else {\n-\t\t\t\t\tparse_vxlan(udp_hdr, &info,\n-\t\t\t\t\t\t    m->packet_type);\n-\t\t\t\t\tif (info.is_tunnel)\n+\t\t\t\t\tparse_vxlan_gpe(udp_hdr, &info);\n+\t\t\t\t\tif (info.is_tunnel) {\n \t\t\t\t\t\ttx_ol_flags |=\n+\t\t\t\t\t\t\tPKT_TX_TUNNEL_VXLAN_GPE;\n+\t\t\t\t\t} else {\n+\t\t\t\t\t\tparse_vxlan(udp_hdr, &info,\n+\t\t\t\t\t\t\t    m->packet_type);\n+\t\t\t\t\t\tif (info.is_tunnel)\n+\t\t\t\t\t\t\ttx_ol_flags |=\n \t\t\t\t\t\t\tPKT_TX_TUNNEL_VXLAN;\n+\t\t\t\t\t}\n \t\t\t\t}\n \t\t\t} else if (info.l4_proto == IPPROTO_GRE) {\n \t\t\t\tstruct simple_gre_hdr *gre_hdr;\n",
    "prefixes": [
        "v2"
    ]
}