get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 57946,
    "url": "http://patches.dpdk.org/api/patches/57946/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190826105105.19121-46-qi.z.zhang@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": "<20190826105105.19121-46-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190826105105.19121-46-qi.z.zhang@intel.com",
    "date": "2019-08-26T10:50:47",
    "name": "[45/63] net/ice/base: packet encapsulation for RSS",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c0cada310ac3c6a277532ee878d788f9cf73ebd5",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190826105105.19121-46-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 6119,
            "url": "http://patches.dpdk.org/api/series/6119/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6119",
            "date": "2019-08-26T10:50:02",
            "name": "net/ice/base: update base code",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/6119/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/57946/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/57946/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 282A11C1EC;\n\tMon, 26 Aug 2019 12:51:03 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 774391C10E\n\tfor <dev@dpdk.org>; Mon, 26 Aug 2019 12:49:48 +0200 (CEST)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t26 Aug 2019 03:49:48 -0700",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n\tby orsmga003.jf.intel.com with ESMTP; 26 Aug 2019 03:49:46 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.64,431,1559545200\"; d=\"scan'208\";a=\"182402456\"",
        "From": "Qi Zhang <qi.z.zhang@intel.com>",
        "To": "wenzhuo.lu@intel.com,\n\tqiming.yang@intel.com",
        "Cc": "dev@dpdk.org, xiaolong.ye@intel.com, Qi Zhang <qi.z.zhang@intel.com>,\n\tVignesh Sridhar <vignesh.sridhar@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Mon, 26 Aug 2019 18:50:47 +0800",
        "Message-Id": "<20190826105105.19121-46-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "In-Reply-To": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "References": "<20190826105105.19121-1-qi.z.zhang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 45/63] net/ice/base: packet encapsulation for RSS",
        "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": "RSS configurations calls currently support only non-tunneled packets,\nwhich uses outer-first IPs. Adding another call to configure RSS for\ntunneled packets which will enable hashing on inner-last IP. RSS hash\nwill only be done on the innermost IP.\n- Update RSS configuration calls to take packet segment count as input\n  argument\n- Update flow profile ID to include identifier for encapsulated packet\n  [0:31] : Packet match fields\n  [32:62]: Protocol header header\n  [63]: Encapsulation flag, 0 if non-tunneled, 1 if tunneled\n\nSigned-off-by: Vignesh Sridhar <vignesh.sridhar@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_flow.c | 132 ++++++++++++++++++++++++----------------\n 1 file changed, 80 insertions(+), 52 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_flow.c b/drivers/net/ice/base/ice_flow.c\nindex 9a35a11d5..a49196c1c 100644\n--- a/drivers/net/ice/base/ice_flow.c\n+++ b/drivers/net/ice/base/ice_flow.c\n@@ -379,16 +379,9 @@ struct ice_flow_prof_params {\n static enum ice_status\n ice_flow_val_hdrs(struct ice_flow_seg_info *segs, u8 segs_cnt)\n {\n-\tconst u32 masks = (ICE_FLOW_SEG_HDRS_L2_MASK |\n-\t\t\t   ICE_FLOW_SEG_HDRS_L3_MASK |\n-\t\t\t   ICE_FLOW_SEG_HDRS_L4_MASK);\n \tu8 i;\n \n \tfor (i = 0; i < segs_cnt; i++) {\n-\t\t/* No header specified */\n-\t\tif (!(segs[i].hdrs & masks) || (segs[i].hdrs & ~masks))\n-\t\t\treturn ICE_ERR_PARAM;\n-\n \t\t/* Multiple L3 headers */\n \t\tif (segs[i].hdrs & ICE_FLOW_SEG_HDRS_L3_MASK &&\n \t\t    !ice_is_pow2(segs[i].hdrs & ICE_FLOW_SEG_HDRS_L3_MASK))\n@@ -1866,11 +1859,22 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof)\n #define ICE_FLOW_PROF_HASH_S\t0\n #define ICE_FLOW_PROF_HASH_M\t(0xFFFFFFFFULL << ICE_FLOW_PROF_HASH_S)\n #define ICE_FLOW_PROF_HDR_S\t32\n-#define ICE_FLOW_PROF_HDR_M\t(0xFFFFFFFFULL << ICE_FLOW_PROF_HDR_S)\n+#define ICE_FLOW_PROF_HDR_M\t(0x3FFFFFFFULL << ICE_FLOW_PROF_HDR_S)\n+#define ICE_FLOW_PROF_ENCAP_S\t63\n+#define ICE_FLOW_PROF_ENCAP_M\t(BIT_ULL(ICE_FLOW_PROF_ENCAP_S))\n+\n+#define ICE_RSS_OUTER_HEADERS\t1\n+#define ICE_RSS_INNER_HEADERS\t2\n \n-#define ICE_FLOW_GEN_PROFID(hash, hdr) \\\n+/* Flow profile ID format:\n+ * [0:31] - Packet match fields\n+ * [32:62] - Protocol header\n+ * [63] - Encapsulation flag, 0 if non-tunneled, 1 if tunneled\n+ */\n+#define ICE_FLOW_GEN_PROFID(hash, hdr, segs_cnt) \\\n \t(u64)(((u64)(hash) & ICE_FLOW_PROF_HASH_M) | \\\n-\t      (((u64)(hdr) << ICE_FLOW_PROF_HDR_S) & ICE_FLOW_PROF_HDR_M))\n+\t      (((u64)(hdr) << ICE_FLOW_PROF_HDR_S) & ICE_FLOW_PROF_HDR_M) | \\\n+\t      ((u8)((segs_cnt) - 1) ? ICE_FLOW_PROF_ENCAP_M : 0))\n \n /**\n  * ice_add_rss_cfg_sync - add an RSS configuration\n@@ -1878,24 +1882,30 @@ ice_add_rss_list(struct ice_hw *hw, u16 vsi_handle, struct ice_flow_prof *prof)\n  * @vsi_handle: software VSI handle\n  * @hashed_flds: hash bit fields (ICE_FLOW_HASH_*) to configure\n  * @addl_hdrs: protocol header fields\n+ * @segs_cnt: packet segment count\n  *\n  * Assumption: lock has already been acquired for RSS list\n  */\n static enum ice_status\n ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n-\t\t     u32 addl_hdrs)\n+\t\t     u32 addl_hdrs, u8 segs_cnt)\n {\n \tconst enum ice_block blk = ICE_BLK_RSS;\n \tstruct ice_flow_prof *prof = NULL;\n \tstruct ice_flow_seg_info *segs;\n \tenum ice_status status = ICE_SUCCESS;\n \n-\tsegs = (struct ice_flow_seg_info *)ice_malloc(hw, sizeof(*segs));\n+\tif (!segs_cnt || segs_cnt > ICE_FLOW_SEG_MAX)\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tsegs = (struct ice_flow_seg_info *)ice_calloc(hw, segs_cnt,\n+\t\t\t\t\t\t      sizeof(*segs));\n \tif (!segs)\n \t\treturn ICE_ERR_NO_MEMORY;\n \n \t/* Construct the packet segment info from the hashed fields */\n-\tstatus = ice_flow_set_rss_seg_info(segs, hashed_flds, addl_hdrs);\n+\tstatus = ice_flow_set_rss_seg_info(&segs[segs_cnt - 1], hashed_flds,\n+\t\t\t\t\t   addl_hdrs);\n \tif (status)\n \t\tgoto exit;\n \n@@ -1903,7 +1913,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t * and has the input VSI associated to it. If found, no further\n \t * operations required and exit.\n \t */\n-\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,\n+\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,\n \t\t\t\t\tvsi_handle,\n \t\t\t\t\tICE_FLOW_FIND_PROF_CHK_FLDS |\n \t\t\t\t\tICE_FLOW_FIND_PROF_CHK_VSI);\n@@ -1915,7 +1925,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t * this profile. The VSI will be added to a new profile created with\n \t * the protocol header and new hash field configuration.\n \t */\n-\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,\n+\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,\n \t\t\t\t\tvsi_handle, ICE_FLOW_FIND_PROF_CHK_VSI);\n \tif (prof) {\n \t\tstatus = ice_flow_disassoc_prof(hw, blk, prof, vsi_handle);\n@@ -1935,7 +1945,7 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t/* Search for a profile that has same match fields only. If this\n \t * exists then associate the VSI to this profile.\n \t */\n-\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,\n+\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,\n \t\t\t\t\tvsi_handle,\n \t\t\t\t\tICE_FLOW_FIND_PROF_CHK_FLDS);\n \tif (prof) {\n@@ -1949,8 +1959,10 @@ ice_add_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t * segment information.\n \t */\n \tstatus = ice_flow_add_prof(hw, blk, ICE_FLOW_RX,\n-\t\t\t\t   ICE_FLOW_GEN_PROFID(hashed_flds, segs->hdrs),\n-\t\t\t\t   segs, 1, NULL, 0, &prof);\n+\t\t\t\t   ICE_FLOW_GEN_PROFID(hashed_flds,\n+\t\t\t\t\t\t       segs[segs_cnt - 1].hdrs,\n+\t\t\t\t\t\t       segs_cnt),\n+\t\t\t\t   segs, segs_cnt, NULL, 0, &prof);\n \tif (status)\n \t\tgoto exit;\n \n@@ -1992,7 +2004,11 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \t\treturn ICE_ERR_PARAM;\n \n \tice_acquire_lock(&hw->rss_locks);\n-\tstatus = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs);\n+\tstatus = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,\n+\t\t\t\t      ICE_RSS_OUTER_HEADERS);\n+\tif (!status)\n+\t\tstatus = ice_add_rss_cfg_sync(hw, vsi_handle, hashed_flds,\n+\t\t\t\t\t      addl_hdrs, ICE_RSS_INNER_HEADERS);\n \tice_release_lock(&hw->rss_locks);\n \n \treturn status;\n@@ -2004,12 +2020,13 @@ ice_add_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n  * @vsi_handle: software VSI handle\n  * @hashed_flds: Packet hash types (ICE_FLOW_HASH_*) to remove\n  * @addl_hdrs: Protocol header fields within a packet segment\n+ * @segs_cnt: packet segment count\n  *\n  * Assumption: lock has already been acquired for RSS list\n  */\n static enum ice_status\n ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n-\t\t     u32 addl_hdrs)\n+\t\t     u32 addl_hdrs, u8 segs_cnt)\n {\n \tconst enum ice_block blk = ICE_BLK_RSS;\n \tstruct ice_flow_seg_info *segs;\n@@ -2025,7 +2042,7 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \tif (status)\n \t\tgoto out;\n \n-\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, 1,\n+\tprof = ice_flow_find_prof_conds(hw, blk, ICE_FLOW_RX, segs, segs_cnt,\n \t\t\t\t\tvsi_handle,\n \t\t\t\t\tICE_FLOW_FIND_PROF_CHK_FLDS);\n \tif (!prof) {\n@@ -2050,6 +2067,40 @@ ice_rem_rss_cfg_sync(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n \treturn status;\n }\n \n+/**\n+ * ice_rem_rss_cfg - remove an existing RSS config with matching hashed fields\n+ * @hw: pointer to the hardware structure\n+ * @vsi_handle: software VSI handle\n+ * @hashed_flds: Packet hash types (ICE_FLOW_HASH_*) to remove\n+ * @addl_hdrs: Protocol header fields within a packet segment\n+ *\n+ * This function will lookup the flow profile based on the input\n+ * hash field bitmap, iterate through the profile entry list of\n+ * that profile and find entry associated with input VSI to be\n+ * removed. Calls are made to underlying flow apis which will in\n+ * turn build or update buffers for RSS XLT1 section.\n+ */\n+enum ice_status\n+ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n+\t\tu32 addl_hdrs)\n+{\n+\tenum ice_status status;\n+\n+\tif (hashed_flds == ICE_HASH_INVALID ||\n+\t    !ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn ICE_ERR_PARAM;\n+\n+\tice_acquire_lock(&hw->rss_locks);\n+\tstatus = ice_rem_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs,\n+\t\t\t\t      ICE_RSS_OUTER_HEADERS);\n+\tif (!status)\n+\t\tstatus = ice_rem_rss_cfg_sync(hw, vsi_handle, hashed_flds,\n+\t\t\t\t\t      addl_hdrs, ICE_RSS_INNER_HEADERS);\n+\tice_release_lock(&hw->rss_locks);\n+\n+\treturn status;\n+}\n+\n /* Mapping of AVF hash bit fields to an L3-L4 hash combination.\n  * As the ice_flow_avf_hdr_field represent individual bit shifts in a hash,\n  * convert its values to their appropriate flow L3, L4 values.\n@@ -2179,36 +2230,6 @@ ice_add_avf_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 avf_hash)\n }\n \n /**\n- * ice_rem_rss_cfg - remove an existing RSS config with matching hashed fields\n- * @hw: pointer to the hardware structure\n- * @vsi_handle: software VSI handle\n- * @hashed_flds: Packet hash types (ICE_FLOW_HASH_*) to remove\n- * @addl_hdrs: Protocol header fields within a packet segment\n- *\n- * This function will lookup the flow profile based on the input\n- * hash field bitmap, iterate through the profile entry list of\n- * that profile and find entry associated with input VSI to be\n- * removed. Calls are made to underlying flow apis which will in\n- * turn build or update buffers for RSS XLT1 section.\n- */\n-enum ice_status\n-ice_rem_rss_cfg(struct ice_hw *hw, u16 vsi_handle, u64 hashed_flds,\n-\t\tu32 addl_hdrs)\n-{\n-\tenum ice_status status;\n-\n-\tif (hashed_flds == ICE_HASH_INVALID ||\n-\t    !ice_is_vsi_valid(hw, vsi_handle))\n-\t\treturn ICE_ERR_PARAM;\n-\n-\tice_acquire_lock(&hw->rss_locks);\n-\tstatus = ice_rem_rss_cfg_sync(hw, vsi_handle, hashed_flds, addl_hdrs);\n-\tice_release_lock(&hw->rss_locks);\n-\n-\treturn status;\n-}\n-\n-/**\n  * ice_replay_rss_cfg - replay RSS configurations associated with VSI\n  * @hw: pointer to the hardware structure\n  * @vsi_handle: software VSI handle\n@@ -2227,7 +2248,14 @@ enum ice_status ice_replay_rss_cfg(struct ice_hw *hw, u16 vsi_handle)\n \t\tif (ice_is_bit_set(r->vsis, vsi_handle)) {\n \t\t\tstatus = ice_add_rss_cfg_sync(hw, vsi_handle,\n \t\t\t\t\t\t      r->hashed_flds,\n-\t\t\t\t\t\t      r->packet_hdr);\n+\t\t\t\t\t\t      r->packet_hdr,\n+\t\t\t\t\t\t      ICE_RSS_OUTER_HEADERS);\n+\t\t\tif (status)\n+\t\t\t\tbreak;\n+\t\t\tstatus = ice_add_rss_cfg_sync(hw, vsi_handle,\n+\t\t\t\t\t\t      r->hashed_flds,\n+\t\t\t\t\t\t      r->packet_hdr,\n+\t\t\t\t\t\t      ICE_RSS_INNER_HEADERS);\n \t\t\tif (status)\n \t\t\t\tbreak;\n \t\t}\n",
    "prefixes": [
        "45/63"
    ]
}