Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/55001/?format=api
http://patches.dpdk.org/api/patches/55001/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190619151846.113820-15-leyi.rong@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": "<20190619151846.113820-15-leyi.rong@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20190619151846.113820-15-leyi.rong@intel.com", "date": "2019-06-19T15:17:51", "name": "[v3,14/69] net/ice/base: add lock around profile map list", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "60cebe9c3ee5e66ad3ef8612cdb9ca2ac04fcb6e", "submitter": { "id": 1204, "url": "http://patches.dpdk.org/api/people/1204/?format=api", "name": "Leyi Rong", "email": "leyi.rong@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/20190619151846.113820-15-leyi.rong@intel.com/mbox/", "series": [ { "id": 5083, "url": "http://patches.dpdk.org/api/series/5083/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5083", "date": "2019-06-19T15:17:37", "name": "shared code update", "version": 3, "mbox": "http://patches.dpdk.org/series/5083/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/55001/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/55001/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 8CC251C4E3;\n\tWed, 19 Jun 2019 17:20:53 +0200 (CEST)", "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 71F121C34E\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:20:31 +0200 (CEST)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Jun 2019 08:20:31 -0700", "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby orsmga006.jf.intel.com with ESMTP; 19 Jun 2019 08:20:30 -0700" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.63,392,1557212400\"; d=\"scan'208\";a=\"165050256\"", "From": "Leyi Rong <leyi.rong@intel.com>", "To": "qi.z.zhang@intel.com", "Cc": "dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>,\n\tDan Nowlin <dan.nowlin@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>", "Date": "Wed, 19 Jun 2019 23:17:51 +0800", "Message-Id": "<20190619151846.113820-15-leyi.rong@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20190619151846.113820-1-leyi.rong@intel.com>", "References": "<20190611155221.2703-1-leyi.rong@intel.com>\n\t<20190619151846.113820-1-leyi.rong@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 14/69] net/ice/base: add lock around profile\n\tmap list", "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": "Add locking mechanism around profile map list.\n\nSigned-off-by: Dan Nowlin <dan.nowlin@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\n---\n drivers/net/ice/base/ice_flex_pipe.c | 62 +++++++++++++++++++++-------\n drivers/net/ice/base/ice_flex_type.h | 5 ++-\n 2 files changed, 49 insertions(+), 18 deletions(-)", "diff": "diff --git a/drivers/net/ice/base/ice_flex_pipe.c b/drivers/net/ice/base/ice_flex_pipe.c\nindex dd9a6fcb4..eccc9b26c 100644\n--- a/drivers/net/ice/base/ice_flex_pipe.c\n+++ b/drivers/net/ice/base/ice_flex_pipe.c\n@@ -3041,6 +3041,7 @@ void ice_free_hw_tbls(struct ice_hw *hw)\n \t\t\t\tice_free(hw, del);\n \t\t\t}\n \n+\t\t\tice_destroy_lock(&es->prof_map_lock);\n \t\t\tice_free_flow_profs(hw, i);\n \t\t\tice_destroy_lock(&hw->fl_profs_locks[i]);\n \t\t\thw->blk[i].is_list_init = false;\n@@ -3101,6 +3102,7 @@ enum ice_status ice_init_hw_tbls(struct ice_hw *hw)\n \t\t\tcontinue;\n \n \t\tice_init_flow_profs(hw, i);\n+\t\tice_init_lock(&es->prof_map_lock);\n \t\tINIT_LIST_HEAD(&es->prof_map);\n \t\thw->blk[i].is_list_init = true;\n \n@@ -3843,6 +3845,8 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[],\n \tu32 byte = 0;\n \tu8 prof_id;\n \n+\tice_acquire_lock(&hw->blk[blk].es.prof_map_lock);\n+\n \t/* search for existing profile */\n \tstatus = ice_find_prof_id(hw, blk, es, &prof_id);\n \tif (status) {\n@@ -3914,24 +3918,26 @@ ice_add_prof(struct ice_hw *hw, enum ice_block blk, u64 id, u8 ptypes[],\n \t\tbytes--;\n \t\tbyte++;\n \t}\n-\tLIST_ADD(&prof->list, &hw->blk[blk].es.prof_map);\n \n-\treturn ICE_SUCCESS;\n+\tLIST_ADD(&prof->list, &hw->blk[blk].es.prof_map);\n+\tstatus = ICE_SUCCESS;\n \n err_ice_add_prof:\n+\tice_release_lock(&hw->blk[blk].es.prof_map_lock);\n \treturn status;\n }\n \n /**\n- * ice_search_prof_id - Search for a profile tracking ID\n+ * ice_search_prof_id_low - Search for a profile tracking ID low level\n * @hw: pointer to the HW struct\n * @blk: hardware block\n * @id: profile tracking ID\n *\n- * This will search for a profile tracking ID which was previously added.\n+ * This will search for a profile tracking ID which was previously added. This\n+ * version assumes that the caller has already acquired the prof map lock.\n */\n-struct ice_prof_map *\n-ice_search_prof_id(struct ice_hw *hw, enum ice_block blk, u64 id)\n+static struct ice_prof_map *\n+ice_search_prof_id_low(struct ice_hw *hw, enum ice_block blk, u64 id)\n {\n \tstruct ice_prof_map *entry = NULL;\n \tstruct ice_prof_map *map;\n@@ -3947,6 +3953,26 @@ ice_search_prof_id(struct ice_hw *hw, enum ice_block blk, u64 id)\n \treturn entry;\n }\n \n+/**\n+ * ice_search_prof_id - Search for a profile tracking ID\n+ * @hw: pointer to the HW struct\n+ * @blk: hardware block\n+ * @id: profile tracking ID\n+ *\n+ * This will search for a profile tracking ID which was previously added.\n+ */\n+struct ice_prof_map *\n+ice_search_prof_id(struct ice_hw *hw, enum ice_block blk, u64 id)\n+{\n+\tstruct ice_prof_map *entry;\n+\n+\tice_acquire_lock(&hw->blk[blk].es.prof_map_lock);\n+\tentry = ice_search_prof_id_low(hw, blk, id);\n+\tice_release_lock(&hw->blk[blk].es.prof_map_lock);\n+\n+\treturn entry;\n+}\n+\n /**\n * ice_set_prof_context - Set context for a given profile\n * @hw: pointer to the HW struct\n@@ -4199,29 +4225,33 @@ ice_rem_flow_all(struct ice_hw *hw, enum ice_block blk, u64 id)\n */\n enum ice_status ice_rem_prof(struct ice_hw *hw, enum ice_block blk, u64 id)\n {\n-\tenum ice_status status;\n \tstruct ice_prof_map *pmap;\n+\tenum ice_status status;\n \n-\tpmap = ice_search_prof_id(hw, blk, id);\n-\tif (!pmap)\n-\t\treturn ICE_ERR_DOES_NOT_EXIST;\n+\tice_acquire_lock(&hw->blk[blk].es.prof_map_lock);\n+\n+\tpmap = ice_search_prof_id_low(hw, blk, id);\n+\tif (!pmap) {\n+\t\tstatus = ICE_ERR_DOES_NOT_EXIST;\n+\t\tgoto err_ice_rem_prof;\n+\t}\n \n \t/* remove all flows with this profile */\n \tstatus = ice_rem_flow_all(hw, blk, pmap->profile_cookie);\n \tif (status)\n-\t\treturn status;\n+\t\tgoto err_ice_rem_prof;\n \n-\t/* remove profile */\n-\tstatus = ice_free_prof_id(hw, blk, pmap->prof_id);\n-\tif (status)\n-\t\treturn status;\n \t/* dereference profile, and possibly remove */\n \tice_prof_dec_ref(hw, blk, pmap->prof_id);\n \n \tLIST_DEL(&pmap->list);\n \tice_free(hw, pmap);\n \n-\treturn ICE_SUCCESS;\n+\tstatus = ICE_SUCCESS;\n+\n+err_ice_rem_prof:\n+\tice_release_lock(&hw->blk[blk].es.prof_map_lock);\n+\treturn status;\n }\n \n /**\ndiff --git a/drivers/net/ice/base/ice_flex_type.h b/drivers/net/ice/base/ice_flex_type.h\nindex 98c7637a5..7133983ff 100644\n--- a/drivers/net/ice/base/ice_flex_type.h\n+++ b/drivers/net/ice/base/ice_flex_type.h\n@@ -503,10 +503,11 @@ struct ice_es {\n \tu16 count;\n \tu16 fvw;\n \tu16 *ref_count;\n-\tu8 *written;\n-\tu8 reverse; /* set to true to reverse FV order */\n \tstruct LIST_HEAD_TYPE prof_map;\n \tstruct ice_fv_word *t;\n+\tstruct ice_lock prof_map_lock;\t/* protect access to profiles list */\n+\tu8 *written;\n+\tu8 reverse; /* set to true to reverse FV order */\n };\n \n /* PTYPE Group management */\n", "prefixes": [ "v3", "14/69" ] }{ "id": 55001, "url": "