get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 29412,
    "url": "https://patches.dpdk.org/api/patches/29412/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1506662342-18966-8-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": "<1506662342-18966-8-git-send-email-beilei.xing@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1506662342-18966-8-git-send-email-beilei.xing@intel.com",
    "date": "2017-09-29T05:19:01",
    "name": "[dpdk-dev,v6,7/8] net/i40e: add cloud filter parsing function for GTP",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "64a824a2283f73f077760240be1650c9ad2939f7",
    "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/1506662342-18966-8-git-send-email-beilei.xing@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/29412/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/29412/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 C73041B1BF;\n\tFri, 29 Sep 2017 07:20:00 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 1D5CC1AEF3\n\tfor <dev@dpdk.org>; Fri, 29 Sep 2017 07:19:51 +0200 (CEST)",
            "from fmsmga002.fm.intel.com ([10.253.24.26])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t28 Sep 2017 22:19:51 -0700",
            "from unknown (HELO dpdk9.sh.intel.com) ([10.67.118.52])\n\tby fmsmga002.fm.intel.com with ESMTP; 28 Sep 2017 22:19:50 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos; i=\"5.42,451,1500966000\"; d=\"scan'208\";\n\ta=\"1225073122\"",
        "From": "Beilei Xing <beilei.xing@intel.com>",
        "To": "jingjing.wu@intel.com",
        "Cc": "andrey.chilikin@intel.com,\n\tdev@dpdk.org",
        "Date": "Fri, 29 Sep 2017 13:19:01 +0800",
        "Message-Id": "<1506662342-18966-8-git-send-email-beilei.xing@intel.com>",
        "X-Mailer": "git-send-email 2.5.5",
        "In-Reply-To": "<1506662342-18966-1-git-send-email-beilei.xing@intel.com>",
        "References": "<1506565054-67690-1-git-send-email-beilei.xing@intel.com>\n\t<1506662342-18966-1-git-send-email-beilei.xing@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 7/8] net/i40e: add cloud filter parsing\n\tfunction for GTP",
        "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 i40e_flow_parse_gtp_filter parsing\nfunction for GTP-C and GTP-U to support cloud filter.\n\nSigned-off-by: Beilei Xing <beilei.xing@intel.com>\n---\n drivers/net/i40e/i40e_ethdev.h |   2 +\n drivers/net/i40e/i40e_flow.c   | 151 +++++++++++++++++++++++++++++++++++++++++\n 2 files changed, 153 insertions(+)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev.h b/drivers/net/i40e/i40e_ethdev.h\nindex 502f6c6..436ca2c 100644\n--- a/drivers/net/i40e/i40e_ethdev.h\n+++ b/drivers/net/i40e/i40e_ethdev.h\n@@ -703,6 +703,8 @@ enum i40e_tunnel_type {\n \tI40E_TUNNEL_TYPE_MPLSoUDP,\n \tI40E_TUNNEL_TYPE_MPLSoGRE,\n \tI40E_TUNNEL_TYPE_QINQ,\n+\tI40E_TUNNEL_TYPE_GTPC,\n+\tI40E_TUNNEL_TYPE_GTPU,\n \tI40E_TUNNEL_TYPE_MAX,\n };\n \ndiff --git a/drivers/net/i40e/i40e_flow.c b/drivers/net/i40e/i40e_flow.c\nindex ea81ecb..2bf7098 100644\n--- a/drivers/net/i40e/i40e_flow.c\n+++ b/drivers/net/i40e/i40e_flow.c\n@@ -125,6 +125,12 @@ static int i40e_flow_parse_mpls_filter(struct rte_eth_dev *dev,\n \t\t\t\t       const struct rte_flow_action actions[],\n \t\t\t\t       struct rte_flow_error *error,\n \t\t\t\t       union i40e_filter_t *filter);\n+static int i40e_flow_parse_gtp_filter(struct rte_eth_dev *dev,\n+\t\t\t\t      const struct rte_flow_attr *attr,\n+\t\t\t\t      const struct rte_flow_item pattern[],\n+\t\t\t\t      const struct rte_flow_action actions[],\n+\t\t\t\t      struct rte_flow_error *error,\n+\t\t\t\t      union i40e_filter_t *filter);\n static int i40e_flow_destroy_ethertype_filter(struct i40e_pf *pf,\n \t\t\t\t      struct i40e_ethertype_filter *filter);\n static int i40e_flow_destroy_tunnel_filter(struct i40e_pf *pf,\n@@ -1808,6 +1814,11 @@ static struct i40e_valid_pattern i40e_supported_patterns[] = {\n \t{ pattern_mpls_2, i40e_flow_parse_mpls_filter },\n \t{ pattern_mpls_3, i40e_flow_parse_mpls_filter },\n \t{ pattern_mpls_4, i40e_flow_parse_mpls_filter },\n+\t/* GTP-C & GTP-U */\n+\t{ pattern_fdir_ipv4_gtpc, i40e_flow_parse_gtp_filter },\n+\t{ pattern_fdir_ipv4_gtpu, i40e_flow_parse_gtp_filter },\n+\t{ pattern_fdir_ipv6_gtpc, i40e_flow_parse_gtp_filter },\n+\t{ pattern_fdir_ipv6_gtpu, i40e_flow_parse_gtp_filter },\n \t/* QINQ */\n \t{ pattern_qinq_1, i40e_flow_parse_qinq_filter },\n };\n@@ -3823,6 +3834,146 @@ i40e_flow_parse_mpls_filter(struct rte_eth_dev *dev,\n }\n \n /* 1. Last in item should be NULL as range is not supported.\n+ * 2. Supported filter types: GTP TEID.\n+ * 3. Mask of fields which need to be matched should be\n+ *    filled with 1.\n+ * 4. Mask of fields which needn't to be matched should be\n+ *    filled with 0.\n+ */\n+static int\n+i40e_flow_parse_gtp_pattern(struct rte_eth_dev *dev,\n+\t\t\t    const struct rte_flow_item *pattern,\n+\t\t\t    struct rte_flow_error *error,\n+\t\t\t    struct i40e_tunnel_filter_conf *filter)\n+{\n+\tstruct i40e_pf *pf = I40E_DEV_PRIVATE_TO_PF(dev->data->dev_private);\n+\tconst struct rte_flow_item *item = pattern;\n+\tconst struct rte_flow_item_gtp *gtp_spec;\n+\tconst struct rte_flow_item_gtp *gtp_mask;\n+\tenum rte_flow_item_type item_type;\n+\n+\tif (!pf->gtp_support) {\n+\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t   item,\n+\t\t\t\t   \"GTP is not supported by default.\");\n+\t\treturn -rte_errno;\n+\t}\n+\n+\tfor (; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n+\t\tif (item->last) {\n+\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t   item,\n+\t\t\t\t\t   \"Not support range\");\n+\t\t\treturn -rte_errno;\n+\t\t}\n+\t\titem_type = item->type;\n+\t\tswitch (item_type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_ETH:\n+\t\t\tif (item->spec || item->mask) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t   \"Invalid ETH item\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_IPV4:\n+\t\t\tfilter->ip_type = I40E_TUNNEL_IPTYPE_IPV4;\n+\t\t\t/* IPv4 is used to describe protocol,\n+\t\t\t * spec and mask should be NULL.\n+\t\t\t */\n+\t\t\tif (item->spec || item->mask) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t   \"Invalid IPv4 item\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_UDP:\n+\t\t\tif (item->spec || item->mask) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t   \"Invalid UDP item\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTPC:\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTPU:\n+\t\t\tgtp_spec =\n+\t\t\t\t(const struct rte_flow_item_gtp *)item->spec;\n+\t\t\tgtp_mask =\n+\t\t\t\t(const struct rte_flow_item_gtp *)item->mask;\n+\n+\t\t\tif (!gtp_spec || !gtp_mask) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t   \"Invalid GTP item\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\n+\t\t\tif (gtp_mask->v_pt_rsv_flags ||\n+\t\t\t    gtp_mask->msg_type ||\n+\t\t\t    gtp_mask->msg_len ||\n+\t\t\t    gtp_mask->teid != UINT32_MAX) {\n+\t\t\t\trte_flow_error_set(error, EINVAL,\n+\t\t\t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n+\t\t\t\t\t\t   item,\n+\t\t\t\t\t\t   \"Invalid GTP mask\");\n+\t\t\t\treturn -rte_errno;\n+\t\t\t}\n+\n+\t\t\tif (item_type == RTE_FLOW_ITEM_TYPE_GTPC)\n+\t\t\t\tfilter->tunnel_type = I40E_TUNNEL_TYPE_GTPC;\n+\t\t\telse if (item_type == RTE_FLOW_ITEM_TYPE_GTPU)\n+\t\t\t\tfilter->tunnel_type = I40E_TUNNEL_TYPE_GTPU;\n+\n+\t\t\tfilter->tenant_id = rte_be_to_cpu_32(gtp_spec->teid);\n+\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\treturn 0;\n+}\n+\n+static int\n+i40e_flow_parse_gtp_filter(struct rte_eth_dev *dev,\n+\t\t\t   const struct rte_flow_attr *attr,\n+\t\t\t   const struct rte_flow_item pattern[],\n+\t\t\t   const struct rte_flow_action actions[],\n+\t\t\t   struct rte_flow_error *error,\n+\t\t\t   union i40e_filter_t *filter)\n+{\n+\tstruct i40e_tunnel_filter_conf *tunnel_filter =\n+\t\t&filter->consistent_tunnel_filter;\n+\tint ret;\n+\n+\tret = i40e_flow_parse_gtp_pattern(dev, pattern,\n+\t\t\t\t\t  error, tunnel_filter);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = i40e_flow_parse_tunnel_action(dev, actions, error, tunnel_filter);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tret = i40e_flow_parse_attr(attr, error);\n+\tif (ret)\n+\t\treturn ret;\n+\n+\tcons_filter_type = RTE_ETH_FILTER_TUNNEL;\n+\n+\treturn ret;\n+}\n+\n+/* 1. Last in item should be NULL as range is not supported.\n  * 2. Supported filter types: QINQ.\n  * 3. Mask of fields which need to be matched should be\n  *    filled with 1.\n",
    "prefixes": [
        "dpdk-dev",
        "v6",
        "7/8"
    ]
}