get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 798913,
    "url": "http://patchwork.ozlabs.org/api/patches/798913/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20170807131812.86747-4-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-4-alice.michael@intel.com>",
    "list_archive_url": null,
    "date": "2017-08-07T13:18:04",
    "name": "[next,S78-V5,04/12] i40e: don't hold spinlock while resetting VF",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": false,
    "hash": "031b2fccdec4990fa708f8997093e38c7d77729f",
    "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-4-alice.michael@intel.com/mbox/",
    "series": [],
    "comments": "http://patchwork.ozlabs.org/api/patches/798913/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/798913/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.133; helo=hemlock.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "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 3xR9Vb0flvz9sNV\n\tfor <incoming@patchwork.ozlabs.org>;\n\tTue,  8 Aug 2017 07:23:03 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 6CB0B86963;\n\tMon,  7 Aug 2017 21:23:01 +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 ZCPBgP8tpt-t; Mon,  7 Aug 2017 21:22:58 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id D32AA86C7B;\n\tMon,  7 Aug 2017 21:22:58 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id 41CF81C203E\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Aug 2017 21:22:51 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id 3C8BB860FD\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Aug 2017 21:22:51 +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 95oBoPMQ1T-X for <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Aug 2017 21:22:45 +0000 (UTC)",
            "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id DA0B385FFF\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tMon,  7 Aug 2017 21:22:44 +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=\"116660463\"",
        "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:04 -0400",
        "Message-Id": "<20170807131812.86747-4-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 04/12] i40e: don't hold\n\tspinlock while resetting 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\nWhen we refactored handling of the PVID in commit 9af52f60b2d9\n(\"i40e: use (add|rm)_vlan_all_mac helper functions when changing PVID\")\nwe introduced a scheduling while atomic regression.\n\nThis occurred because we now held the spinlock across a call to\ni40e_reset_vf(), which results in a usleep_range() call that triggers\na scheduling while atomic bug. This was rare as it only occurred if the\nuser configured a VLAN on a VF and also attempted to reconfigure the VF\nfrom the host system with a port VLAN.\n\nWe do need to hold the lock while calling i40e_is_vsi_in_vlan(), but we\nshould not be holding it while we reset the VF.\n\nWe'll fix this by introducing a separate helper function\ni40e_vsi_has_vlans which checks whether we have a PVID and whether the\nVSI has configured VLANs. This helper function will manage its own need\nfor the mac_filter_hash_lock.\n\nThen, we can move the acquiring of the spinlock until after we reset the\nVF, which ensures that we do not sleep while holding the lock.\n\nUsing a separate function like this makes the code more clear and is\neasier to read than attempting to release and re-acquire the spinlock\nwhen we reset the VF.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 36 +++++++++++++++++++---\n 1 file changed, 32 insertions(+), 4 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 f78aa7e..fd85dd8 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -2922,6 +2922,34 @@ int i40e_ndo_set_vf_mac(struct net_device *netdev, int vf_id, u8 *mac)\n }\n \n /**\n+ * i40e_vsi_has_vlans - True if VSI has configured VLANs\n+ * @vsi: pointer to the vsi\n+ *\n+ * Check if a VSI has configured any VLANs. False if we have a port VLAN or if\n+ * we have no configured VLANs. Do not call while holding the\n+ * mac_filter_hash_lock.\n+ */\n+static bool i40e_vsi_has_vlans(struct i40e_vsi *vsi)\n+{\n+\tbool have_vlans;\n+\n+\t/* If we have a port VLAN, then the VSI cannot have any VLANs\n+\t * configured, as all MAC/VLAN filters will be assigned to the PVID.\n+\t */\n+\tif (vsi->info.pvid)\n+\t\treturn false;\n+\n+\t/* Since we don't have a PVID, we know that if the device is in VLAN\n+\t * mode it must be because of a VLAN filter configured on this VSI.\n+\t */\n+\tspin_lock_bh(&vsi->mac_filter_hash_lock);\n+\thave_vlans = i40e_is_vsi_in_vlan(vsi);\n+\tspin_unlock_bh(&vsi->mac_filter_hash_lock);\n+\n+\treturn have_vlans;\n+}\n+\n+/**\n  * i40e_ndo_set_vf_port_vlan\n  * @netdev: network interface device structure\n  * @vf_id: VF identifier\n@@ -2973,10 +3001,7 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,\n \t\t/* duplicate request, so just return success */\n \t\tgoto error_pvid;\n \n-\t/* Locked once because multiple functions below iterate list */\n-\tspin_lock_bh(&vsi->mac_filter_hash_lock);\n-\n-\tif (le16_to_cpu(vsi->info.pvid) == 0 && i40e_is_vsi_in_vlan(vsi)) {\n+\tif (i40e_vsi_has_vlans(vsi)) {\n \t\tdev_err(&pf->pdev->dev,\n \t\t\t\"VF %d has already configured VLAN filters and the administrator is requesting a port VLAN override.\\nPlease unload and reload the VF driver for this change to take effect.\\n\",\n \t\t\tvf_id);\n@@ -2989,6 +3014,9 @@ int i40e_ndo_set_vf_port_vlan(struct net_device *netdev, int vf_id,\n \t\tvsi = pf->vsi[vf->lan_vsi_idx];\n \t}\n \n+\t/* Locked once because multiple functions below iterate list */\n+\tspin_lock_bh(&vsi->mac_filter_hash_lock);\n+\n \t/* Check for condition where there was already a port VLAN ID\n \t * filter set and now it is being deleted by setting it to zero.\n \t * Additionally check for the condition where there was a port\n",
    "prefixes": [
        "next",
        "S78-V5",
        "04/12"
    ]
}