Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/610691/?format=api
{ "id": 610691, "url": "http://patchwork.ozlabs.org/api/patches/610691/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160414230853.2148.85740.stgit@sdncamp.jf.intel.com/", "project": { "id": 46, "url": "http://patchwork.ozlabs.org/api/projects/46/?format=api", "name": "Intel Wired Ethernet development", "link_name": "intel-wired-lan", "list_id": "intel-wired-lan.osuosl.org", "list_email": "intel-wired-lan@osuosl.org", "web_url": "", "scm_url": "", "webscm_url": "", "list_archive_url": "", "list_archive_url_format": "", "commit_url_format": "" }, "msgid": "<20160414230853.2148.85740.stgit@sdncamp.jf.intel.com>", "list_archive_url": null, "date": "2016-04-14T23:08:53", "name": "[v3,next-queue] net: ixgbe: Match on multiple headers for cls_u32 offloads", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "9c96db6e513a1f65bac05923ca8a06be7e76f9ff", "submitter": { "id": 68504, "url": "http://patchwork.ozlabs.org/api/people/68504/?format=api", "name": "Nambiar, Amritha", "email": "amritha.nambiar@intel.com" }, "delegate": { "id": 68, "url": "http://patchwork.ozlabs.org/api/users/68/?format=api", "username": "jtkirshe", "first_name": "Jeff", "last_name": "Kirsher", "email": "jeffrey.t.kirsher@intel.com" }, "mbox": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160414230853.2148.85740.stgit@sdncamp.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/610691/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/610691/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@lists.osuosl.org>", "X-Original-To": [ "incoming@patchwork.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Delivered-To": [ "patchwork-incoming@bilbo.ozlabs.org", "intel-wired-lan@lists.osuosl.org" ], "Received": [ "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ozlabs.org (Postfix) with ESMTP id 3qmGWk38lvz9ssM\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 15 Apr 2016 09:06:42 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 84A4832015;\n\tThu, 14 Apr 2016 23:06:41 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id u486FBdSShu8; Thu, 14 Apr 2016 23:06:39 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby silver.osuosl.org (Postfix) with ESMTP id C4B602F7C8;\n\tThu, 14 Apr 2016 23:06:39 +0000 (UTC)", "from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136])\n\tby ash.osuosl.org (Postfix) with ESMTP id 49E761CEF9E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Apr 2016 23:06:38 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby silver.osuosl.org (Postfix) with ESMTP id 444173075E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Apr 2016 23:06:38 +0000 (UTC)", "from silver.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id U9OCtPSQvqTs for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Apr 2016 23:06:36 +0000 (UTC)", "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby silver.osuosl.org (Postfix) with ESMTP id 16BBE2F7C8\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 14 Apr 2016 23:06:36 +0000 (UTC)", "from fmsmga003.fm.intel.com ([10.253.24.29])\n\tby orsmga103.jf.intel.com with ESMTP; 14 Apr 2016 16:06:35 -0700", "from sdncamp.jf.intel.com ([10.166.46.129])\n\tby FMSMGA003.fm.intel.com with ESMTP; 14 Apr 2016 16:06:35 -0700" ], "X-Virus-Scanned": [ "amavisd-new at osuosl.org", "amavisd-new at osuosl.org" ], "X-Greylist": "domain auto-whitelisted by SQLgrey-1.7.6", "X-ExtLoop1": "1", "X-IronPort-AV": "E=Sophos;i=\"5.24,485,1455004800\"; d=\"scan'208\";a=\"686476001\"", "From": "Amritha Nambiar <amritha.nambiar@intel.com>", "To": "john.r.fastabend@intel.com, sridhar.samudrala@intel.com,\n\tintel-wired-lan@lists.osuosl.org, jeffrey.t.kirsher@intel.com,\n\tamritha.nambiar@intel.com", "Date": "Thu, 14 Apr 2016 19:08:53 -0400", "Message-ID": "<20160414230853.2148.85740.stgit@sdncamp.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH] [v3,\n\tnext-queue] net: ixgbe: Match on multiple headers for cls_u32\n\toffloads", "X-BeenThere": "intel-wired-lan@lists.osuosl.org", "X-Mailman-Version": "2.1.18-1", "Precedence": "list", "List-Id": "Intel Wired Ethernet Linux Kernel Driver Development\n\t<intel-wired-lan.lists.osuosl.org>", "List-Unsubscribe": "<http://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@lists.osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@lists.osuosl.org?subject=help>", "List-Subscribe": "<http://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@lists.osuosl.org?subject=subscribe>", "Content-Type": "text/plain; charset=\"us-ascii\"", "Content-Transfer-Encoding": "7bit", "Errors-To": "intel-wired-lan-bounces@lists.osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@lists.osuosl.org>" }, "content": "Adds support to set filters with multiple header fields (L3,L4)to match on.\nThis is achieved in the following order:\n1. Create a leaf hash table for the next header.\n2. Create a link to the leaf hash table from the base hash table with\n matches on next header type and current header fields.\n3. Add filter in leaf hash table with match on next header fields and\n action.\n\nVerified with the following filters :\n\nMatch TCP and DIP:\n# tc qdisc add dev enp9s0f0 ingress\n# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \\\n handle 1: u32 divisor 1\n# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \\\n u32 ht 800: order 1 link 1: \\\n offset at 0 mask 0f00 shift 6 plus 0 eat \\\n match ip protocol 6 ff match ip dst 10.0.0.1/32\n# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 1: order 1 \\\n match tcp src 28 ffff action drop\n\nDelete the filter:\n# tc filter del dev enp9s0f0 parent ffff: prio 99 handle 1:0:1 u32\n\nMatch on DIP, SIP, UDP (SPort, DPort):\n# tc filter add dev enp9s0f0 parent ffff: protocol ip prio 99 \\\n handle 2: u32 divisor 1\n# tc filter add dev enp9s0f0 protocol ip parent ffff: prio 99 \\\n u32 ht 800: order 2 link 2: \\\n offset at 0 mask 0f00 shift 6 plus 0 eat \\\n match ip dst 15.0.0.2/32 match ip protocol 17 ff \\\n match ip src 15.0.0.1/32\n# tc filter add dev enp9s0f0 parent ffff: protocol ip u32 ht 2: order 2 \\\n match udp src 30 ffff match udp dst 32 ffff action drop\n\nSigned-off-by: Amritha Nambiar <amritha.nambiar@intel.com>\n\nv2: Rename a loop variable to fix build error\nv3: Rebased to apply clean\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe.h | 2 \n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 216 +++++++++++++++++-------\n drivers/net/ethernet/intel/ixgbe/ixgbe_model.h | 6 +\n 3 files changed, 156 insertions(+), 68 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe.h b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\nindex 781c878..515c3dc 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe.h\n@@ -792,7 +792,7 @@ struct ixgbe_adapter {\n \tunsigned long fwd_bitmask; /* Bitmask indicating in use pools */\n \n #define IXGBE_MAX_LINK_HANDLE 10\n-\tstruct ixgbe_mat_field *jump_tables[IXGBE_MAX_LINK_HANDLE];\n+\tstruct ixgbe_jump_table *jump_tables[IXGBE_MAX_LINK_HANDLE];\n \tunsigned long tables;\n \n /* maximum number of RETA entries among all devices supported by ixgbe\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex d70746f..59534a7 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -5574,6 +5574,7 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)\n \tunsigned int rss, fdir;\n \tu32 fwsm;\n \tu16 device_caps;\n+\tint i;\n #ifdef CONFIG_IXGBE_DCB\n \tint j;\n \tstruct tc_configuration *tc;\n@@ -5609,7 +5610,14 @@ static int ixgbe_sw_init(struct ixgbe_adapter *adapter)\n #endif /* IXGBE_FCOE */\n \n \t/* initialize static ixgbe jump table entries */\n-\tadapter->jump_tables[0] = ixgbe_ipv4_fields;\n+\tadapter->jump_tables[0] = kzalloc(sizeof(*adapter->jump_tables[0]),\n+\t\t\t\t\t GFP_KERNEL);\n+\tif (!adapter->jump_tables[0])\n+\t\treturn -ENOMEM;\n+\tadapter->jump_tables[0]->mat = ixgbe_ipv4_fields;\n+\n+\tfor (i = 1; i < IXGBE_MAX_LINK_HANDLE; i++)\n+\t\tadapter->jump_tables[i] = NULL;\n \n \tadapter->mac_table = kzalloc(sizeof(struct ixgbe_mac_addr) *\n \t\t\t\t hw->mac.num_rar_entries,\n@@ -8382,6 +8390,55 @@ static int parse_tc_actions(struct ixgbe_adapter *adapter,\n }\n #endif /* CONFIG_NET_CLS_ACT */\n \n+static int ixgbe_clsu32_build_input(struct ixgbe_fdir_filter *input,\n+\t\t\t\t union ixgbe_atr_input *mask,\n+\t\t\t\t struct tc_cls_u32_offload *cls,\n+\t\t\t\t struct ixgbe_mat_field *field_ptr,\n+\t\t\t\t struct ixgbe_nexthdr *nexthdr)\n+{\n+\tint i, j, off;\n+\t__be32 val, m;\n+\tbool found_entry = false, found_jump_field = false;\n+\n+\tfor (i = 0; i < cls->knode.sel->nkeys; i++) {\n+\t\toff = cls->knode.sel->keys[i].off;\n+\t\tval = cls->knode.sel->keys[i].val;\n+\t\tm = cls->knode.sel->keys[i].mask;\n+\n+\t\tfor (j = 0; field_ptr[j].val; j++) {\n+\t\t\tif (field_ptr[j].off == off) {\n+\t\t\t\tfield_ptr[j].val(input, mask, val, m);\n+\t\t\t\tinput->filter.formatted.flow_type |=\n+\t\t\t\t\tfield_ptr[j].type;\n+\t\t\t\tfound_entry = true;\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t}\n+\t\tif (nexthdr) {\n+\t\t\tif (nexthdr->off == cls->knode.sel->keys[i].off &&\n+\t\t\t nexthdr->val == cls->knode.sel->keys[i].val &&\n+\t\t\t nexthdr->mask == cls->knode.sel->keys[i].mask)\n+\t\t\t\tfound_jump_field = true;\n+\t\t\telse\n+\t\t\t\tcontinue;\n+\t\t}\n+\t}\n+\n+\tif (nexthdr && !found_jump_field)\n+\t\treturn -EINVAL;\n+\n+\tif (!found_entry)\n+\t\treturn 0;\n+\n+\tmask->formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK |\n+\t\t\t\t IXGBE_ATR_L4TYPE_MASK;\n+\n+\tif (input->filter.formatted.flow_type == IXGBE_ATR_FLOW_TYPE_IPV4)\n+\t\tmask->formatted.flow_type &= IXGBE_ATR_L4TYPE_IPV6_MASK;\n+\n+\treturn 0;\n+}\n+\n static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t\t\t\t __be16 protocol,\n \t\t\t\t struct tc_cls_u32_offload *cls)\n@@ -8389,13 +8446,13 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \tu32 loc = cls->knode.handle & 0xfffff;\n \tstruct ixgbe_hw *hw = &adapter->hw;\n \tstruct ixgbe_mat_field *field_ptr;\n-\tstruct ixgbe_fdir_filter *input;\n-\tunion ixgbe_atr_input mask;\n-\tint i, err = 0;\n+\tstruct ixgbe_fdir_filter *input = NULL;\n+\tunion ixgbe_atr_input *mask = NULL;\n+\tstruct ixgbe_jump_table *jump = NULL;\n+\tint i, err = -EINVAL;\n \tu8 queue;\n \tu32 uhtid, link_uhtid;\n \n-\tmemset(&mask, 0, sizeof(union ixgbe_atr_input));\n \tuhtid = TC_U32_USERHTID(cls->knode.handle);\n \tlink_uhtid = TC_U32_USERHTID(cls->knode.link_handle);\n \n@@ -8407,39 +8464,11 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t * headers when needed.\n \t */\n \tif (protocol != htons(ETH_P_IP))\n-\t\treturn -EINVAL;\n-\n-\tif (link_uhtid) {\n-\t\tstruct ixgbe_nexthdr *nexthdr = ixgbe_ipv4_jumps;\n-\n-\t\tif (link_uhtid >= IXGBE_MAX_LINK_HANDLE)\n-\t\t\treturn -EINVAL;\n-\n-\t\tif (!test_bit(link_uhtid - 1, &adapter->tables))\n-\t\t\treturn -EINVAL;\n-\n-\t\tfor (i = 0; nexthdr[i].jump; i++) {\n-\t\t\tif (nexthdr[i].o != cls->knode.sel->offoff ||\n-\t\t\t nexthdr[i].s != cls->knode.sel->offshift ||\n-\t\t\t nexthdr[i].m != cls->knode.sel->offmask ||\n-\t\t\t /* do not support multiple key jumps its just mad */\n-\t\t\t cls->knode.sel->nkeys > 1)\n-\t\t\t\treturn -EINVAL;\n-\n-\t\t\tif (nexthdr[i].off == cls->knode.sel->keys[0].off &&\n-\t\t\t nexthdr[i].val == cls->knode.sel->keys[0].val &&\n-\t\t\t nexthdr[i].mask == cls->knode.sel->keys[0].mask) {\n-\t\t\t\tadapter->jump_tables[link_uhtid] =\n-\t\t\t\t\t\t\t\tnexthdr[i].jump;\n-\t\t\t\tbreak;\n-\t\t\t}\n-\t\t}\n-\t\treturn 0;\n-\t}\n+\t\treturn err;\n \n \tif (loc >= ((1024 << adapter->fdir_pballoc) - 2)) {\n \t\te_err(drv, \"Location out of range\\n\");\n-\t\treturn -EINVAL;\n+\t\treturn err;\n \t}\n \n \t/* cls u32 is a graph starting at root node 0x800. The driver tracks\n@@ -8450,47 +8479,85 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t * this function _should_ be generic try not to hardcode values here.\n \t */\n \tif (uhtid == 0x800) {\n-\t\tfield_ptr = adapter->jump_tables[0];\n+\t\tfield_ptr = (adapter->jump_tables[0])->mat;\n \t} else {\n \t\tif (uhtid >= IXGBE_MAX_LINK_HANDLE)\n-\t\t\treturn -EINVAL;\n-\n-\t\tfield_ptr = adapter->jump_tables[uhtid];\n+\t\t\treturn err;\n+\t\tif (!adapter->jump_tables[uhtid])\n+\t\t\treturn err;\n+\t\tfield_ptr = (adapter->jump_tables[uhtid])->mat;\n \t}\n \n \tif (!field_ptr)\n-\t\treturn -EINVAL;\n+\t\treturn err;\n \n-\tinput = kzalloc(sizeof(*input), GFP_KERNEL);\n-\tif (!input)\n-\t\treturn -ENOMEM;\n+\t/* At this point we know the field_ptr is valid and need to either\n+\t * build cls_u32 link or attach filter. Because adding a link to\n+\t * a handle that does not exist is invalid and the same for adding\n+\t * rules to handles that don't exist.\n+\t */\n \n-\tfor (i = 0; i < cls->knode.sel->nkeys; i++) {\n-\t\tint off = cls->knode.sel->keys[i].off;\n-\t\t__be32 val = cls->knode.sel->keys[i].val;\n-\t\t__be32 m = cls->knode.sel->keys[i].mask;\n-\t\tbool found_entry = false;\n-\t\tint j;\n+\tif (link_uhtid) {\n+\t\tstruct ixgbe_nexthdr *nexthdr = ixgbe_ipv4_jumps;\n \n-\t\tfor (j = 0; field_ptr[j].val; j++) {\n-\t\t\tif (field_ptr[j].off == off) {\n-\t\t\t\tfield_ptr[j].val(input, &mask, val, m);\n-\t\t\t\tinput->filter.formatted.flow_type |=\n-\t\t\t\t\tfield_ptr[j].type;\n-\t\t\t\tfound_entry = true;\n+\t\tif (link_uhtid >= IXGBE_MAX_LINK_HANDLE)\n+\t\t\treturn err;\n+\n+\t\tif (!test_bit(link_uhtid - 1, &adapter->tables))\n+\t\t\treturn err;\n+\n+\t\tfor (i = 0; nexthdr[i].jump; i++) {\n+\t\t\tif (nexthdr[i].o != cls->knode.sel->offoff ||\n+\t\t\t nexthdr[i].s != cls->knode.sel->offshift ||\n+\t\t\t nexthdr[i].m != cls->knode.sel->offmask)\n+\t\t\t\treturn err;\n+\n+\t\t\tjump = kzalloc(sizeof(*jump), GFP_KERNEL);\n+\t\t\tif (!jump)\n+\t\t\t\treturn -ENOMEM;\n+\t\t\tinput = kzalloc(sizeof(*input), GFP_KERNEL);\n+\t\t\tif (!input) {\n+\t\t\t\terr = -ENOMEM;\n+\t\t\t\tgoto free_jump;\n+\t\t\t}\n+\t\t\tmask = kzalloc(sizeof(*mask), GFP_KERNEL);\n+\t\t\tif (!mask) {\n+\t\t\t\terr = -ENOMEM;\n+\t\t\t\tgoto free_input;\n+\t\t\t}\n+\t\t\tjump->input = input;\n+\t\t\tjump->mask = mask;\n+\t\t\terr = ixgbe_clsu32_build_input(input, mask, cls,\n+\t\t\t\t\t\t field_ptr, &nexthdr[i]);\n+\t\t\tif (!err) {\n+\t\t\t\tjump->mat = nexthdr[i].jump;\n+\t\t\t\tadapter->jump_tables[link_uhtid] = jump;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n-\n-\t\tif (!found_entry)\n-\t\t\tgoto err_out;\n+\t\treturn 0;\n \t}\n \n-\tmask.formatted.flow_type = IXGBE_ATR_L4TYPE_IPV6_MASK |\n-\t\t\t\t IXGBE_ATR_L4TYPE_MASK;\n+\tinput = kzalloc(sizeof(*input), GFP_KERNEL);\n+\tif (!input)\n+\t\treturn -ENOMEM;\n+\tmask = kzalloc(sizeof(*mask), GFP_KERNEL);\n+\tif (!mask) {\n+\t\terr = -ENOMEM;\n+\t\tgoto free_input;\n+\t}\n \n-\tif (input->filter.formatted.flow_type == IXGBE_ATR_FLOW_TYPE_IPV4)\n-\t\tmask.formatted.flow_type &= IXGBE_ATR_L4TYPE_IPV6_MASK;\n+\tif ((uhtid != 0x800) && (adapter->jump_tables[uhtid])) {\n+\t\tif ((adapter->jump_tables[uhtid])->input)\n+\t\t\tmemcpy(input, (adapter->jump_tables[uhtid])->input,\n+\t\t\t sizeof(*input));\n+\t\tif ((adapter->jump_tables[uhtid])->mask)\n+\t\t\tmemcpy(mask, (adapter->jump_tables[uhtid])->mask,\n+\t\t\t sizeof(*mask));\n+\t}\n+\terr = ixgbe_clsu32_build_input(input, mask, cls, field_ptr, NULL);\n+\tif (err)\n+\t\tgoto err_out;\n \n \terr = parse_tc_actions(adapter, cls->knode.exts, &input->action,\n \t\t\t &queue);\n@@ -8502,28 +8569,33 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \tspin_lock(&adapter->fdir_perfect_lock);\n \n \tif (hlist_empty(&adapter->fdir_filter_list)) {\n-\t\tmemcpy(&adapter->fdir_mask, &mask, sizeof(mask));\n-\t\terr = ixgbe_fdir_set_input_mask_82599(hw, &mask);\n+\t\tmemcpy(&adapter->fdir_mask, mask, sizeof(*mask));\n+\t\terr = ixgbe_fdir_set_input_mask_82599(hw, mask);\n \t\tif (err)\n \t\t\tgoto err_out_w_lock;\n-\t} else if (memcmp(&adapter->fdir_mask, &mask, sizeof(mask))) {\n+\t} else if (memcmp(&adapter->fdir_mask, mask, sizeof(*mask))) {\n \t\terr = -EINVAL;\n \t\tgoto err_out_w_lock;\n \t}\n \n-\tixgbe_atr_compute_perfect_hash_82599(&input->filter, &mask);\n+\tixgbe_atr_compute_perfect_hash_82599(&input->filter, mask);\n \terr = ixgbe_fdir_write_perfect_filter_82599(hw, &input->filter,\n \t\t\t\t\t\t input->sw_idx, queue);\n \tif (!err)\n \t\tixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);\n \tspin_unlock(&adapter->fdir_perfect_lock);\n \n+\tkfree(mask);\n \treturn err;\n err_out_w_lock:\n \tspin_unlock(&adapter->fdir_perfect_lock);\n err_out:\n+\tkfree(mask);\n+free_input:\n \tkfree(input);\n-\treturn -EINVAL;\n+free_jump:\n+\tkfree(jump);\n+\treturn err;\n }\n \n static int __ixgbe_setup_tc(struct net_device *dev, u32 handle, __be16 proto,\n@@ -9567,6 +9639,7 @@ err_sw_init:\n \tixgbe_disable_sriov(adapter);\n \tadapter->flags2 &= ~IXGBE_FLAG2_SEARCH_FOR_SFP;\n \tiounmap(adapter->io_addr);\n+\tkfree(adapter->jump_tables[0]);\n \tkfree(adapter->mac_table);\n err_ioremap:\n \tdisable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);\n@@ -9595,6 +9668,7 @@ static void ixgbe_remove(struct pci_dev *pdev)\n \tstruct ixgbe_adapter *adapter = pci_get_drvdata(pdev);\n \tstruct net_device *netdev;\n \tbool disable_dev;\n+\tint i;\n \n \t/* if !adapter then we already cleaned up in probe */\n \tif (!adapter)\n@@ -9644,6 +9718,14 @@ static void ixgbe_remove(struct pci_dev *pdev)\n \n \te_dev_info(\"complete\\n\");\n \n+\tfor (i = 0; i < IXGBE_MAX_LINK_HANDLE; i++) {\n+\t\tif (adapter->jump_tables[i]) {\n+\t\t\tkfree(adapter->jump_tables[i]->input);\n+\t\t\tkfree(adapter->jump_tables[i]->mask);\n+\t\t}\n+\t\tkfree(adapter->jump_tables[i]);\n+\t}\n+\n \tkfree(adapter->mac_table);\n \tdisable_dev = !test_and_set_bit(__IXGBE_DISABLED, &adapter->state);\n \tfree_netdev(netdev);\ndiff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h b/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h\nindex 60adde5..a8bed3d 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_model.h\n@@ -38,6 +38,12 @@ struct ixgbe_mat_field {\n \tunsigned int type;\n };\n \n+struct ixgbe_jump_table {\n+\tstruct ixgbe_mat_field *mat;\n+\tstruct ixgbe_fdir_filter *input;\n+\tunion ixgbe_atr_input *mask;\n+};\n+\n static inline int ixgbe_mat_prgm_sip(struct ixgbe_fdir_filter *input,\n \t\t\t\t union ixgbe_atr_input *mask,\n \t\t\t\t u32 val, u32 m)\n", "prefixes": [ "v3", "next-queue" ] }