get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/750541/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 750541,
    "url": "http://patchwork.ozlabs.org/api/patches/750541/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170413084555.6962-8-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": "<20170413084555.6962-8-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-04-13T08:45:51",
    "name": "[next,S70,08/12] i40e: split some code in i40e_reset_vf into helpers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "af5fe225e4d658cb3de274b464fc4f4259d8df10",
    "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/20170413084555.6962-8-alice.michael@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/750541/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/750541/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 3w3mvg6z5Yz9s8Q\n\tfor <incoming@patchwork.ozlabs.org>;\n\tFri, 14 Apr 2017 02:48:47 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 8E50D8A679;\n\tThu, 13 Apr 2017 16:48:46 +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 a2OIEEPX6ftu; Thu, 13 Apr 2017 16:48:43 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 74AFB8A6A3;\n\tThu, 13 Apr 2017 16:48:38 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 2E84D1BFE90\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:34 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 20287889FC\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:34 +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 2K0mdrOjrM20 for <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:32 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id 1698E83167\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tThu, 13 Apr 2017 16:48:32 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Apr 2017 09:48:29 -0700",
            "from unknown (HELO localhost.jf.intel.com) ([10.166.16.121])\n\tby orsmga002.jf.intel.com with ESMTP; 13 Apr 2017 09:48:28 -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.37,195,1488873600\"; d=\"scan'208\";a=\"73711331\"",
        "From": "Alice Michael <alice.michael@intel.com>",
        "To": "alice.michael@intel.com,\n\tintel-wired-lan@lists.osuosl.org",
        "Date": "Thu, 13 Apr 2017 04:45:51 -0400",
        "Message-Id": "<20170413084555.6962-8-alice.michael@intel.com>",
        "X-Mailer": "git-send-email 2.9.3",
        "In-Reply-To": "<20170413084555.6962-1-alice.michael@intel.com>",
        "References": "<20170413084555.6962-1-alice.michael@intel.com>",
        "Subject": "[Intel-wired-lan] [next PATCH S70 08/12] i40e: split some code in\n\ti40e_reset_vf into helpers",
        "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\nA future patch is going to want to re-use some of the code in\ni40e_reset_vf, so lets break up the beginning and ending parts into\ntheir own helper functions. The first function will be used to\ninitialize the reset on a VF, while the second function will be used to\nfinalize the reset and restore functionality.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nChange-ID: I48df808b8bf09de3c2ed8c521f57b3f0ab9e5907\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 109 ++++++++++++++-------\n 1 file changed, 72 insertions(+), 37 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 f8d25cb..a09c2b3 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -923,22 +923,19 @@ static int i40e_quiesce_vf_pci(struct i40e_vf *vf)\n }\n \n /**\n- * i40e_reset_vf\n+ * i40e_trigger_vf_reset\n  * @vf: pointer to the VF structure\n  * @flr: VFLR was issued or not\n  *\n- * reset the VF\n+ * Trigger hardware to start a reset for a particular VF. Expects the caller\n+ * to wait the proper amount of time to allow hardware to reset the VF before\n+ * it cleans up and restores VF functionality.\n  **/\n-void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n+static void i40e_trigger_vf_reset(struct i40e_vf *vf, bool flr)\n {\n \tstruct i40e_pf *pf = vf->pf;\n \tstruct i40e_hw *hw = &pf->hw;\n \tu32 reg, reg_idx, bit_idx;\n-\tbool rsd = false;\n-\tint i;\n-\n-\tif (test_and_set_bit(__I40E_VF_DISABLE, &pf->state))\n-\t\treturn;\n \n \t/* warn the VF */\n \tclear_bit(I40E_VF_STAT_ACTIVE, &vf->vf_states);\n@@ -970,37 +967,22 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n \tif (i40e_quiesce_vf_pci(vf))\n \t\tdev_err(&pf->pdev->dev, \"VF %d PCI transactions stuck\\n\",\n \t\t\tvf->vf_id);\n+}\n \n-\t/* poll VPGEN_VFRSTAT reg to make sure\n-\t * that reset is complete\n-\t */\n-\tfor (i = 0; i < 10; i++) {\n-\t\t/* VF reset requires driver to first reset the VF and then\n-\t\t * poll the status register to make sure that the reset\n-\t\t * completed successfully. Due to internal HW FIFO flushes,\n-\t\t * we must wait 10ms before the register will be valid.\n-\t\t */\n-\t\tusleep_range(10000, 20000);\n-\t\treg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id));\n-\t\tif (reg & I40E_VPGEN_VFRSTAT_VFRD_MASK) {\n-\t\t\trsd = true;\n-\t\t\tbreak;\n-\t\t}\n-\t}\n-\n-\tif (flr)\n-\t\tusleep_range(10000, 20000);\n-\n-\tif (!rsd)\n-\t\tdev_err(&pf->pdev->dev, \"VF reset check timeout on VF %d\\n\",\n-\t\t\tvf->vf_id);\n-\n-\t/* On initial reset, we won't have any queues */\n-\tif (vf->lan_vsi_idx == 0)\n-\t\tgoto complete_reset;\n+/**\n+ * i40e_cleanup_reset_vf\n+ * @vf: pointer to the VF structure\n+ *\n+ * Cleanup a VF after the hardware reset is finished. Expects the caller to\n+ * have verified whether the reset is finished properly, and ensure the\n+ * minimum amount of wait time has passed.\n+ **/\n+static void i40e_cleanup_reset_vf(struct i40e_vf *vf)\n+{\n+\tstruct i40e_pf *pf = vf->pf;\n+\tstruct i40e_hw *hw = &pf->hw;\n+\tu32 reg;\n \n-\ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n-complete_reset:\n \t/* free VF resources to begin resetting the VSI state */\n \ti40e_free_vf_res(vf);\n \n@@ -1035,6 +1017,59 @@ void i40e_reset_vf(struct i40e_vf *vf, bool flr)\n \t * request resources immediately after setting this flag.\n \t */\n \twr32(hw, I40E_VFGEN_RSTAT1(vf->vf_id), I40E_VFR_VFACTIVE);\n+}\n+\n+/**\n+ * i40e_reset_vf\n+ * @vf: pointer to the VF structure\n+ * @flr: VFLR was issued or not\n+ *\n+ * reset the VF\n+ **/\n+void 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+\tbool rsd = false;\n+\tu32 reg;\n+\tint i;\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+\n+\ti40e_trigger_vf_reset(vf, flr);\n+\n+\t/* poll VPGEN_VFRSTAT reg to make sure\n+\t * that reset is complete\n+\t */\n+\tfor (i = 0; i < 10; i++) {\n+\t\t/* VF reset requires driver to first reset the VF and then\n+\t\t * poll the status register to make sure that the reset\n+\t\t * completed successfully. Due to internal HW FIFO flushes,\n+\t\t * we must wait 10ms before the register will be valid.\n+\t\t */\n+\t\tusleep_range(10000, 20000);\n+\t\treg = rd32(hw, I40E_VPGEN_VFRSTAT(vf->vf_id));\n+\t\tif (reg & I40E_VPGEN_VFRSTAT_VFRD_MASK) {\n+\t\t\trsd = true;\n+\t\t\tbreak;\n+\t\t}\n+\t}\n+\n+\tif (flr)\n+\t\tusleep_range(10000, 20000);\n+\n+\tif (!rsd)\n+\t\tdev_err(&pf->pdev->dev, \"VF reset check timeout on VF %d\\n\",\n+\t\t\tvf->vf_id);\n+\tusleep_range(10000, 20000);\n+\n+\t/* On initial reset, we don't have any queues to disable */\n+\tif (vf->lan_vsi_idx != 0)\n+\t\ti40e_vsi_stop_rings(pf->vsi[vf->lan_vsi_idx]);\n+\n+\ti40e_cleanup_reset_vf(vf);\n \n \ti40e_flush(hw);\n \tclear_bit(__I40E_VF_DISABLE, &pf->state);\n",
    "prefixes": [
        "next",
        "S70",
        "08/12"
    ]
}