Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/622820/?format=api
{ "id": 622820, "url": "http://patchwork.ozlabs.org/api/patches/622820/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20160517013320.2902.71585.stgit@terminator23.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": "<20160517013320.2902.71585.stgit@terminator23.jf.intel.com>", "list_archive_url": null, "date": "2016-05-17T01:33:20", "name": "[v1,next-queue] net: ixgbe: Error handler for duplicate filter locations in hardware for cls_u32 offloads", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "aae08dd4f83dd700bf89f910acd2c9c164ce575f", "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/20160517013320.2902.71585.stgit@terminator23.jf.intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/622820/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/622820/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 fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\t(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3r80Y00rT6z9sf6\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 17 May 2016 11:46:12 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id AF3BAA684D;\n\tTue, 17 May 2016 01:46:10 +0000 (UTC)", "from fraxinus.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id v01cjaa9njHr; Tue, 17 May 2016 01:46:10 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 2EFC2A6846;\n\tTue, 17 May 2016 01:46:10 +0000 (UTC)", "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\tby ash.osuosl.org (Postfix) with ESMTP id F23FF1C0F90\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 May 2016 01:46:05 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id F07D692BFE\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 May 2016 01:46:05 +0000 (UTC)", "from whitealder.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id V2ofxPeeO50n for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 May 2016 01:46:04 +0000 (UTC)", "from mga14.intel.com (mga14.intel.com [192.55.52.115])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id B5C5792BF5\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 17 May 2016 01:46:04 +0000 (UTC)", "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby fmsmga103.fm.intel.com with ESMTP; 16 May 2016 18:46:04 -0700", "from terminator23.jf.intel.com ([10.166.46.76])\n\tby orsmga001.jf.intel.com with ESMTP; 16 May 2016 18:46:04 -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.26,322,1459839600\"; d=\"scan'208\";a=\"955951404\"", "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": "Mon, 16 May 2016 18:33:20 -0700", "Message-ID": "<20160517013320.2902.71585.stgit@terminator23.jf.intel.com>", "User-Agent": "StGit/0.17.1-dirty", "MIME-Version": "1.0", "Subject": "[Intel-wired-lan] [PATCH] [v1,\n\tnext-queue] net: ixgbe: Error handler for duplicate filter\n\tlocations in hardware for cls_u32 offloads", "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": "For u32 classifier filters, avoid overwriting existing filter\nin a hardware location without removing it first, to clean up\ninconsistencies due to duplicate values for filter location.\n\nVerified with the following filters:\n\n# tc qdisc add dev enp5s0f1 ingress\n# ethtool -K enp5s0f1 hw-tc-offload on\n\nCreate child hash tables:\n# tc filter add dev enp5s0f1 parent ffff: protocol ip prio 99 \\\n\thandle 1: u32 divisor 1\n# tc filter add dev enp5s0f1 parent ffff: protocol ip prio 99 \\\n\thandle 2: u32 divisor 1\n\nLink to the child hash table from parent hash table:\n# tc filter add dev enp5s0f1 protocol ip parent ffff: prio 99 \\\n\thandle 800:0:11 u32 ht 800: link 1: \\\n\toffset at 0 mask 0f00 shift 6 plus 0 eat \\\n\tmatch ip protocol 6 ff match ip dst 15.0.0.1/32\n\n# tc filter add dev enp5s0f1 protocol ip parent ffff: prio 99 \\\n\thandle 800:0:12 u32 ht 800: link 2: \\\n\toffset at 0 mask 0f00 shift 6 plus 0 eat \\\n\tmatch ip protocol 17 ff match ip dst 16.0.0.1/32\n\nAdd filter into child hash table:\n# tc filter add dev enp5s0f1 parent ffff: protocol ip \\\n\thandle 1:0:3 u32 ht 1: \\\n\tmatch tcp src 22 ffff action drop\n\nAdd another filter to the same location:\n# tc filter add dev enp5s0f1 parent ffff: protocol ip \\\n\thandle 2:0:3 u32 ht 2: \\\n\tmatch tcp src 33 ffff action drop\n\nSigned-off-by: Amritha Nambiar <amritha.nambiar@intel.com>\n---\n drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 41 +++++++++++++++----------\n 1 file changed, 25 insertions(+), 16 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\nindex 7a893ae..a36cd60 100644\n--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c\n@@ -8323,8 +8323,11 @@ static int ixgbe_delete_clsu32(struct ixgbe_adapter *adapter,\n \t/* Clear this filter in the link data it is associated with */\n \tif (uhtid != 0x800) {\n \t\tjump = adapter->jump_tables[uhtid];\n-\t\tif (jump)\n-\t\t\tclear_bit(loc - 1, jump->child_loc_map);\n+\t\tif (!jump)\n+\t\t\treturn -EINVAL;\n+\t\tif (!test_bit(loc - 1, jump->child_loc_map))\n+\t\t\treturn -EINVAL;\n+\t\tclear_bit(loc - 1, jump->child_loc_map);\n \t}\n \n \t/* Check if the filter being deleted is a link */\n@@ -8614,7 +8617,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\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 err_out;\n+\t\t\t\tgoto free_input;\n \t\t\t}\n \t\t\tjump->input = input;\n \t\t\tjump->mask = mask;\n@@ -8637,7 +8640,7 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \tmask = kzalloc(sizeof(*mask), GFP_KERNEL);\n \tif (!mask) {\n \t\terr = -ENOMEM;\n-\t\tgoto err_out;\n+\t\tgoto free_input;\n \t}\n \n \tif ((uhtid != 0x800) && (adapter->jump_tables[uhtid])) {\n@@ -8647,6 +8650,20 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\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+\n+\t\t/* Lookup in all child hash tables if this location is already\n+\t\t * filled with a filter\n+\t\t */\n+\t\tfor (i = 1; i < IXGBE_MAX_LINK_HANDLE; i++) {\n+\t\t\tstruct ixgbe_jump_table *link = adapter->jump_tables[i];\n+\n+\t\t\tif (link && (test_bit(loc - 1, link->child_loc_map))) {\n+\t\t\t\te_err(drv, \"Filter exists in location: %x\\n\",\n+\t\t\t\t loc);\n+\t\t\t\terr = -EINVAL;\n+\t\t\t\tgoto err_out;\n+\t\t\t}\n+\t\t}\n \t}\n \terr = ixgbe_clsu32_build_input(input, mask, cls, field_ptr, NULL);\n \tif (err)\n@@ -8678,25 +8695,17 @@ static int ixgbe_configure_clsu32(struct ixgbe_adapter *adapter,\n \t\tixgbe_update_ethtool_fdir_entry(adapter, input, input->sw_idx);\n \tspin_unlock(&adapter->fdir_perfect_lock);\n \n-\tif ((uhtid != 0x800) && (adapter->jump_tables[uhtid])) {\n-\t\tstruct ixgbe_jump_table *link = adapter->jump_tables[uhtid];\n+\tif ((uhtid != 0x800) && (adapter->jump_tables[uhtid]))\n+\t\tset_bit(loc - 1, (adapter->jump_tables[uhtid])->child_loc_map);\n \n-\t\tif (test_bit(loc - 1, link->child_loc_map)) {\n-\t\t\te_err(drv, \"Filter: %x exists in hash table: %x\\n\",\n-\t\t\t loc, uhtid);\n-\t\t\terr = -EINVAL;\n-\t\t\tgoto free_mask;\n-\t\t}\n-\t\tset_bit(loc - 1, link->child_loc_map);\n-\t}\n \tkfree(mask);\n \treturn err;\n err_out_w_lock:\n \tspin_unlock(&adapter->fdir_perfect_lock);\n err_out:\n-\tkfree(input);\n-free_mask:\n \tkfree(mask);\n+free_input:\n+\tkfree(input);\n free_jump:\n \tkfree(jump);\n \treturn err;\n", "prefixes": [ "v1", "next-queue" ] }