get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 73368,
    "url": "https://patches.dpdk.org/api/patches/73368/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200707052546.14151-3-jia.guo@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": "<20200707052546.14151-3-jia.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200707052546.14151-3-jia.guo@intel.com",
    "date": "2020-07-07T05:25:44",
    "name": "[v5,2/4] net/ice: support hash for new GTPU protocols",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "90294cf6ba6bec112cb389c92ca6b39bbee678aa",
    "submitter": {
        "id": 507,
        "url": "https://patches.dpdk.org/api/people/507/?format=api",
        "name": "Guo, Jia",
        "email": "jia.guo@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200707052546.14151-3-jia.guo@intel.com/mbox/",
    "series": [
        {
            "id": 10834,
            "url": "https://patches.dpdk.org/api/series/10834/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10834",
            "date": "2020-07-07T05:25:42",
            "name": "enable new hash flow for pf",
            "version": 5,
            "mbox": "https://patches.dpdk.org/series/10834/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/73368/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/73368/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id AC89BA00BE;\n\tTue,  7 Jul 2020 07:26:55 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 632771DA9B;\n\tTue,  7 Jul 2020 07:26:41 +0200 (CEST)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id C73A61DA2B\n for <dev@dpdk.org>; Tue,  7 Jul 2020 07:26:38 +0200 (CEST)",
            "from fmsmga007.fm.intel.com ([10.253.24.52])\n by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 06 Jul 2020 22:26:38 -0700",
            "from npg-dpdk-cvl-jeffguo-01.sh.intel.com ([10.67.111.128])\n by fmsmga007.fm.intel.com with ESMTP; 06 Jul 2020 22:26:36 -0700"
        ],
        "IronPort-SDR": [
            "\n ZAHyo2Wcq8mwc8uvryY60wi8F2MpfJxwlMBTegii+NA2IUNKnWvEns9o4JxOTywCDPpnV8528y\n uHRxAcnOb8Jg==",
            "\n 3uoydiRsgzPtWz/7SlFT5kz2pdf/1gBAhq47nrThBOuqWAg3xWhXUQCfL933KoQAju85AH/gdf\n ovL4kv/zHJQA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9674\"; a=\"145640337\"",
            "E=Sophos;i=\"5.75,321,1589266800\"; d=\"scan'208\";a=\"145640337\"",
            "E=Sophos;i=\"5.75,321,1589266800\"; d=\"scan'208\";a=\"266727847\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Jeff Guo <jia.guo@intel.com>",
        "To": "qi.z.zhang@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "dev@dpdk.org, jingjing.wu@intel.com, junfeng.guo@intel.com,\n beilei.xing@intel.com, simei.su@intel.com, jia.guo@intel.com",
        "Date": "Tue,  7 Jul 2020 13:25:44 +0800",
        "Message-Id": "<20200707052546.14151-3-jia.guo@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20200707052546.14151-1-jia.guo@intel.com>",
        "References": "<20200621140927.20602-2-jia.guo@intel.com>\n <20200707052546.14151-1-jia.guo@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [dpdk-dev v5 2/4] net/ice: support hash for new GTPU\n\tprotocols",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Support hash flow for the new protoclos of GTPU_EH UPLINK, GTPU_EH\nDOWNLINK and GTPU_IP.\n\nSigned-off-by: Jeff Guo <jia.guo@intel.com>\n---\nv5->v4:\nno change\n---\n drivers/net/ice/ice_hash.c | 67 ++++++++++++++++++++++++++++++--------\n 1 file changed, 54 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex c95bfffff..2aacd70ec 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -25,6 +25,9 @@\n #include \"ice_ethdev.h\"\n #include \"ice_generic_flow.h\"\n \n+#define ICE_GTPU_EH_DWNLINK\t0\n+#define ICE_GTPU_EH_UPLINK\t1\n+\n struct rss_type_match_hdr {\n \tuint32_t hdr_mask;\n \tuint64_t eth_rss_hint;\n@@ -93,6 +96,10 @@ struct rss_type_match_hdr hint_eth_ipv4_sctp = {\n \tICE_FLOW_SEG_HDR_IPV4 | ICE_FLOW_SEG_HDR_IPV_OTHER |\n \tICE_FLOW_SEG_HDR_SCTP,\n \tETH_RSS_ETH | ETH_RSS_NONFRAG_IPV4_SCTP};\n+struct rss_type_match_hdr hint_eth_ipv4_gtpu_ipv4 = {\n+\tICE_FLOW_SEG_HDR_GTPU_IP | ICE_FLOW_SEG_HDR_IPV4 |\n+\tICE_FLOW_SEG_HDR_IPV_OTHER,\n+\tETH_RSS_GTPU | ETH_RSS_IPV4};\n struct rss_type_match_hdr hint_eth_ipv4_gtpu_eh_ipv4 = {\n \tICE_FLOW_SEG_HDR_GTPU_EH | ICE_FLOW_SEG_HDR_IPV4 |\n \tICE_FLOW_SEG_HDR_IPV_OTHER,\n@@ -173,6 +180,8 @@ static struct ice_pattern_match_item ice_hash_pattern_list_comms[] = {\n \t\t&hint_eth_ipv4_tcp},\n \t{pattern_eth_ipv4_sctp,\t\t    ICE_INSET_NONE,\n \t\t&hint_eth_ipv4_sctp},\n+\t{pattern_eth_ipv4_gtpu_ipv4,\t    ICE_INSET_NONE,\n+\t\t&hint_eth_ipv4_gtpu_ipv4},\n \t{pattern_eth_ipv4_gtpu_eh_ipv4,\t    ICE_INSET_NONE,\n \t\t&hint_eth_ipv4_gtpu_eh_ipv4},\n \t{pattern_eth_ipv4_gtpu_eh_ipv4_udp, ICE_INSET_NONE,\n@@ -459,10 +468,15 @@ ice_hash_init(struct ice_adapter *ad)\n }\n \n static int\n-ice_hash_check_inset(const struct rte_flow_item pattern[],\n-\t\tstruct rte_flow_error *error)\n+ice_hash_parse_pattern(struct ice_pattern_match_item *pattern_match_item,\n+\t\t       const struct rte_flow_item pattern[], void **meta,\n+\t\t       struct rte_flow_error *error)\n {\n+\tuint32_t hdr_mask = ((struct rss_type_match_hdr *)\n+\t\t(pattern_match_item->meta))->hdr_mask;\n \tconst struct rte_flow_item *item = pattern;\n+\tconst struct rte_flow_item_gtp_psc *psc;\n+\tuint32_t hdrs = 0;\n \n \tfor (item = pattern; item->type != RTE_FLOW_ITEM_TYPE_END; item++) {\n \t\tif (item->last) {\n@@ -472,15 +486,29 @@ ice_hash_check_inset(const struct rte_flow_item pattern[],\n \t\t\treturn -rte_errno;\n \t\t}\n \n-\t\t/* Ignore spec and mask. */\n-\t\tif (item->spec || item->mask) {\n-\t\t\trte_flow_error_set(error, EINVAL,\n-\t\t\t\t\tRTE_FLOW_ERROR_TYPE_ITEM, item,\n-\t\t\t\t\t\"Invalid spec/mask.\");\n-\t\t\treturn -rte_errno;\n+\t\tswitch (item->type) {\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTPU:\n+\t\t\thdrs |= ICE_FLOW_SEG_HDR_GTPU_IP;\n+\t\t\tbreak;\n+\t\tcase RTE_FLOW_ITEM_TYPE_GTP_PSC:\n+\t\t\tpsc = item->spec;\n+\t\t\thdr_mask &= ~ICE_FLOW_SEG_HDR_GTPU_EH;\n+\t\t\thdrs &= ~ICE_FLOW_SEG_HDR_GTPU_IP;\n+\t\t\tif (!psc)\n+\t\t\t\thdrs |= ICE_FLOW_SEG_HDR_GTPU_EH;\n+\t\t\telse if (psc->pdu_type == ICE_GTPU_EH_UPLINK)\n+\t\t\t\thdrs |= ICE_FLOW_SEG_HDR_GTPU_UP;\n+\t\t\telse if (psc->pdu_type == ICE_GTPU_EH_DWNLINK)\n+\t\t\t\thdrs |= ICE_FLOW_SEG_HDR_GTPU_DWN;\n+\t\t\tbreak;\n+\t\tdefault:\n+\t\t\tbreak;\n \t\t}\n \t}\n \n+\t/* Save protocol header to rss_meta. */\n+\t((struct rss_meta *)*meta)->pkt_hdr |= hdr_mask | hdrs;\n+\n \treturn 0;\n }\n \n@@ -574,6 +602,22 @@ ice_hash_parse_action(struct ice_pattern_match_item *pattern_match_item,\n \t\t\t\t}\n \t\t\t}\n \n+\t\t\t/* update hash field for gtpu-ip and gtpu-eh. */\n+\t\t\tif (rss_type != ETH_RSS_GTPU)\n+\t\t\t\tbreak;\n+\t\t\telse if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_IP)\n+\t\t\t\thash_meta->hash_flds |=\n+\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_IP_TEID);\n+\t\t\telse if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_EH)\n+\t\t\t\thash_meta->hash_flds |=\n+\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_EH_TEID);\n+\t\t\telse if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_DWN)\n+\t\t\t\thash_meta->hash_flds |=\n+\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_DWN_TEID);\n+\t\t\telse if (hash_meta->pkt_hdr & ICE_FLOW_SEG_HDR_GTPU_UP)\n+\t\t\t\thash_meta->hash_flds |=\n+\t\t\t\tBIT_ULL(ICE_FLOW_FIELD_IDX_GTPU_UP_TEID);\n+\n \t\t\tbreak;\n \n \t\tcase RTE_FLOW_ACTION_TYPE_END:\n@@ -619,14 +663,11 @@ ice_hash_parse_pattern_action(__rte_unused struct ice_adapter *ad,\n \t\tgoto error;\n \t}\n \n-\tret = ice_hash_check_inset(pattern, error);\n+\tret = ice_hash_parse_pattern(pattern_match_item, pattern,\n+\t\t\t\t     (void **)&rss_meta_ptr, error);\n \tif (ret)\n \t\tgoto error;\n \n-\t/* Save protocol header to rss_meta. */\n-\trss_meta_ptr->pkt_hdr = ((struct rss_type_match_hdr *)\n-\t\t(pattern_match_item->meta))->hdr_mask;\n-\n \t/* Check rss action. */\n \tret = ice_hash_parse_action(pattern_match_item, actions,\n \t\t\t\t    (void **)&rss_meta_ptr, error);\n",
    "prefixes": [
        "v5",
        "2/4"
    ]
}