Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/693939/?format=api
{ "id": 693939, "url": "http://patchwork.ozlabs.org/api/patches/693939/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/1478896779-13697-4-git-send-email-bimmy.pujari@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": "<1478896779-13697-4-git-send-email-bimmy.pujari@intel.com>", "list_archive_url": null, "date": "2016-11-11T20:39:27", "name": "[next,S54,03/15] i40e: refactor i40e_update_filter_state to avoid passing aq_err", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "ed2c19aaac93f2aee658ad57598151ec0a2fa2d6", "submitter": { "id": 68919, "url": "http://patchwork.ozlabs.org/api/people/68919/?format=api", "name": "Pujari, Bimmy", "email": "bimmy.pujari@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/1478896779-13697-4-git-send-email-bimmy.pujari@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/693939/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/693939/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 hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\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 3tFsJg0788z9t2g\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 12 Nov 2016 07:41:23 +1100 (AEDT)", "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 661AF96110;\n\tFri, 11 Nov 2016 20:41:21 +0000 (UTC)", "from hemlock.osuosl.org ([127.0.0.1])\n\tby localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)\n\twith ESMTP id yS6q-pqg0MWi; Fri, 11 Nov 2016 20:41:16 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 7ACD196117;\n\tFri, 11 Nov 2016 20:41:16 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 68FCC1CEC94\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Nov 2016 20:41:14 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 667ACC2A38\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Nov 2016 20:41:14 +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 hz8uIOidxCjd for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Nov 2016 20:41:13 +0000 (UTC)", "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 97506C29B3\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 11 Nov 2016 20:41:13 +0000 (UTC)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby orsmga104.jf.intel.com with ESMTP; 11 Nov 2016 12:41:13 -0800", "from bimmy.jf.intel.com (HELO bimmy.linux1.jf.intel.com)\n\t([134.134.2.167])\n\tby fmsmga005.fm.intel.com with ESMTP; 11 Nov 2016 12:41:13 -0800" ], "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.31,474,1473145200\"; d=\"scan'208\";a=\"30297937\"", "From": "Bimmy Pujari <bimmy.pujari@intel.com>", "To": "intel-wired-lan@lists.osuosl.org", "Date": "Fri, 11 Nov 2016 12:39:27 -0800", "Message-Id": "<1478896779-13697-4-git-send-email-bimmy.pujari@intel.com>", "X-Mailer": "git-send-email 2.4.11", "In-Reply-To": "<1478896779-13697-1-git-send-email-bimmy.pujari@intel.com>", "References": "<1478896779-13697-1-git-send-email-bimmy.pujari@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S54 03/15] i40e: refactor\n\ti40e_update_filter_state to avoid passing aq_err", "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>", "MIME-Version": "1.0", "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": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nThe current caller of i40e_update_filter_state incorrectly passes\naq_ret, an i40e_status variable, instead of the expected aq_err. This\nhappens to work because i40e_status is actually just a typedef integer,\nand 0 is still the successful return. However i40e_update_filter_state\nhas special handling for ENOSPC which is currently being ignored.\n\nAlso notice that firmware does not update the per-filter response for\nmany types of errors, such as EINVAL. Thus, modify the filter setup so\nthat the firmware response memory is pre-set with I40E_AQC_MM_ERR_NO_RES.\n\nThis enables us to refactor i40e_update_filter_state, removing the need\nto pass aq_err and avoiding a need for having 3 different flows for\nchecking the filter state.\n\nThe resulting code for i40e_update_filter_state is much simpler, only\na single loop and we always check each filter response value every time.\nSince we pre-set the response value to match our expected error this\ncorrectly works for all success and error flows.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-ID: Ie292c9511f34ee18c6ef40f955ad13e28b7aea7d\n---\nTesting-hints:\n This shouldn't have any visible side effects, but it may help detect\n some errors from firmware more accurately. Ensure that adding and\n deleting many MAC/VLAN filters works as expected without issue and\n that the added filters function correctly.\n\n drivers/net/ethernet/intel/i40e/i40e_main.c | 58 +++++++++++------------------\n 1 file changed, 21 insertions(+), 37 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_main.c b/drivers/net/ethernet/intel/i40e/i40e_main.c\nindex 42b6d73..8f176d0 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_main.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_main.c\n@@ -1756,7 +1756,6 @@ static void i40e_undo_filter_entries(struct i40e_vsi *vsi,\n * @count: Number of filters added\n * @add_list: return data from fw\n * @head: pointer to first filter in current batch\n- * @aq_err: status from fw\n *\n * MAC filter entries from list were slated to be added to device. Returns\n * number of successful filters. Note that 0 does NOT mean success!\n@@ -1764,47 +1763,30 @@ static void i40e_undo_filter_entries(struct i40e_vsi *vsi,\n static int\n i40e_update_filter_state(int count,\n \t\t\t struct i40e_aqc_add_macvlan_element_data *add_list,\n-\t\t\t struct i40e_mac_filter *add_head, int aq_err)\n+\t\t\t struct i40e_mac_filter *add_head)\n {\n \tint retval = 0;\n \tint i;\n \n-\n-\tif (!aq_err) {\n-\t\tretval = count;\n-\t\t/* Everything's good, mark all filters active. */\n-\t\tfor (i = 0; i < count ; i++) {\n-\t\t\tadd_head->state = I40E_FILTER_ACTIVE;\n-\t\t\tadd_head = hlist_entry(add_head->hlist.next,\n-\t\t\t\t\t typeof(struct i40e_mac_filter),\n-\t\t\t\t\t hlist);\n-\t\t}\n-\t} else if (aq_err == I40E_AQ_RC_ENOSPC) {\n-\t\t/* Device ran out of filter space. Check the return value\n-\t\t * for each filter to see which ones are active.\n+\tfor (i = 0; i < count; i++) {\n+\t\t/* Always check status of each filter. We don't need to check\n+\t\t * the firmware return status because we pre-set the filter\n+\t\t * status to I40E_AQC_MM_ERR_NO_RES when sending the filter\n+\t\t * request to the adminq. Thus, if it no longer matches then\n+\t\t * we know the filter is active.\n \t\t */\n-\t\tfor (i = 0; i < count ; i++) {\n-\t\t\tif (add_list[i].match_method ==\n-\t\t\t I40E_AQC_MM_ERR_NO_RES) {\n-\t\t\t\tadd_head->state = I40E_FILTER_FAILED;\n-\t\t\t} else {\n-\t\t\t\tadd_head->state = I40E_FILTER_ACTIVE;\n-\t\t\t\tretval++;\n-\t\t\t}\n-\t\t\tadd_head = hlist_entry(add_head->hlist.next,\n-\t\t\t\t\t typeof(struct i40e_mac_filter),\n-\t\t\t\t\t hlist);\n-\t\t}\n-\t} else {\n-\t\t/* Some other horrible thing happened, fail all filters */\n-\t\tretval = 0;\n-\t\tfor (i = 0; i < count ; i++) {\n+\t\tif (add_list[i].match_method == I40E_AQC_MM_ERR_NO_RES) {\n \t\t\tadd_head->state = I40E_FILTER_FAILED;\n-\t\t\tadd_head = hlist_entry(add_head->hlist.next,\n-\t\t\t\t\t typeof(struct i40e_mac_filter),\n-\t\t\t\t\t hlist);\n+\t\t} else {\n+\t\t\tadd_head->state = I40E_FILTER_ACTIVE;\n+\t\t\tretval++;\n \t\t}\n+\n+\t\tadd_head = hlist_entry(add_head->hlist.next,\n+\t\t\t\t typeof(struct i40e_mac_filter),\n+\t\t\t\t hlist);\n \t}\n+\n \treturn retval;\n }\n \n@@ -1863,12 +1845,11 @@ void i40e_aqc_add_filters(struct i40e_vsi *vsi, const char *vsi_name,\n \t\t\t int num_add, bool *promisc_changed)\n {\n \tstruct i40e_hw *hw = &vsi->back->hw;\n-\ti40e_status aq_ret;\n \tint aq_err, fcnt;\n \n-\taq_ret = i40e_aq_add_macvlan(hw, vsi->seid, list, num_add, NULL);\n+\ti40e_aq_add_macvlan(hw, vsi->seid, list, num_add, NULL);\n \taq_err = hw->aq.asq_last_status;\n-\tfcnt = i40e_update_filter_state(num_add, list, add_head, aq_ret);\n+\tfcnt = i40e_update_filter_state(num_add, list, add_head);\n \n \tif (fcnt != num_add) {\n \t\t*promisc_changed = true;\n@@ -2167,6 +2148,9 @@ int i40e_sync_vsi_filters(struct i40e_vsi *vsi)\n \t\t\t\t\tcpu_to_le16((u16)(f->vlan));\n \t\t\t}\n \t\t\tadd_list[num_add].queue_number = 0;\n+\t\t\t/* set invalid match method for later detection */\n+\t\t\tadd_list[num_add].match_method =\n+\t\t\t\tcpu_to_le16((u16)I40E_AQC_MM_ERR_NO_RES);\n \t\t\tcmd_flags |= I40E_AQC_MACVLAN_ADD_PERFECT_MATCH;\n \t\t\tadd_list[num_add].flags = cpu_to_le16(cmd_flags);\n \t\t\tnum_add++;\n", "prefixes": [ "next", "S54", "03/15" ] }