get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61456,
    "url": "http://patches.dpdk.org/api/patches/61456/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191018111602.26742-10-yahui.cao@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": "<20191018111602.26742-10-yahui.cao@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191018111602.26742-10-yahui.cao@intel.com",
    "date": "2019-10-18T11:16:02",
    "name": "[v7,9/9] net/ice: add FDIR GTPU tunnel support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b11826df17787b9c9fd2737bd6a4998192adeb45",
    "submitter": {
        "id": 1176,
        "url": "http://patches.dpdk.org/api/people/1176/?format=api",
        "name": "Cao, Yahui",
        "email": "yahui.cao@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "http://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191018111602.26742-10-yahui.cao@intel.com/mbox/",
    "series": [
        {
            "id": 6926,
            "url": "http://patches.dpdk.org/api/series/6926/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6926",
            "date": "2019-10-18T11:15:53",
            "name": "net/ice: add ice Flow Director driver",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/6926/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/61456/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/61456/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 49FB31E8CE;\n\tFri, 18 Oct 2019 05:34:08 +0200 (CEST)",
            "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby dpdk.org (Postfix) with ESMTP id 1743C1E557\n\tfor <dev@dpdk.org>; Fri, 18 Oct 2019 05:33:55 +0200 (CEST)",
            "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t17 Oct 2019 20:33:55 -0700",
            "from dpdk-yahui-skylake.sh.intel.com ([10.67.119.16])\n\tby FMSMGA003.fm.intel.com with ESMTP; 17 Oct 2019 20:33:54 -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,310,1566889200\"; d=\"scan'208\";a=\"202577959\"",
        "From": "Yahui Cao <yahui.cao@intel.com>",
        "To": "Qiming Yang <qiming.yang@intel.com>,\n\tWenzhuo Lu <wenzhuo.lu@intel.com>",
        "Cc": "dev@dpdk.org, Qi Zhang <qi.z.zhang@intel.com>,\n\tXiaolong Ye <xiaolong.ye@intel.com>,\n\tBeilei Xing <beilei.xing@intel.com>, Yahui Cao <yahui.cao@intel.com>",
        "Date": "Fri, 18 Oct 2019 19:16:02 +0800",
        "Message-Id": "<20191018111602.26742-10-yahui.cao@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191018111602.26742-1-yahui.cao@intel.com>",
        "References": "<20191017160454.14518-1-yahui.cao@intel.com>\n\t<20191018111602.26742-1-yahui.cao@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 9/9] net/ice: add FDIR GTPU tunnel support",
        "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": "Enable FDIR GTPU matching for RTE_FLOW\n\nSigned-off-by: Yahui Cao <yahui.cao@intel.com>\nAcked-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/ice_ethdev.h      |   4 +\n drivers/net/ice/ice_fdir_filter.c | 147 ++++++++++++++++++++++++++++--\n 2 files changed, 141 insertions(+), 10 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.h b/drivers/net/ice/ice_ethdev.h\nindex d47c5dd93..de67e5934 100644\n--- a/drivers/net/ice/ice_ethdev.h\n+++ b/drivers/net/ice/ice_ethdev.h\n@@ -244,6 +244,7 @@ struct ice_vsi {\n enum ice_fdir_tunnel_type {\n \tICE_FDIR_TUNNEL_TYPE_NONE = 0,\n \tICE_FDIR_TUNNEL_TYPE_VXLAN,\n+\tICE_FDIR_TUNNEL_TYPE_GTPU,\n };\n \n struct rte_flow;\n@@ -272,6 +273,9 @@ struct ice_fdir_fltr_pattern {\n \t\tstruct ice_fdir_v6 v6;\n \t} ip, mask;\n \n+\tstruct ice_fdir_udp_gtp gtpu_data;\n+\tstruct ice_fdir_udp_gtp gtpu_mask;\n+\n \tstruct ice_fdir_extra ext_data;\n \tstruct ice_fdir_extra ext_mask;\n \ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex d18e9245d..80da6ee24 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -62,7 +62,46 @@\n \tICE_FDIR_INSET_VXLAN_IPV4 | \\\n \tICE_INSET_TUN_SCTP_SRC_PORT | ICE_INSET_TUN_SCTP_DST_PORT)\n \n-static struct ice_pattern_match_item ice_fdir_pattern[] = {\n+#define ICE_FDIR_INSET_GTPU_IPV4 (\\\n+\tICE_INSET_GTPU_TEID | ICE_INSET_GTPU_QFI)\n+\n+#define ICE_FDIR_INSET_GTPU_IPV4_TCP (\\\n+\tICE_FDIR_INSET_GTPU_IPV4)\n+\n+#define ICE_FDIR_INSET_GTPU_IPV4_UDP (\\\n+\tICE_FDIR_INSET_GTPU_IPV4)\n+\n+#define ICE_FDIR_INSET_GTPU_IPV4_UDP (\\\n+\tICE_FDIR_INSET_GTPU_IPV4)\n+\n+static struct ice_pattern_match_item ice_fdir_pattern_os[] = {\n+\t{pattern_eth_ipv4,             ICE_FDIR_INSET_ETH_IPV4,              ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp,         ICE_FDIR_INSET_ETH_IPV4_UDP,          ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_tcp,         ICE_FDIR_INSET_ETH_IPV4_TCP,          ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_sctp,        ICE_FDIR_INSET_ETH_IPV4_SCTP,         ICE_INSET_NONE},\n+\t{pattern_eth_ipv6,             ICE_FDIR_INSET_ETH_IPV6,              ICE_INSET_NONE},\n+\t{pattern_eth_ipv6_udp,         ICE_FDIR_INSET_ETH_IPV6_UDP,          ICE_INSET_NONE},\n+\t{pattern_eth_ipv6_tcp,         ICE_FDIR_INSET_ETH_IPV6_TCP,          ICE_INSET_NONE},\n+\t{pattern_eth_ipv6_sctp,        ICE_FDIR_INSET_ETH_IPV6_SCTP,         ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4,            ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_udp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_UDP,        ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_tcp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_TCP,        ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_ipv4_sctp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_SCTP,       ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4,            ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_udp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_UDP,        ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_tcp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_TCP,        ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,\n+\t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_SCTP,       ICE_INSET_NONE},\n+};\n+\n+static struct ice_pattern_match_item ice_fdir_pattern_comms[] = {\n \t{pattern_eth_ipv4,             ICE_FDIR_INSET_ETH_IPV4,              ICE_INSET_NONE},\n \t{pattern_eth_ipv4_udp,         ICE_FDIR_INSET_ETH_IPV4_UDP,          ICE_INSET_NONE},\n \t{pattern_eth_ipv4_tcp,         ICE_FDIR_INSET_ETH_IPV4_TCP,          ICE_INSET_NONE},\n@@ -87,9 +126,15 @@ static struct ice_pattern_match_item ice_fdir_pattern[] = {\n \t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_TCP,        ICE_INSET_NONE},\n \t{pattern_eth_ipv4_udp_vxlan_eth_ipv4_sctp,\n \t\t\t\t       ICE_FDIR_INSET_VXLAN_IPV4_SCTP,       ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_gtpu_ipv4,   ICE_FDIR_INSET_GTPU_IPV4,             ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_gtpu_ipv4_tcp,\n+\t\t\t\t       ICE_FDIR_INSET_GTPU_IPV4,             ICE_INSET_NONE},\n+\t{pattern_eth_ipv4_gtpu_ipv4_udp,\n+\t\t\t\t       ICE_FDIR_INSET_GTPU_IPV4,             ICE_INSET_NONE},\n };\n \n-static struct ice_flow_parser ice_fdir_parser;\n+static struct ice_flow_parser ice_fdir_parser_os;\n+static struct ice_flow_parser ice_fdir_parser_comms;\n \n static const struct rte_memzone *\n ice_memzone_reserve(const char *name, uint32_t len, int socket_id)\n@@ -689,6 +734,8 @@ ice_fdir_input_set_parse(uint64_t inset, enum ice_flow_field *field)\n \t\t{ICE_INSET_TUN_UDP_DST_PORT, ICE_FLOW_FIELD_IDX_UDP_DST_PORT},\n \t\t{ICE_INSET_TUN_SCTP_SRC_PORT, ICE_FLOW_FIELD_IDX_SCTP_SRC_PORT},\n \t\t{ICE_INSET_TUN_SCTP_DST_PORT, ICE_FLOW_FIELD_IDX_SCTP_DST_PORT},\n+\t\t{ICE_INSET_GTPU_TEID, ICE_FLOW_FIELD_IDX_GTPU_EH_TEID},\n+\t\t{ICE_INSET_GTPU_QFI, ICE_FLOW_FIELD_IDX_GTPU_EH_QFI},\n \t};\n \n \tfor (i = 0, j = 0; i < RTE_DIM(ice_inset_map); i++) {\n@@ -752,6 +799,13 @@ ice_fdir_input_set_conf(struct ice_pf *pf, enum ice_fltr_ptype flow,\n \tcase ICE_FLTR_PTYPE_NONF_IPV6_OTHER:\n \t\tICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_IPV6);\n \t\tbreak;\n+\tcase ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_UDP:\n+\tcase ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_TCP:\n+\tcase ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_ICMP:\n+\tcase ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER:\n+\t\tICE_FLOW_SET_HDRS(seg, ICE_FLOW_SEG_HDR_GTPU_EH |\n+\t\t\t\t  ICE_FLOW_SEG_HDR_IPV4);\n+\t\tbreak;\n \tdefault:\n \t\tPMD_DRV_LOG(ERR, \"not supported filter type.\");\n \t\tbreak;\n@@ -811,25 +865,46 @@ static int\n ice_fdir_init(struct ice_adapter *ad)\n {\n \tstruct ice_pf *pf = &ad->pf;\n+\tstruct ice_flow_parser *parser;\n \tint ret;\n \n \tret = ice_fdir_setup(pf);\n \tif (ret)\n \t\treturn ret;\n \n-\treturn ice_register_parser(&ice_fdir_parser, ad);\n+\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n+\t\tparser = &ice_fdir_parser_comms;\n+\telse\n+\t\tparser = &ice_fdir_parser_os;\n+\n+\treturn ice_register_parser(parser, ad);\n }\n \n static void\n ice_fdir_uninit(struct ice_adapter *ad)\n {\n \tstruct ice_pf *pf = &ad->pf;\n+\tstruct ice_flow_parser *parser;\n+\n+\tif (ad->active_pkg_type == ICE_PKG_TYPE_COMMS)\n+\t\tparser = &ice_fdir_parser_comms;\n+\telse\n+\t\tparser = &ice_fdir_parser_os;\n \n-\tice_unregister_parser(&ice_fdir_parser, ad);\n+\tice_unregister_parser(parser, ad);\n \n \tice_fdir_teardown(pf);\n }\n \n+static int\n+ice_fdir_is_tunnel_profile(enum ice_fdir_tunnel_type tunnel_type)\n+{\n+\tif (tunnel_type == ICE_FDIR_TUNNEL_TYPE_VXLAN)\n+\t\treturn 1;\n+\telse\n+\t\treturn 0;\n+}\n+\n static int\n ice_fdir_add_del_filter(struct ice_pf *pf,\n \t\t\tstruct ice_fdir_filter_conf *filter,\n@@ -846,7 +921,7 @@ ice_fdir_add_del_filter(struct ice_pf *pf,\n \tmemset(&desc, 0, sizeof(desc));\n \tice_fdir_get_prgm_desc(hw, &filter->input, &desc, add);\n \n-\tis_tun = filter->tunnel_type ? true : false;\n+\tis_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type);\n \n \tmemset(pkt, 0, ICE_FDIR_PKT_LEN);\n \tret = ice_fdir_get_gen_prgm_pkt(hw, &filter->input, pkt, false, is_tun);\n@@ -871,6 +946,9 @@ ice_fdir_extract_fltr_key(struct ice_fdir_fltr_pattern *key,\n \trte_memcpy(&key->ext_data, &input->ext_data, sizeof(key->ext_data));\n \trte_memcpy(&key->ext_mask, &input->ext_mask, sizeof(key->ext_mask));\n \n+\trte_memcpy(&key->gtpu_data, &input->gtpu_data, sizeof(key->gtpu_data));\n+\trte_memcpy(&key->gtpu_mask, &input->gtpu_mask, sizeof(key->gtpu_mask));\n+\n \tkey->tunnel_type = filter->tunnel_type;\n }\n \n@@ -959,7 +1037,7 @@ ice_fdir_create_filter(struct ice_adapter *ad,\n \t\treturn -rte_errno;\n \t}\n \n-\tis_tun = filter->tunnel_type ? true : false;\n+\tis_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type);\n \n \tret = ice_fdir_input_set_conf(pf, filter->input.flow_type,\n \t\t\tfilter->input_set, is_tun);\n@@ -1033,7 +1111,7 @@ ice_fdir_destroy_filter(struct ice_adapter *ad,\n \n \tfilter = (struct ice_fdir_filter_conf *)flow->rule;\n \n-\tis_tun = filter->tunnel_type ? true : false;\n+\tis_tun = ice_fdir_is_tunnel_profile(filter->tunnel_type);\n \n \tif (filter->counter) {\n \t\tice_fdir_counter_free(pf, filter->counter);\n@@ -1301,6 +1379,8 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \tconst struct rte_flow_item_udp *udp_spec, *udp_mask;\n \tconst struct rte_flow_item_sctp *sctp_spec, *sctp_mask;\n \tconst struct rte_flow_item_vxlan *vxlan_spec, *vxlan_mask;\n+\tconst struct rte_flow_item_gtp *gtp_spec, *gtp_mask;\n+\tconst struct rte_flow_item_gtp_psc *gtp_psc_spec, *gtp_psc_mask;\n \tuint64_t input_set = ICE_INSET_NONE;\n \tuint8_t flow_type = ICE_FLTR_PTYPE_NONF_NONE;\n \tuint8_t  ipv6_addr_mask[16] = {\n@@ -1594,6 +1674,42 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \n \t\t\ttunnel_type = ICE_FDIR_TUNNEL_TYPE_VXLAN;\n \t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTPU:\n+\t\t\tl3 = RTE_FLOW_ITEM_TYPE_END;\n+\t\t\tgtp_spec = item->spec;\n+\t\t\tgtp_mask = item->mask;\n+\n+\t\t\tif (gtp_spec && gtp_mask) {\n+\t\t\t\tif (gtp_mask->v_pt_rsv_flags ||\n+\t\t\t\t    gtp_mask->msg_type ||\n+\t\t\t\t    gtp_mask->msg_len) {\n+\t\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\t\treturn -rte_errno;\n+\t\t\t\t}\n+\n+\t\t\t\tif (gtp_mask->teid == UINT32_MAX)\n+\t\t\t\t\tinput_set |= ICE_INSET_GTPU_TEID;\n+\n+\t\t\t\tfilter->input.gtpu_data.teid = gtp_spec->teid;\n+\t\t\t}\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTP_PSC:\n+\t\t\tgtp_psc_spec = item->spec;\n+\t\t\tgtp_psc_mask = item->mask;\n+\n+\t\t\tif (gtp_psc_spec && gtp_psc_mask) {\n+\t\t\t\tif (gtp_psc_mask->qfi == UINT8_MAX)\n+\t\t\t\t\tinput_set |= ICE_INSET_GTPU_QFI;\n+\n+\t\t\t\tfilter->input.gtpu_data.qfi =\n+\t\t\t\t\tgtp_psc_spec->qfi;\n+\t\t\t}\n+\n+\t\t\ttunnel_type = ICE_FDIR_TUNNEL_TYPE_GTPU;\n+\t\t\tbreak;\n \t\tdefault:\n \t\t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t   RTE_FLOW_ERROR_TYPE_ITEM,\n@@ -1603,6 +1719,9 @@ ice_fdir_parse_pattern(__rte_unused struct ice_adapter *ad,\n \t\t}\n \t}\n \n+\tif (tunnel_type == ICE_FDIR_TUNNEL_TYPE_GTPU)\n+\t\tflow_type = ICE_FLTR_PTYPE_NONF_IPV4_GTPU_IPV4_OTHER;\n+\n \tfilter->tunnel_type = tunnel_type;\n \tfilter->input.flow_type = flow_type;\n \tfilter->input_set = input_set;\n@@ -1651,10 +1770,18 @@ ice_fdir_parse(struct ice_adapter *ad,\n \treturn 0;\n }\n \n-static struct ice_flow_parser ice_fdir_parser = {\n+static struct ice_flow_parser ice_fdir_parser_os = {\n+\t.engine = &ice_fdir_engine,\n+\t.array = ice_fdir_pattern_os,\n+\t.array_len = RTE_DIM(ice_fdir_pattern_os),\n+\t.parse_pattern_action = ice_fdir_parse,\n+\t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n+};\n+\n+static struct ice_flow_parser ice_fdir_parser_comms = {\n \t.engine = &ice_fdir_engine,\n-\t.array = ice_fdir_pattern,\n-\t.array_len = RTE_DIM(ice_fdir_pattern),\n+\t.array = ice_fdir_pattern_comms,\n+\t.array_len = RTE_DIM(ice_fdir_pattern_comms),\n \t.parse_pattern_action = ice_fdir_parse,\n \t.stage = ICE_FLOW_STAGE_DISTRIBUTOR,\n };\n",
    "prefixes": [
        "v7",
        "9/9"
    ]
}