Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/64756/?format=api
https://patches.dpdk.org/api/patches/64756/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20200116163836.15696-1-taox.zhu@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": "<20200116163836.15696-1-taox.zhu@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20200116163836.15696-1-taox.zhu@intel.com", "date": "2020-01-16T16:38:36", "name": "net/ice: fix flow fdir/switch memory leak.", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "05a3df2f6899d6292885e0c3952a955bba344543", "submitter": { "id": 1368, "url": "https://patches.dpdk.org/api/people/1368/?format=api", "name": "Zhu, TaoX", "email": "taox.zhu@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/20200116163836.15696-1-taox.zhu@intel.com/mbox/", "series": [ { "id": 8152, "url": "https://patches.dpdk.org/api/series/8152/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=8152", "date": "2020-01-16T16:38:36", "name": "net/ice: fix flow fdir/switch memory leak.", "version": 1, "mbox": "https://patches.dpdk.org/series/8152/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/64756/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/64756/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 9F1E4A0352;\n\tThu, 16 Jan 2020 09:01:11 +0100 (CET)", "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4203B1C066;\n\tThu, 16 Jan 2020 09:01:11 +0100 (CET)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n by dpdk.org (Postfix) with ESMTP id E5CB01BFFE\n for <dev@dpdk.org>; Thu, 16 Jan 2020 09:01:09 +0100 (CET)", "from fmsmga001.fm.intel.com ([10.253.24.23])\n by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n 16 Jan 2020 00:01:09 -0800", "from unknown (HELO localhost.localdomain) ([10.239.250.16])\n by fmsmga001.fm.intel.com with ESMTP; 16 Jan 2020 00:01:06 -0800" ], "X-Amp-Result": "SKIPPED(no attachment in message)", "X-Amp-File-Uploaded": "False", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.70,325,1574150400\"; d=\"scan'208\";a=\"257212947\"", "From": "taox.zhu@intel.com", "To": "qiming.yang@intel.com, wenzhuo.lu@intel.com, simei.su@intel.com,\n yahui.cao@intel.com", "Cc": "dev@dpdk.org,\n\tTao Zhu <taox.zhu@intel.com>", "Date": "Thu, 16 Jan 2020 16:38:36 +0000", "Message-Id": "<20200116163836.15696-1-taox.zhu@intel.com>", "X-Mailer": "git-send-email 2.17.1", "Subject": "[dpdk-dev] [PATCH] net/ice: fix flow fdir/switch memory leak.", "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": "From: Tao Zhu <taox.zhu@intel.com>\n\n1. Fix ice fdir and hash flow memory leak.\n2. Fix the ice definition of LIST_FOR_EACH_ENTRY_SAFE not \n save tmp which cause list deletion incompletely.\n\nFixes: 5f0978e9622 (\"net/ice/base: add OS specific implementation\")\nFixes: f5cafa961fa (\"net/ice: add flow director create and destroy\")\nFixes: 5ad3db8d4bd (\"net/ice: enable advanced RSS\")\n\nSigned-off-by: Tao Zhu <taox.zhu@intel.com>\nReviewed-by: Su, Simei <simei.su@intel.com>\nReviewed-by: Cao, Yahui <yahui.cao@intel.com>\n---\n drivers/net/ice/base/ice_osdep.h | 17 +++++++++++++++--\n drivers/net/ice/ice_fdir_filter.c | 12 +++++++-----\n drivers/net/ice/ice_hash.c | 12 ++++++------\n 3 files changed, 28 insertions(+), 13 deletions(-)\n\n- File drivers/net/ice/base/ice_osdep.h need someone to review.\n- File drivers/net/ice/ice_fdir_filter.c reviewed by Yahui.\n- File drivers/net/ice/ice_hash.c reviewed by Simei.", "diff": "diff --git a/drivers/net/ice/base/ice_osdep.h b/drivers/net/ice/base/ice_osdep.h\nindex 27c1830..4b37406 100644\n--- a/drivers/net/ice/base/ice_osdep.h\n+++ b/drivers/net/ice/base/ice_osdep.h\n@@ -343,6 +343,21 @@ static inline void list_add_tail(struct ice_list_entry *entry,\n \t\t\t\t member) :\t\t\t\t \\\n \t\t 0)\n \n+#define LIST_FOR_EACH_ENTRY_SAFE(pos, tmp, head, type, member)\t\t \\\n+\tfor ((pos) = (head)->lh_first ?\t\t\t\t\t \\\n+\t\t container_of((head)->lh_first, struct type, member) : \\\n+\t\t 0, \\\n+\t\t (tmp) = (pos) == 0 ? 0 : ((pos)->member.next.le_next ? \\\n+\t\t container_of((pos)->member.next.le_next, struct type, \\\n+\t\t\t\t member) :\t\t\t\t \\\n+\t\t 0);\t\t\t\t\t\t \\\n+\t (pos);\t\t\t\t\t\t\t \\\n+\t (pos) = (tmp),\t\t\t\t\t\t \\\n+\t (tmp) = (pos) == 0 ? 0 : ((tmp)->member.next.le_next ?\t \\\n+\t\t container_of((pos)->member.next.le_next, struct type, \\\n+\t\t\t\t member) :\t\t\t\t \\\n+\t\t 0))\n+\n #define LIST_REPLACE_INIT(list_head, head) do {\t\t\t\t\\\n \t(head)->lh_first = (list_head)->lh_first;\t\t\t\\\n \tINIT_LIST_HEAD(list_head);\t\t\t\t\t\\\n@@ -356,8 +371,6 @@ static inline void list_add_tail(struct ice_list_entry *entry,\n #define HLIST_DEL(entry) LIST_DEL(entry)\n #define HLIST_FOR_EACH_ENTRY(pos, head, type, member) \\\n \tLIST_FOR_EACH_ENTRY(pos, head, type, member)\n-#define LIST_FOR_EACH_ENTRY_SAFE(pos, tmp, head, type, member) \\\n-\tLIST_FOR_EACH_ENTRY(pos, head, type, member)\n \n #ifndef ICE_DBG_TRACE\n #define ICE_DBG_TRACE\t\tBIT_ULL(0)\ndiff --git a/drivers/net/ice/ice_fdir_filter.c b/drivers/net/ice/ice_fdir_filter.c\nindex fa87074..c31a736 100644\n--- a/drivers/net/ice/ice_fdir_filter.c\n+++ b/drivers/net/ice/ice_fdir_filter.c\n@@ -1938,23 +1938,25 @@\n \n \tret = ice_fdir_parse_pattern(ad, pattern, error, filter);\n \tif (ret)\n-\t\treturn ret;\n+\t\tgoto error;\n \tinput_set = filter->input_set;\n \tif (!input_set || input_set & ~item->input_set_mask) {\n \t\trte_flow_error_set(error, EINVAL,\n \t\t\t\t RTE_FLOW_ERROR_TYPE_ITEM_SPEC,\n \t\t\t\t pattern,\n \t\t\t\t \"Invalid input set\");\n-\t\treturn -rte_errno;\n+\t\tret = -rte_errno;\n+\t\tgoto error;\n \t}\n \n \tret = ice_fdir_parse_action(ad, actions, error, filter);\n \tif (ret)\n-\t\treturn ret;\n+\t\tgoto error;\n \n \t*meta = filter;\n-\n-\treturn 0;\n+error:\n+\trte_free(item);\n+\treturn ret;\n }\n \n static struct ice_flow_parser ice_fdir_parser_os = {\ndiff --git a/drivers/net/ice/ice_hash.c b/drivers/net/ice/ice_hash.c\nindex b145a3f..d891538 100644\n--- a/drivers/net/ice/ice_hash.c\n+++ b/drivers/net/ice/ice_hash.c\n@@ -409,7 +409,7 @@ struct ice_hash_match_type ice_hash_type_list[] = {\n \t\t\tvoid **meta,\n \t\t\tstruct rte_flow_error *error)\n {\n-\tint ret = 0;\n+\tint ret = -rte_errno;\n \tstruct ice_pattern_match_item *pattern_match_item;\n \tstruct rss_meta *rss_meta_ptr;\n \n@@ -425,11 +425,11 @@ struct ice_hash_match_type ice_hash_type_list[] = {\n \tpattern_match_item = ice_search_pattern_match_item(pattern,\n \t\t\t\t\tarray, array_len, error);\n \tif (!pattern_match_item)\n-\t\treturn -rte_errno;\n+\t\tgoto error;\n \n \tret = ice_hash_check_inset(pattern, error);\n \tif (ret)\n-\t\treturn -rte_errno;\n+\t\tgoto error;\n \n \t/* Save protocol header to rss_meta. */\n \t*meta = rss_meta_ptr;\n@@ -438,12 +438,12 @@ struct ice_hash_match_type ice_hash_type_list[] = {\n \n \t/* Check rss action. */\n \tret = ice_hash_parse_action(pattern_match_item, actions, meta, error);\n+error:\n \tif (ret)\n-\t\treturn -rte_errno;\n-\n+\t\trte_free(rss_meta_ptr);\n \trte_free(pattern_match_item);\n \n-\treturn 0;\n+\treturn ret;\n }\n \n static int\n", "prefixes": [] }{ "id": 64756, "url": "