Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/798910/?format=api
{ "id": 798910, "url": "http://patchwork.ozlabs.org/api/patches/798910/?format=api", "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170807131812.86747-7-alice.michael@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": "<20170807131812.86747-7-alice.michael@intel.com>", "list_archive_url": null, "date": "2017-08-07T13:18:07", "name": "[next,S78-V5,07/12] i40e: ensure reset occurs when disabling VF", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": false, "hash": "de13c2159a7261ceee27383a7ee4f19b95965f5a", "submitter": { "id": 71123, "url": "http://patchwork.ozlabs.org/api/people/71123/?format=api", "name": "Michael, Alice", "email": "alice.michael@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/20170807131812.86747-7-alice.michael@intel.com/mbox/", "series": [], "comments": "http://patchwork.ozlabs.org/api/patches/798910/comments/", "check": "pending", "checks": "http://patchwork.ozlabs.org/api/patches/798910/checks/", "tags": {}, "related": [], "headers": { "Return-Path": "<intel-wired-lan-bounces@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" ], "Authentication-Results": "ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=osuosl.org\n\t(client-ip=140.211.166.138; helo=whitealder.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)", "Received": [ "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\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 3xR9VQ4RLwz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue, 8 Aug 2017 07:22:54 +1000 (AEST)", "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 0CAF684F00;\n\tMon, 7 Aug 2017 21:22:53 +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 xsUghvVg-Ov8; Mon, 7 Aug 2017 21:22:51 +0000 (UTC)", "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 919D7851A3;\n\tMon, 7 Aug 2017 21:22:49 +0000 (UTC)", "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id B53311C203E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 7 Aug 2017 21:22:47 +0000 (UTC)", "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id A3E7E85D18\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 7 Aug 2017 21:22:47 +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 0SbH15mop9oA for <intel-wired-lan@lists.osuosl.org>;\n\tMon, 7 Aug 2017 21:22:47 +0000 (UTC)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 5E25E8603D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon, 7 Aug 2017 21:22:45 +0000 (UTC)", "from orsmga004.jf.intel.com ([10.7.209.38])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t07 Aug 2017 14:22:44 -0700", "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga004.jf.intel.com with ESMTP; 07 Aug 2017 14:22:43 -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.41,339,1498546800\"; d=\"scan'208\";a=\"116660472\"", "From": "Alice Michael <alice.michael@intel.com>", "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org", "Date": "Mon, 7 Aug 2017 09:18:07 -0400", "Message-Id": "<20170807131812.86747-7-alice.michael@intel.com>", "X-Mailer": "git-send-email 2.9.4", "In-Reply-To": "<20170807131812.86747-1-alice.michael@intel.com>", "References": "<20170807131812.86747-1-alice.michael@intel.com>", "Subject": "[Intel-wired-lan] [next PATCH S78-V5 07/12] i40e: ensure reset\n\toccurs when disabling VF", "X-BeenThere": "intel-wired-lan@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.osuosl.org>", "List-Unsubscribe": "<https://lists.osuosl.org/mailman/options/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@osuosl.org?subject=unsubscribe>", "List-Archive": "<http://lists.osuosl.org/pipermail/intel-wired-lan/>", "List-Post": "<mailto:intel-wired-lan@osuosl.org>", "List-Help": "<mailto:intel-wired-lan-request@osuosl.org?subject=help>", "List-Subscribe": "<https://lists.osuosl.org/mailman/listinfo/intel-wired-lan>, \n\t<mailto:intel-wired-lan-request@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@osuosl.org", "Sender": "\"Intel-wired-lan\" <intel-wired-lan-bounces@osuosl.org>" }, "content": "From: Jacob Keller <jacob.e.keller@intel.com>\n\nIt is possible although rare that we may not reset when\ni40e_vc_disable_vf() is called. This can lead to some weird\ncircumstances with some values not being properly set. Modify\ni40e_reset_vf() to return a code indicating whether it reset or not.\n\nNow, i40e_vc_disable_vf() can wait until a reset actually occurs. If it\nfails to free up within a reasonable timeframe we'll display a warning\nmessage.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 42 +++++++++++++++++-----\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h | 4 +--\n 2 files changed, 35 insertions(+), 11 deletions(-)", "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex c9898cb..c7f1819 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -156,12 +156,28 @@ void i40e_vc_notify_vf_reset(struct i40e_vf *vf)\n * i40e_vc_disable_vf\n * @vf: pointer to the VF info\n *\n- * Disable the VF through a SW reset\n+ * Disable the VF through a SW reset.\n **/\n static inline void i40e_vc_disable_vf(struct i40e_vf *vf)\n {\n+\tint i;\n+\n \ti40e_vc_notify_vf_reset(vf);\n-\ti40e_reset_vf(vf, false);\n+\n+\t/* We want to ensure that an actual reset occurs initiated after this\n+\t * function was called. However, we do not want to wait forever, so\n+\t * we'll give a reasonable time and print a message if we failed to\n+\t * ensure a reset.\n+\t */\n+\tfor (i = 0; i < 20; i++) {\n+\t\tif (i40e_reset_vf(vf, false))\n+\t\t\treturn;\n+\t\tusleep_range(10000, 20000);\n+\t}\n+\n+\tdev_warn(&vf->pf->pdev->dev,\n+\t\t \"Failed to initiate reset for VF %d after 200 milliseconds\\n\",\n+\t\t vf->vf_id);\n }\n \n /**\n@@ -1048,9 +1064,9 @@ static void i40e_cleanup_reset_vf(struct i40e_vf *vf)\n * @vf: pointer to the VF structure\n * @flr: VFLR was issued or not\n *\n- * reset the VF\n+ * Returns true if the VF is reset, false otherwise.\n **/\n-void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n+bool i40e_reset_vf(struct i40e_vf *vf, bool flr)\n {\n \tstruct i40e_pf *pf = vf->pf;\n \tstruct i40e_hw *hw = &pf->hw;\n@@ -1058,9 +1074,11 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n \tu32 reg;\n \tint i;\n \n-\t/* If VFs have been disabled, there is no need to reset */\n+\t/* If the VFs have been disabled, this means something else is\n+\t * resetting the VF, so we shouldn't continue.\n+\t */\n \tif (test_and_set_bit(__I40E_VF_DISABLE, pf->state))\n-\t\treturn;\n+\t\treturn false;\n \n \ti40e_trigger_vf_reset(vf, flr);\n \n@@ -1097,6 +1115,8 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n \n \ti40e_flush(hw);\n \tclear_bit(__I40E_VF_DISABLE, pf->state);\n+\n+\treturn true;\n }\n \n /**\n@@ -1108,8 +1128,10 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n * VF, then do all the waiting in one chunk, and finally finish restoring each\n * VF after the wait. This is useful during PF routines which need to reset\n * all VFs, as otherwise it must perform these resets in a serialized fashion.\n+ *\n+ * Returns true if any VFs were reset, and false otherwise.\n **/\n-void i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)\n+bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)\n {\n \tstruct i40e_hw *hw = &pf->hw;\n \tstruct i40e_vf *vf;\n@@ -1118,11 +1140,11 @@ void i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)\n \n \t/* If we don't have any VFs, then there is nothing to reset */\n \tif (!pf->num_alloc_vfs)\n-\t\treturn;\n+\t\treturn false;\n \n \t/* If VFs have been disabled, there is no need to reset */\n \tif (test_and_set_bit(__I40E_VF_DISABLE, pf->state))\n-\t\treturn;\n+\t\treturn false;\n \n \t/* Begin reset on all VFs at once */\n \tfor (v = 0; v < pf->num_alloc_vfs; v++)\n@@ -1197,6 +1219,8 @@ void i40e_reset_all_vfs(struct i40e_pf *pf, bool flr)\n \n \ti40e_flush(hw);\n \tclear_bit(__I40E_VF_DISABLE, pf->state);\n+\n+\treturn true;\n }\n \n /**\ndiff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\nindex 5111d05..5ea42ad 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.h\n@@ -122,8 +122,8 @@ int i40e_alloc_vfs(struct i40e_pf *pf, u16 num_alloc_vfs);\n int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,\n \t\t\t u32 v_retval, u8 *msg, u16 msglen);\n int i40e_vc_process_vflr_event(struct i40e_pf *pf);\n-void i40e_reset_vf(struct i40e_vf *vf, bool flr);\n-void i40e_reset_all_vfs(struct i40e_pf *pf, bool flr);\n+bool i40e_reset_vf(struct i40e_vf *vf, bool flr);\n+bool i40e_reset_all_vfs(struct i40e_pf *pf, bool flr);\n void i40e_vc_notify_vf_reset(struct i40e_vf *vf);\n \n /* VF configuration related iplink handlers */\n", "prefixes": [ "next", "S78-V5", "07/12" ] }