get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1086481,
    "url": "http://patchwork.ozlabs.org/api/patches/1086481/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20190416173052.28928-16-anirudh.venkataramanan@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": "<20190416173052.28928-16-anirudh.venkataramanan@intel.com>",
    "list_archive_url": null,
    "date": "2019-04-16T17:30:52",
    "name": "[S20,15/15] ice: Use GLINT_DYN_CTL to disable VF's interrupts",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "cc8f681710cd99c15e99e4f280a8ad1443c6d4c6",
    "submitter": {
        "id": 73601,
        "url": "http://patchwork.ozlabs.org/api/people/73601/?format=api",
        "name": "Anirudh Venkataramanan",
        "email": "anirudh.venkataramanan@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/20190416173052.28928-16-anirudh.venkataramanan@intel.com/mbox/",
    "series": [
        {
            "id": 103108,
            "url": "http://patchwork.ozlabs.org/api/series/103108/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=103108",
            "date": "2019-04-16T17:30:37",
            "name": "Fixes and feature updates for ice",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/103108/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/1086481/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/1086481/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>)",
            "ozlabs.org;\n\tdmarc=fail (p=none dis=none) header.from=intel.com"
        ],
        "Received": [
            "from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138])\n\t(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256\n\tbits)) (No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 44kC8n601Zz9s3l\n\tfor <incoming@patchwork.ozlabs.org>;\n\tWed, 17 Apr 2019 03:31:37 +1000 (AEST)",
            "from localhost (localhost [127.0.0.1])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id 23926870EA;\n\tTue, 16 Apr 2019 17:31:36 +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 L7QVu6ukE74s; Tue, 16 Apr 2019 17:31:31 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby whitealder.osuosl.org (Postfix) with ESMTP id D085A870B3;\n\tTue, 16 Apr 2019 17:31:30 +0000 (UTC)",
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\n\tby ash.osuosl.org (Postfix) with ESMTP id B53A11C1626\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:31:28 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id B320F85F0F\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:31:28 +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 t8XHQVuDIl1Z for <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:31:27 +0000 (UTC)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby fraxinus.osuosl.org (Postfix) with ESMTPS id CD7BE85E8C\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tTue, 16 Apr 2019 17:31:27 +0000 (UTC)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t16 Apr 2019 10:31:25 -0700",
            "from shasta.jf.intel.com ([10.166.244.191])\n\tby orsmga002.jf.intel.com with ESMTP; 16 Apr 2019 10:31:25 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.60,358,1549958400\"; d=\"scan'208\";a=\"151390494\"",
        "From": "Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Tue, 16 Apr 2019 10:30:52 -0700",
        "Message-Id": "<20190416173052.28928-16-anirudh.venkataramanan@intel.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "In-Reply-To": "<20190416173052.28928-1-anirudh.venkataramanan@intel.com>",
        "References": "<20190416173052.28928-1-anirudh.venkataramanan@intel.com>",
        "MIME-Version": "1.0",
        "Subject": "[Intel-wired-lan] [PATCH S20 15/15] ice: Use GLINT_DYN_CTL to\n\tdisable VF's interrupts",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.29",
        "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>",
        "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: Brett Creeley <brett.creeley@intel.com>\n\nCurrently in ice_free_vf_res() we are writing to the VFINT_DYN_CTLN\nregister in the PF's function space to disable all VF's interrupts. This\nis incorrect because this register is only for use in the VF's function\nspace. This becomes obvious when seeing that the valid indices used for\nthe VFINT_DYN_CTLN register is from 0-63, which is the maximum number of\ninterrupts for a VF (not including the OICR interrupt). Fix this by\nwriting to the GLINT_DYN_CTL register for each VF. We can do this\nbecause we keep track of each VF's first_vector_idx inside of the PF's\nfunction space and the number of interrupts given to each VF.\n\nAlso in ice_free_vfs() we were disabling Rx/Tx queues after calling\npci_disable_sriov(). One part of disabling the Tx queues causes the PF\ndriver to trigger a software interrupt, which causes the VF's napi\nroutine to run. This doesn't currently work because pci_disable_sriov()\ncauses iavf_remove() to be called which disables interrupts. Fix this by\ndisabling Rx/Tx queues prior to pci_disable_sriov().\n\nSigned-off-by: Brett Creeley <brett.creeley@intel.com>\nSigned-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com>\n---\n .../net/ethernet/intel/ice/ice_virtchnl_pf.c  | 41 ++++++-------------\n 1 file changed, 13 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\nindex 0f79cf0e4ee8..9c6d9c95f4f6 100644\n--- a/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/ice/ice_virtchnl_pf.c\n@@ -140,18 +140,6 @@ static void ice_vc_notify_vf_link_state(struct ice_vf *vf)\n \t\t\t      sizeof(pfe), NULL);\n }\n \n-/**\n- * ice_get_vf_vector - get VF interrupt vector register offset\n- * @vf_msix: number of MSIx vector per VF on a PF\n- * @vf_id: VF identifier\n- * @i: index of MSIx vector\n- */\n-static u32 ice_get_vf_vector(int vf_msix, int vf_id, int i)\n-{\n-\treturn ((i == 0) ? VFINT_DYN_CTLN(vf_id) :\n-\t\t VFINT_DYN_CTLN(((vf_msix - 1) * (vf_id)) + (i - 1)));\n-}\n-\n /**\n  * ice_free_vf_res - Free a VF's resources\n  * @vf: pointer to the VF info\n@@ -159,7 +147,7 @@ static u32 ice_get_vf_vector(int vf_msix, int vf_id, int i)\n static void ice_free_vf_res(struct ice_vf *vf)\n {\n \tstruct ice_pf *pf = vf->pf;\n-\tint i, pf_vf_msix;\n+\tint i, last_vector_idx;\n \n \t/* First, disable VF's configuration API to prevent OS from\n \t * accessing the VF's VSI after it's freed or invalidated.\n@@ -174,13 +162,10 @@ static void ice_free_vf_res(struct ice_vf *vf)\n \t\tvf->num_mac = 0;\n \t}\n \n-\tpf_vf_msix = pf->num_vf_msix;\n+\tlast_vector_idx = vf->first_vector_idx + pf->num_vf_msix - 1;\n \t/* Disable interrupts so that VF starts in a known state */\n-\tfor (i = 0; i < pf_vf_msix; i++) {\n-\t\tu32 reg_idx;\n-\n-\t\treg_idx = ice_get_vf_vector(pf_vf_msix, vf->vf_id, i);\n-\t\twr32(&pf->hw, reg_idx, VFINT_DYN_CTLN_CLEARPBA_M);\n+\tfor (i = vf->first_vector_idx; i <= last_vector_idx; i++) {\n+\t\twr32(&pf->hw, GLINT_DYN_CTL(i), GLINT_DYN_CTL_CLEARPBA_M);\n \t\tice_flush(&pf->hw);\n \t}\n \t/* reset some of the state variables keeping track of the resources */\n@@ -281,15 +266,6 @@ void ice_free_vfs(struct ice_pf *pf)\n \twhile (test_and_set_bit(__ICE_VF_DIS, pf->state))\n \t\tusleep_range(1000, 2000);\n \n-\t/* Disable IOV before freeing resources. This lets any VF drivers\n-\t * running in the host get themselves cleaned up before we yank\n-\t * the carpet out from underneath their feet.\n-\t */\n-\tif (!pci_vfs_assigned(pf->pdev))\n-\t\tpci_disable_sriov(pf->pdev);\n-\telse\n-\t\tdev_warn(&pf->pdev->dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n-\n \t/* Avoid wait time by stopping all VFs at the same time */\n \tfor (i = 0; i < pf->num_alloc_vfs; i++) {\n \t\tstruct ice_vsi *vsi;\n@@ -305,6 +281,15 @@ void ice_free_vfs(struct ice_pf *pf)\n \t\tclear_bit(ICE_VF_STATE_ENA, pf->vf[i].vf_states);\n \t}\n \n+\t/* Disable IOV before freeing resources. This lets any VF drivers\n+\t * running in the host get themselves cleaned up before we yank\n+\t * the carpet out from underneath their feet.\n+\t */\n+\tif (!pci_vfs_assigned(pf->pdev))\n+\t\tpci_disable_sriov(pf->pdev);\n+\telse\n+\t\tdev_warn(&pf->pdev->dev, \"VFs are assigned - not disabling SR-IOV\\n\");\n+\n \ttmp = pf->num_alloc_vfs;\n \tpf->num_vf_qps = 0;\n \tpf->num_alloc_vfs = 0;\n",
    "prefixes": [
        "S20",
        "15/15"
    ]
}