get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 62887,
    "url": "http://patches.dpdk.org/api/patches/62887/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191112134557.37344-1-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": "<20191112134557.37344-1-qi.z.zhang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191112134557.37344-1-qi.z.zhang@intel.com",
    "date": "2019-11-12T13:45:57",
    "name": "net/ice/base: fix for TCAM entry management",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "a9e79886aab1d539a7206d106a5e93f119cb437f",
    "submitter": {
        "id": 504,
        "url": "http://patches.dpdk.org/api/people/504/?format=api",
        "name": "Qi Zhang",
        "email": "qi.z.zhang@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/20191112134557.37344-1-qi.z.zhang@intel.com/mbox/",
    "series": [
        {
            "id": 7413,
            "url": "http://patches.dpdk.org/api/series/7413/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7413",
            "date": "2019-11-12T13:45:57",
            "name": "net/ice/base: fix for TCAM entry management",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/7413/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/62887/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/62887/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 A4C61A04C1;\n\tTue, 12 Nov 2019 14:42:57 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 1CF4927D;\n\tTue, 12 Nov 2019 14:42:57 +0100 (CET)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n by dpdk.org (Postfix) with ESMTP id A1DBA237\n for <dev@dpdk.org>; Tue, 12 Nov 2019 14:42:55 +0100 (CET)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 12 Nov 2019 05:42:54 -0800",
            "from dpdk51.sh.intel.com ([10.67.110.245])\n by orsmga001.jf.intel.com with ESMTP; 12 Nov 2019 05:42:53 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.68,296,1569308400\"; d=\"scan'208\";a=\"287549384\"",
        "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 Dan Nowlin <dan.nowlin@intel.com>",
        "Date": "Tue, 12 Nov 2019 21:45:57 +0800",
        "Message-Id": "<20191112134557.37344-1-qi.z.zhang@intel.com>",
        "X-Mailer": "git-send-email 2.13.6",
        "Subject": "[dpdk-dev] [PATCH] net/ice/base: fix for TCAM entry management",
        "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": "Order intermediate VSIG list correct in order to correctly match existing\nVSIG lists.\n\nWhen overriding pre-existing TCAM entries, properly delete the existing\nentry and remove it from the change/update list.\n\nFixes: 51d04e4933e3 (\"net/ice/base: add flexible pipeline module\")\n\nSigned-off-by: Dan Nowlin <dan.nowlin@intel.com>\nSigned-off-by: Qi Zhang <qi.z.zhang@intel.com>\nTested-by: Zhirun Yan <zhirun.yan@intel.com>\n---\n drivers/net/ice/base/ice_flex_pipe.c | 66 ++++++++++++++++++++++++++++--------\n 1 file changed, 52 insertions(+), 14 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c\nindex dd098f529..e8d4bbee4 100644\n--- a/drivers/net/ice/base/ice_flex_pipe.c\n+++ b/drivers/net/ice/base/ice_flex_pipe.c\n@@ -5002,6 +5002,26 @@ static void ice_set_tcam_flags(u16 mask, u8 dc_mask[ICE_TCAM_KEY_VAL_SZ])\n \tflag_word = (u16 *)dc_mask;\n \t*flag_word = ~mask;\n }\n+\n+/**\n+ * ice_rem_chg_tcam_ent - remove a specific tcam entry from change list\n+ * @hw: pointer to the HW struct\n+ * @idx: the index of the tcam entry to remove\n+ * @chg: the list of change structures to search\n+ */\n+static void\n+ice_rem_chg_tcam_ent(struct ice_hw *hw, u16 idx, struct LIST_HEAD_TYPE *chg)\n+{\n+\tstruct ice_chs_chg *pos, *tmp;\n+\n+\tLIST_FOR_EACH_ENTRY_SAFE(tmp, pos, chg, ice_chs_chg, list_entry) {\n+\t\tif (tmp->type == ICE_TCAM_ADD && tmp->tcam_idx == idx) {\n+\t\t\tLIST_DEL(&tmp->list_entry);\n+\t\t\tice_free(hw, tmp);\n+\t\t}\n+\t}\n+}\n+\n /**\n  * ice_prof_tcam_ena_dis - add enable or disable TCAM change\n  * @hw: pointer to the HW struct\n@@ -5021,14 +5041,19 @@ ice_prof_tcam_ena_dis(struct ice_hw *hw, enum ice_block blk, bool enable,\n \tenum ice_status status;\n \tstruct ice_chs_chg *p;\n \n-\t/* Default: enable means change the low flag bit to don't care */\n-\tu8 dc_msk[ICE_TCAM_KEY_VAL_SZ] = { 0x01, 0x00, 0x00, 0x00, 0x00 };\n+\tu8 vl_msk[ICE_TCAM_KEY_VAL_SZ] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };\n+\tu8 dc_msk[ICE_TCAM_KEY_VAL_SZ] = { 0xFF, 0xFF, 0x00, 0x00, 0x00 };\n \tu8 nm_msk[ICE_TCAM_KEY_VAL_SZ] = { 0x00, 0x00, 0x00, 0x00, 0x00 };\n-\tu8 vl_msk[ICE_TCAM_KEY_VAL_SZ] = { 0x01, 0x00, 0x00, 0x00, 0x00 };\n \n \t/* if disabling, free the tcam */\n \tif (!enable) {\n-\t\tstatus = ice_free_tcam_ent(hw, blk, tcam->tcam_idx);\n+\t\tstatus = ice_rel_tcam_idx(hw, blk, tcam->tcam_idx);\n+\n+\t\t/* if we have already created a change for this tcam entry, then\n+\t\t * we need to remove that entry, in order to prevent writing to\n+\t\t * a tcam entry we no longer will have ownership of.\n+\t\t */\n+\t\tice_rem_chg_tcam_ent(hw, tcam->tcam_idx, chg);\n \t\ttcam->tcam_idx = 0;\n \t\ttcam->in_use = 0;\n \t\treturn status;\n@@ -5147,11 +5172,12 @@ ice_adj_prof_priorities(struct ice_hw *hw, enum ice_block blk, u16 vsig,\n  * @blk: hardware block\n  * @vsig: the VSIG to which this profile is to be added\n  * @hdl: the profile handle indicating the profile to add\n+ * @rev: true to reverse the additions to the list\n  * @chg: the change list\n  */\n static enum ice_status\n ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,\n-\t\t     struct LIST_HEAD_TYPE *chg)\n+\t\t     bool rev, struct LIST_HEAD_TYPE *chg)\n {\n \t/* Masks that ignore flags */\n \tu8 vl_msk[ICE_TCAM_KEY_VAL_SZ] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };\n@@ -5160,7 +5186,7 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,\n \tstruct ice_prof_map *map;\n \tstruct ice_vsig_prof *t;\n \tstruct ice_chs_chg *p;\n-\tu16 i;\n+\tu16 vsig_idx, i;\n \n \t/* Get the details on the profile specified by the handle ID */\n \tmap = ice_search_prof_id(hw, blk, hdl);\n@@ -5227,8 +5253,13 @@ ice_add_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsig, u64 hdl,\n \t}\n \n \t/* add profile to VSIG */\n-\tLIST_ADD(&t->list,\n-\t\t &hw->blk[blk].xlt2.vsig_tbl[(vsig & ICE_VSIG_IDX_M)].prop_lst);\n+\tvsig_idx = vsig & ICE_VSIG_IDX_M;\n+\tif (rev)\n+\t\tLIST_ADD_TAIL(&t->list,\n+\t\t\t      &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst);\n+\telse\n+\t\tLIST_ADD(&t->list,\n+\t\t\t &hw->blk[blk].xlt2.vsig_tbl[vsig_idx].prop_lst);\n \n \treturn ICE_SUCCESS;\n \n@@ -5268,7 +5299,7 @@ ice_create_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl,\n \tif (status)\n \t\tgoto err_ice_create_prof_id_vsig;\n \n-\tstatus = ice_add_prof_id_vsig(hw, blk, new_vsig, hdl, chg);\n+\tstatus = ice_add_prof_id_vsig(hw, blk, new_vsig, hdl, false, chg);\n \tif (status)\n \t\tgoto err_ice_create_prof_id_vsig;\n \n@@ -5297,7 +5328,8 @@ ice_create_prof_id_vsig(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl,\n  */\n static enum ice_status\n ice_create_vsig_from_lst(struct ice_hw *hw, enum ice_block blk, u16 vsi,\n-\t\t\t struct LIST_HEAD_TYPE *lst, struct LIST_HEAD_TYPE *chg)\n+\t\t\t struct LIST_HEAD_TYPE *lst, u16 *new_vsig,\n+\t\t\t struct LIST_HEAD_TYPE *chg)\n {\n \tstruct ice_vsig_prof *t;\n \tenum ice_status status;\n@@ -5312,12 +5344,15 @@ ice_create_vsig_from_lst(struct ice_hw *hw, enum ice_block blk, u16 vsi,\n \t\treturn status;\n \n \tLIST_FOR_EACH_ENTRY(t, lst, ice_vsig_prof, list) {\n+\t\t/* Reverse the order here since we are copying the list */\n \t\tstatus = ice_add_prof_id_vsig(hw, blk, vsig, t->profile_cookie,\n-\t\t\t\t\t      chg);\n+\t\t\t\t\t      true, chg);\n \t\tif (status)\n \t\t\treturn status;\n \t}\n \n+\t*new_vsig = vsig;\n+\n \treturn ICE_SUCCESS;\n }\n \n@@ -5481,7 +5516,8 @@ ice_add_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl)\n \t\t\t * not sharing entries and we can simply add the new\n \t\t\t * profile to the VSIG.\n \t\t\t */\n-\t\t\tstatus = ice_add_prof_id_vsig(hw, blk, vsig, hdl, &chg);\n+\t\t\tstatus = ice_add_prof_id_vsig(hw, blk, vsig, hdl, false,\n+\t\t\t\t\t\t      &chg);\n \t\t\tif (status)\n \t\t\t\tgoto err_ice_add_prof_id_flow;\n \n@@ -5492,7 +5528,8 @@ ice_add_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl)\n \t\t} else {\n \t\t\t/* No match, so we need a new VSIG */\n \t\t\tstatus = ice_create_vsig_from_lst(hw, blk, vsi,\n-\t\t\t\t\t\t\t  &union_lst, &chg);\n+\t\t\t\t\t\t\t  &union_lst, &vsig,\n+\t\t\t\t\t\t\t  &chg);\n \t\t\tif (status)\n \t\t\t\tgoto err_ice_add_prof_id_flow;\n \n@@ -5664,7 +5701,8 @@ ice_rem_prof_id_flow(struct ice_hw *hw, enum ice_block blk, u16 vsi, u64 hdl)\n \t\t\t\t * new VSIG and TCAM entries\n \t\t\t\t */\n \t\t\t\tstatus = ice_create_vsig_from_lst(hw, blk, vsi,\n-\t\t\t\t\t\t\t\t  &copy, &chg);\n+\t\t\t\t\t\t\t\t  &copy, &vsig,\n+\t\t\t\t\t\t\t\t  &chg);\n \t\t\t\tif (status)\n \t\t\t\t\tgoto err_ice_rem_prof_id_flow;\n \n",
    "prefixes": []
}