get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28436,
    "url": "https://patches.dpdk.org/api/patches/28436/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1504783263-20575-3-git-send-email-beilei.xing@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": "<1504783263-20575-3-git-send-email-beilei.xing@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1504783263-20575-3-git-send-email-beilei.xing@intel.com",
    "date": "2017-09-07T11:20:59",
    "name": "[dpdk-dev,v2,2/6] ethdev: add GTPC and GTPU items",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5af99631b38782bb5dd587e045661d292c1529b6",
    "submitter": {
        "id": 410,
        "url": "https://patches.dpdk.org/api/people/410/?format=api",
        "name": "Xing, Beilei",
        "email": "beilei.xing@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1504783263-20575-3-git-send-email-beilei.xing@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28436/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/28436/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 0F122199BD;\n\tThu,  7 Sep 2017 13:21:07 +0200 (CEST)",
            "from mga05.intel.com (mga05.intel.com [192.55.52.43])\n\tby dpdk.org (Postfix) with ESMTP id 1566D16829\n\tfor <dev@dpdk.org>; Thu,  7 Sep 2017 13:21:02 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n\tby fmsmga105.fm.intel.com with ESMTP; 07 Sep 2017 04:21:02 -0700",
            "from unknown (HELO dpdk9.sh.intel.com) ([10.67.118.52])\n\tby orsmga005.jf.intel.com with ESMTP; 07 Sep 2017 04:21:01 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.42,358,1500966000\"; d=\"scan'208\";a=\"146527065\"",
        "From": "Beilei Xing <beilei.xing@intel.com>",
        "To": "jingjing.wu@intel.com",
        "Cc": "andrey.chilikin@intel.com,\n\tdev@dpdk.org",
        "Date": "Thu,  7 Sep 2017 19:20:59 +0800",
        "Message-Id": "<1504783263-20575-3-git-send-email-beilei.xing@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1504783263-20575-1-git-send-email-beilei.xing@intel.com>",
        "References": "<1503647430-93905-2-git-send-email-beilei.xing@intel.com>\n\t<1504783263-20575-1-git-send-email-beilei.xing@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/6] ethdev: add GTPC and GTPU items",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "This patch adds GTPC and GTPU items to generic rte\nflow, and also exposes the following item fields\nthrough the flow command:\n\n- GTPC TEID\n- GTPU TEID\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n app/test-pmd/cmdline_flow.c                 | 44 +++++++++++++++++++++++++++++\n app/test-pmd/config.c                       |  2 ++\n doc/guides/prog_guide/rte_flow.rst          | 26 +++++++++++++++++\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  8 ++++++\n lib/librte_ether/rte_flow.h                 | 44 +++++++++++++++++++++++++++++\n 5 files changed, 124 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline_flow.c b/app/test-pmd/cmdline_flow.c\nindex a17a004..72d159c 100644\n--- a/app/test-pmd/cmdline_flow.c\n+++ b/app/test-pmd/cmdline_flow.c\n@@ -171,6 +171,10 @@ enum index {\n \tITEM_GRE_PROTO,\n \tITEM_FUZZY,\n \tITEM_FUZZY_THRESH,\n+\tITEM_GTPC,\n+\tITEM_GTPC_TEID,\n+\tITEM_GTPU,\n+\tITEM_GTPU_TEID,\n \n \t/* Validate/create actions. */\n \tACTIONS,\n@@ -451,6 +455,8 @@ static const enum index next_item[] = {\n \tITEM_MPLS,\n \tITEM_GRE,\n \tITEM_FUZZY,\n+\tITEM_GTPC,\n+\tITEM_GTPU,\n \tZERO,\n };\n \n@@ -588,6 +594,18 @@ static const enum index item_gre[] = {\n \tZERO,\n };\n \n+static const enum index item_gtpc[] = {\n+\tITEM_GTPC_TEID,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n+static const enum index item_gtpu[] = {\n+\tITEM_GTPU_TEID,\n+\tITEM_NEXT,\n+\tZERO,\n+};\n+\n static const enum index next_action[] = {\n \tACTION_END,\n \tACTION_VOID,\n@@ -1421,6 +1439,32 @@ static const struct token token_list[] = {\n \t\t.args = ARGS(ARGS_ENTRY(struct rte_flow_item_fuzzy,\n \t\t\t\t\tthresh)),\n \t},\n+\t[ITEM_GTPC] = {\n+\t\t.name = \"gtpc\",\n+\t\t.help = \"match GTP header\",\n+\t\t.priv = PRIV_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)),\n+\t\t.next = NEXT(item_gtpc),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_GTPC_TEID] = {\n+\t\t.name = \"teid\",\n+\t\t.help = \"TUNNEL ENDPOINT IDENTIFIER\",\n+\t\t.next = NEXT(item_gtpc, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp, teid)),\n+\t},\n+\t[ITEM_GTPU] = {\n+\t\t.name = \"gtpu\",\n+\t\t.help = \"match GTP header\",\n+\t\t.priv = PRIV_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)),\n+\t\t.next = NEXT(item_gtpu),\n+\t\t.call = parse_vc,\n+\t},\n+\t[ITEM_GTPU_TEID] = {\n+\t\t.name = \"teid\",\n+\t\t.help = \"TUNNEL ENDPOINT IDENTIFIER\",\n+\t\t.next = NEXT(item_gtpu, NEXT_ENTRY(UNSIGNED), item_param),\n+\t\t.args = ARGS(ARGS_ENTRY_HTON(struct rte_flow_item_gtp, teid)),\n+\t},\n \n \t/* Validate/create actions. */\n \t[ACTIONS] = {\ndiff --git a/app/test-pmd/config.c b/app/test-pmd/config.c\nindex 3ae3e1c..be4c3b9 100644\n--- a/app/test-pmd/config.c\n+++ b/app/test-pmd/config.c\n@@ -947,6 +947,8 @@ static const struct {\n \tMK_FLOW_ITEM(MPLS, sizeof(struct rte_flow_item_mpls)),\n \tMK_FLOW_ITEM(GRE, sizeof(struct rte_flow_item_gre)),\n \tMK_FLOW_ITEM(FUZZY, sizeof(struct rte_flow_item_fuzzy)),\n+\tMK_FLOW_ITEM(GTPC, sizeof(struct rte_flow_item_gtp)),\n+\tMK_FLOW_ITEM(GTPU, sizeof(struct rte_flow_item_gtp)),\n };\n \n /** Compute storage space needed by item specification. */\ndiff --git a/doc/guides/prog_guide/rte_flow.rst b/doc/guides/prog_guide/rte_flow.rst\nindex 662a912..9e7179a 100644\n--- a/doc/guides/prog_guide/rte_flow.rst\n+++ b/doc/guides/prog_guide/rte_flow.rst\n@@ -955,6 +955,32 @@ Usage example, fuzzy match a TCPv4 packets:\n    | 4     | END      |\n    +-------+----------+\n \n+Item: ``GTPC``\n+^^^^^^^^^^^^^^\n+\n+Matches a GTP header.\n+\n+- ``v_pt_rsv_flags``: version (3b), protocol type (1b), reserved (1b),\n+  extension header flag (1b), sequence number flag (1b), N-PDU number\n+  flag (1b).\n+- ``msg_type``: message type.\n+- ``msg_len``: message length.\n+- ``teid``: TEID.\n+- Default ``mask`` matches teid only.\n+\n+Item: ``GTPU``\n+^^^^^^^^^^^^^^\n+\n+Matches a GTP header.\n+\n+- ``v_pt_rsv_flags``: version (3b), protocol type (1b), reserved (1b),\n+  extension header flag (1b), sequence number flag (1b), N-PDU number\n+  flag (1b).\n+- ``msg_type``: message type.\n+- ``msg_len``: message length.\n+- ``teid``: TEID.\n+- Default ``mask`` matches teid only.\n+\n Actions\n ~~~~~~~\n \ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex 2ed62f5..2ca36ad 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -2696,6 +2696,14 @@ This section lists supported pattern items and their attributes, if any.\n \n   - ``thresh {unsigned}``: accuracy threshold.\n \n+- ``gtpc``: match GTP header.\n+\n+  - ``teid {unsigned}``: Tunnel endpoint identifier.\n+\n+- ``gtpu``: match GTP header.\n+\n+  - ``teid {unsigned}``: Tunnel endpoint identifier.\n+\n Actions list\n ^^^^^^^^^^^^\n \ndiff --git a/lib/librte_ether/rte_flow.h b/lib/librte_ether/rte_flow.h\nindex bba6169..8b24cac 100644\n--- a/lib/librte_ether/rte_flow.h\n+++ b/lib/librte_ether/rte_flow.h\n@@ -309,6 +309,24 @@ enum rte_flow_item_type {\n \t * See struct rte_flow_item_fuzzy.\n \t */\n \tRTE_FLOW_ITEM_TYPE_FUZZY,\n+\n+\t/**\n+\t * Matches a GTP header.\n+\t *\n+\t * Configure flow for GTP-C packets.\n+\t *\n+\t * See struct rte_flow_item_gtp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_GTPC,\n+\n+\t/**\n+\t * Matches a GTP header.\n+\t *\n+\t * Configure flow for GTP-U packets.\n+\t *\n+\t * See struct rte_flow_item_gtp.\n+\t */\n+\tRTE_FLOW_ITEM_TYPE_GTPU,\n };\n \n /**\n@@ -735,6 +753,32 @@ static const struct rte_flow_item_fuzzy rte_flow_item_fuzzy_mask = {\n #endif\n \n /**\n+ * RTE_FLOW_ITEM_TYPE_GTP.\n+ *\n+ * Matches a GTP header.\n+ */\n+struct rte_flow_item_gtp {\n+\t/**\n+\t * Version (2b), protocol type (1b), reserved (1b),\n+\t * Extension header flag (1b),\n+\t * Sequence number flag (1b),\n+\t * N-PDU number flag (1b).\n+\t */\n+\tuint8_t v_pt_rsv_flags;\n+\tuint8_t msg_type; /**< Message type. */\n+\trte_be16_t msg_len; /**< Message length. */\n+\trte_be32_t teid; /**< Tunnel endpoint identifier. */\n+};\n+\n+/** Default mask for RTE_FLOW_ITEM_TYPE_GTP. */\n+#ifndef __cplusplus\n+static const struct rte_flow_item_gtp rte_flow_item_gtp_mask = {\n+\t.msg_type = 0x00,\n+\t.teid = RTE_BE32(0xffffffff),\n+};\n+#endif\n+\n+/**\n  * Matching pattern item definition.\n  *\n  * A pattern is formed by stacking items starting from the lowest protocol\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/6"
    ]
}