get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 71246,
    "url": "https://patches.dpdk.org/api/patches/71246/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200611084330.18301-8-qi.z.zhang@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": "<20200611084330.18301-8-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200611084330.18301-8-qi.z.zhang@intel.com",
    "date": "2020-06-11T08:43:27",
    "name": "[07/10] net/ice/base: get tunnel type for recipe",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "b04be1cdbf0d55835681cbfbeb1cf07a4587bfd4",
    "submitter": {
        "id": 504,
        "url": "https://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 31221,
        "url": "https://patches.dpdk.org/api/users/31221/?format=api",
        "username": "yexl",
        "first_name": "xiaolong",
        "last_name": "ye",
        "email": "xiaolong.ye@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20200611084330.18301-8-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 10404,
            "url": "https://patches.dpdk.org/api/series/10404/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=10404",
            "date": "2020-06-11T08:43:20",
            "name": "net/ice: base code update for 20.08 batch 2",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/10404/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/71246/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/71246/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 8C572A00C5;\n\tThu, 11 Jun 2020 10:40:39 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 619D91BEAF;\n\tThu, 11 Jun 2020 10:39:49 +0200 (CEST)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by dpdk.org (Postfix) with ESMTP id 506CE1BEA9\n for <dev@dpdk.org>; Thu, 11 Jun 2020 10:39:47 +0200 (CEST)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 11 Jun 2020 01:39:47 -0700",
            "from dpdk51.sh.intel.com ([10.67.111.82])\n by orsmga004.jf.intel.com with ESMTP; 11 Jun 2020 01:39:45 -0700"
        ],
        "IronPort-SDR": [
            "\n muYlKPdnNGZxlj8vVkLCPHqaUU9LizWMhio52o1a/sdev+MTq4yMj0tPzp2mxgO0oNRsFux66B\n bCmENEfD6APA==",
            "\n /a++pe8GxeINbsP5puJhS38xf00NOTP5HUXKE4+wMMdaMv031JBI5/oWoksd0cRWUMci/5dy9z\n d3lt8LAE4cSA=="
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.73,499,1583222400\"; d=\"scan'208\";a=\"419039190\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "qiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n Wei Zhao <wei.zhao1@intel.com>,\n Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Thu, 11 Jun 2020 16:43:27 +0800",
        "Message-Id": "<20200611084330.18301-8-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20200611084330.18301-1-qi.z.zhang@intel.com>",
        "References": "<20200611084330.18301-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 07/10] net/ice/base: get tunnel type for recipe",
        "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": "This patch add support to get tunnel type of recipe\nafter get recipe from fw. This will fix the issue in\nfunction ice_find_recp() for tunnel type comparing.\n\nSigned-off-by: Wei Zhao <wei.zhao1@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\n---\n drivers/net/ice/base/ice_switch.c | 177 +++++++++++++++++++++++++++++++++++++-\n drivers/net/ice/base/ice_switch.h |   2 +\n 2 files changed, 177 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_switch.c b/drivers/net/ice/base/ice_switch.c\nindex 1b1693dbb..06d8f9c55 100644\n--- a/drivers/net/ice/base/ice_switch.c\n+++ b/drivers/net/ice/base/ice_switch.c\n@@ -1024,6 +1024,179 @@ static void ice_collect_result_idx(struct ice_aqc_recipe_data_elem *buf,\n }\n \n /**\n+ * ice_get_tun_type_for_recipe - get tunnel type for the recipe\n+ * @rid: recipe ID that we are populating\n+ */\n+static enum ice_sw_tunnel_type ice_get_tun_type_for_recipe(u8 rid)\n+{\n+\tu8 vxlan_profile[12] = {10, 11, 12, 16, 17, 18, 22, 23, 24, 25, 26, 27};\n+\tu8 gre_profile[12] = {13, 14, 15, 19, 20, 21, 28, 29, 30, 31, 32, 33};\n+\tu8 pppoe_profile[7] = {34, 35, 36, 37, 38, 39, 40};\n+\tu8 non_tun_profile[6] = {4, 5, 6, 7, 8, 9};\n+\tenum ice_sw_tunnel_type tun_type;\n+\tu16 i, j, profile_num = 0;\n+\tbool non_tun_valid = false;\n+\tbool pppoe_valid = false;\n+\tbool vxlan_valid = false;\n+\tbool gre_valid = false;\n+\tbool gtp_valid = false;\n+\tbool flag_valid = false;\n+\n+\tfor (j = 0; j < ICE_MAX_NUM_PROFILES; j++) {\n+\t\tif (!ice_is_bit_set(recipe_to_profile[rid], j))\n+\t\t\tcontinue;\n+\t\telse\n+\t\t\tprofile_num++;\n+\n+\t\tfor (i = 0; i < 12; i++) {\n+\t\t\tif (gre_profile[i] == j)\n+\t\t\t\tgre_valid = true;\n+\t\t}\n+\n+\t\tfor (i = 0; i < 12; i++) {\n+\t\t\tif (vxlan_profile[i] == j)\n+\t\t\t\tvxlan_valid = true;\n+\t\t}\n+\n+\t\tfor (i = 0; i < 7; i++) {\n+\t\t\tif (pppoe_profile[i] == j)\n+\t\t\t\tpppoe_valid = true;\n+\t\t}\n+\n+\t\tfor (i = 0; i < 6; i++) {\n+\t\t\tif (non_tun_profile[i] == j)\n+\t\t\t\tnon_tun_valid = true;\n+\t\t}\n+\n+\t\tif (j >= ICE_PROFID_IPV4_GTPC_TEID &&\n+\t\t    j <= ICE_PROFID_IPV6_GTPU_IPV6_OTHER)\n+\t\t\tgtp_valid = true;\n+\n+\t\tif (j >= ICE_PROFID_IPV4_ESP &&\n+\t\t    j <= ICE_PROFID_IPV6_PFCP_SESSION)\n+\t\t\tflag_valid = true;\n+\t}\n+\n+\tif (!non_tun_valid && vxlan_valid)\n+\t\ttun_type = ICE_SW_TUN_VXLAN;\n+\telse if (!non_tun_valid && gre_valid)\n+\t\ttun_type = ICE_SW_TUN_NVGRE;\n+\telse if (!non_tun_valid && pppoe_valid)\n+\t\ttun_type = ICE_SW_TUN_PPPOE;\n+\telse if (!non_tun_valid && gtp_valid)\n+\t\ttun_type = ICE_SW_TUN_GTP;\n+\telse if ((non_tun_valid && vxlan_valid) ||\n+\t\t (non_tun_valid && gre_valid) ||\n+\t\t (non_tun_valid && gtp_valid) ||\n+\t\t (non_tun_valid && pppoe_valid))\n+\t\ttun_type = ICE_SW_TUN_AND_NON_TUN;\n+\telse if ((non_tun_valid && !vxlan_valid) ||\n+\t\t (non_tun_valid && !gre_valid) ||\n+\t\t (non_tun_valid && !gtp_valid) ||\n+\t\t (non_tun_valid && !pppoe_valid))\n+\t\ttun_type = ICE_NON_TUN;\n+\n+\tif (profile_num > 1 && tun_type == ICE_SW_TUN_PPPOE) {\n+\t\ti = ice_is_bit_set(recipe_to_profile[rid],\n+\t\t\t\t   ICE_PROFID_PPPOE_IPV4_OTHER);\n+\t\tj = ice_is_bit_set(recipe_to_profile[rid],\n+\t\t\t\t   ICE_PROFID_PPPOE_IPV6_OTHER);\n+\t\tif (i && !j)\n+\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV4;\n+\t\telse if (!i && j)\n+\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV6;\n+\t}\n+\n+\tif (profile_num == 1 && (flag_valid || non_tun_valid)) {\n+\t\tfor (j = 0; j < ICE_MAX_NUM_PROFILES; j++) {\n+\t\t\tif (ice_is_bit_set(recipe_to_profile[rid], j)) {\n+\t\t\t\tswitch (j) {\n+\t\t\t\tcase ICE_PROFID_IPV4_TCP:\n+\t\t\t\t\ttun_type = ICE_SW_IPV4_TCP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_UDP:\n+\t\t\t\t\ttun_type = ICE_SW_IPV4_UDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_TCP:\n+\t\t\t\t\ttun_type = ICE_SW_IPV6_TCP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_UDP:\n+\t\t\t\t\ttun_type = ICE_SW_IPV6_UDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_PAY:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_PAY;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV4_TCP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV4_TCP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV4_UDP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV4_UDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV4_OTHER:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV4;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV6_TCP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV6_TCP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV6_UDP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV4_UDP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_PPPOE_IPV6_OTHER:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_PPPOE_IPV6;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_ESP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV4_ESP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_ESP:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV6_ESP;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_AH:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV4_AH;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_AH:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV6_AH;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_NAT_T:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV4_NAT_T;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_NAT_T:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV6_NAT_T;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_PFCP_NODE:\n+\t\t\t\t\ttun_type =\n+\t\t\t\t\tICE_SW_TUN_PROFID_IPV4_PFCP_NODE;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_PFCP_NODE:\n+\t\t\t\t\ttun_type =\n+\t\t\t\t\tICE_SW_TUN_PROFID_IPV6_PFCP_NODE;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV4_PFCP_SESSION:\n+\t\t\t\t\ttun_type =\n+\t\t\t\t\tICE_SW_TUN_PROFID_IPV4_PFCP_SESSION;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_IPV6_PFCP_SESSION:\n+\t\t\t\t\ttun_type =\n+\t\t\t\t\tICE_SW_TUN_PROFID_IPV6_PFCP_SESSION;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_MAC_IPV4_L2TPV3:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV4_L2TPV3;\n+\t\t\t\t\tbreak;\n+\t\t\t\tcase ICE_PROFID_MAC_IPV6_L2TPV3:\n+\t\t\t\t\ttun_type = ICE_SW_TUN_IPV6_L2TPV3;\n+\t\t\t\t\tbreak;\n+\t\t\t\tdefault:\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n+\n+\t\t\t\treturn tun_type;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn tun_type;\n+}\n+\n+/**\n  * ice_get_recp_frm_fw - update SW bookkeeping from FW recipe entries\n  * @hw: pointer to hardware structure\n  * @recps: struct that we need to populate\n@@ -1166,6 +1339,7 @@ ice_get_recp_frm_fw(struct ice_hw *hw, struct ice_sw_recipe *recps, u8 rid,\n \tlkup_exts->n_val_words = fv_word_idx;\n \trecps[rid].big_recp = (num_recps > 1);\n \trecps[rid].n_grp_count = (u8)num_recps;\n+\trecps[rid].tun_type = ice_get_tun_type_for_recipe(rid);\n \trecps[rid].root_buf = (struct ice_aqc_recipe_data_elem *)\n \t\tice_memdup(hw, tmp, recps[rid].n_grp_count *\n \t\t\t   sizeof(*recps[rid].root_buf), ICE_NONDMA_TO_NONDMA);\n@@ -5548,8 +5722,7 @@ static u16 ice_find_recp(struct ice_hw *hw, struct ice_prot_lkup_ext *lkup_exts,\n \t\t\t/* If for \"i\"th recipe the found was never set to false\n \t\t\t * then it means we found our match\n \t\t\t */\n-\t\t\tif ((tun_type == recp[i].tun_type ||\n-\t\t\t     tun_type == ICE_SW_TUN_AND_NON_TUN) && found)\n+\t\t\tif (tun_type == recp[i].tun_type && found)\n \t\t\t\treturn i; /* Return the recipe ID */\n \t\t}\n \t}\ndiff --git a/drivers/net/ice/base/ice_switch.h b/drivers/net/ice/base/ice_switch.h\nindex 1ba85b16b..cc3d2702e 100644\n--- a/drivers/net/ice/base/ice_switch.h\n+++ b/drivers/net/ice/base/ice_switch.h\n@@ -27,6 +27,8 @@\n #define ICE_PROFID_PPPOE_IPV6_TCP\t38\n #define ICE_PROFID_PPPOE_IPV6_UDP\t39\n #define ICE_PROFID_PPPOE_IPV6_OTHER\t40\n+#define ICE_PROFID_IPV4_GTPC_TEID\t41\n+#define ICE_PROFID_IPV6_GTPU_IPV6_OTHER\t70\n #define ICE_PROFID_IPV4_ESP\t\t71\n #define ICE_PROFID_IPV6_ESP\t\t72\n #define ICE_PROFID_IPV4_AH\t\t73\n",
    "prefixes": [
        "07/10"
    ]
}