get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 860158,
    "url": "http://patchwork.ozlabs.org/api/patches/860158/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/patch/20180112193251.11739-6-jeffrey.t.kirsher@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": "<20180112193251.11739-6-jeffrey.t.kirsher@intel.com>",
    "list_archive_url": null,
    "date": "2018-01-12T19:32:45",
    "name": "[06/12] i40e: Delete queue channel for ADq on VF",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": false,
    "hash": "ae51fa95595cbd28e37f5ac665b6b0efff72a808",
    "submitter": {
        "id": 473,
        "url": "http://patchwork.ozlabs.org/api/people/473/?format=api",
        "name": "Kirsher, Jeffrey T",
        "email": "jeffrey.t.kirsher@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/20180112193251.11739-6-jeffrey.t.kirsher@intel.com/mbox/",
    "series": [
        {
            "id": 23043,
            "url": "http://patchwork.ozlabs.org/api/series/23043/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/intel-wired-lan/list/?series=23043",
            "date": "2018-01-12T19:32:45",
            "name": "[01/12] i40evf: Fix link up issue when queues are disabled",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/23043/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/860158/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/860158/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.137; helo=fraxinus.osuosl.org;\n\tenvelope-from=intel-wired-lan-bounces@osuosl.org;\n\treceiver=<UNKNOWN>)",
        "Received": [
            "from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137])\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 3zJCZZ33hbz9sPk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tSat, 13 Jan 2018 06:32:54 +1100 (AEDT)",
            "from localhost (localhost [127.0.0.1])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ECA39887A4;\n\tFri, 12 Jan 2018 19:32:52 +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 j9kQ_F1BWnc1; Fri, 12 Jan 2018 19:32:51 +0000 (UTC)",
            "from ash.osuosl.org (ash.osuosl.org [140.211.166.34])\n\tby fraxinus.osuosl.org (Postfix) with ESMTP id ABC178876B;\n\tFri, 12 Jan 2018 19:32:51 +0000 (UTC)",
            "from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])\n\tby ash.osuosl.org (Postfix) with ESMTP id 642DE1C002D\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:49 +0000 (UTC)",
            "from localhost (localhost [127.0.0.1])\n\tby hemlock.osuosl.org (Postfix) with ESMTP id 5E96589F18\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:49 +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 jQUoiBb2g9ey for <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:48 +0000 (UTC)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby hemlock.osuosl.org (Postfix) with ESMTPS id 6F93589EF7\n\tfor <intel-wired-lan@lists.osuosl.org>;\n\tFri, 12 Jan 2018 19:32:48 +0000 (UTC)",
            "from orsmga003.jf.intel.com ([10.7.209.27])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Jan 2018 11:32:47 -0800",
            "from jtkirshe-nuc.jf.intel.com ([134.134.177.151])\n\tby orsmga003.jf.intel.com with ESMTP; 12 Jan 2018 11:32:47 -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-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.46,350,1511856000\"; d=\"scan'208\";a=\"19654876\"",
        "From": "Jeff Kirsher <jeffrey.t.kirsher@intel.com>",
        "To": "intel-wired-lan@lists.osuosl.org",
        "Date": "Fri, 12 Jan 2018 11:32:45 -0800",
        "Message-Id": "<20180112193251.11739-6-jeffrey.t.kirsher@intel.com>",
        "X-Mailer": "git-send-email 2.14.3",
        "In-Reply-To": "<20180112193251.11739-1-jeffrey.t.kirsher@intel.com>",
        "References": "<20180112193251.11739-1-jeffrey.t.kirsher@intel.com>",
        "Subject": "[Intel-wired-lan] [PATCH 06/12] i40e: Delete queue channel for ADq\n\ton VF",
        "X-BeenThere": "intel-wired-lan@osuosl.org",
        "X-Mailman-Version": "2.1.24",
        "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: Avinash Dayanand <avinash.dayanand@intel.com>\n\nThis patch takes care of freeing up all the VSIs, queues and\nother ADq related software and hardware resources, when a user\nrequests for deletion of ADq on VF.\n\nExample command:\ntc qdisc del dev eth0 root\n\nSigned-off-by: Avinash Dayanand <avinash.dayanand@intel.com>\n---\n drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 63 ++++++++++++++++++++++\n 1 file changed, 63 insertions(+)",
    "diff": "diff --git a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\nindex 7d939a5dc6a9..0c1c699c0dc0 100644\n--- a/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n+++ b/drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c\n@@ -1672,6 +1672,27 @@ static int i40e_vc_get_version_msg(struct i40e_vf *vf, u8 *msg)\n \t\t\t\t      sizeof(struct virtchnl_version_info));\n }\n \n+/**\n+ * i40e_del_qch - delete all the additional VSI's created as a part of ADq\n+ * @vf: pointer to VF structure\n+ **/\n+static void i40e_del_qch(struct i40e_vf *vf)\n+{\n+\tstruct i40e_pf *pf = vf->pf;\n+\tint i;\n+\n+\t/* first element in the array belongs to primary VF VSI and we shouldn't\n+\t * delete it. we should however delete the rest of the VSIs created\n+\t */\n+\tfor (i = 1; i < vf->num_tc; i++) {\n+\t\tif (vf->ch[i].vsi_idx) {\n+\t\t\ti40e_vsi_release(pf->vsi[vf->ch[i].vsi_idx]);\n+\t\t\tvf->ch[i].vsi_idx = 0;\n+\t\t\tvf->ch[i].vsi_id = 0;\n+\t\t}\n+\t}\n+}\n+\n /**\n  * i40e_vc_get_vf_resources_msg\n  * @vf: pointer to the VF info\n@@ -2978,6 +2999,45 @@ static int i40e_vc_add_qch_msg(struct i40e_vf *vf, u8 *msg)\n \t\t\t\t       aq_ret);\n }\n \n+/**\n+ * i40e_vc_del_qch_msg\n+ * @vf: pointer to the VF info\n+ * @msg: pointer to the msg buffer\n+ **/\n+static int i40e_vc_del_qch_msg(struct i40e_vf *vf, u8 *msg)\n+{\n+\tstruct i40e_pf *pf = vf->pf;\n+\ti40e_status aq_ret = 0;\n+\n+\tif (!test_bit(I40E_VF_STATE_ACTIVE, &vf->vf_states)) {\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t\tgoto err;\n+\t}\n+\n+\tif (vf->adq_enabled) {\n+\t\ti40e_del_qch(vf);\n+\t\tvf->adq_enabled = false;\n+\t\tvf->num_tc = 0;\n+\t\tdev_info(&pf->pdev->dev,\n+\t\t\t \"Deleting Queue Channels for ADq on VF %d\\n\",\n+\t\t\t vf->vf_id);\n+\t} else {\n+\t\tdev_info(&pf->pdev->dev, \"VF %d trying to delete queue channels but ADq isn't enabled\\n\",\n+\t\t\t vf->vf_id);\n+\t\taq_ret = I40E_ERR_PARAM;\n+\t}\n+\n+\t/* reset the VF in order to allocate resources */\n+\ti40e_vc_notify_vf_reset(vf);\n+\ti40e_reset_vf(vf, false);\n+\n+\treturn I40E_SUCCESS;\n+\n+err:\n+\treturn i40e_vc_send_resp_to_vf(vf, VIRTCHNL_OP_DISABLE_CHANNELS,\n+\t\t\t\t       aq_ret);\n+}\n+\n /**\n  * i40e_vc_process_vf_msg\n  * @pf: pointer to the PF structure\n@@ -3110,6 +3170,9 @@ int i40e_vc_process_vf_msg(struct i40e_pf *pf, s16 vf_id, u32 v_opcode,\n \tcase VIRTCHNL_OP_ENABLE_CHANNELS:\n \t\tret = i40e_vc_add_qch_msg(vf, msg);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_DISABLE_CHANNELS:\n+\t\tret = i40e_vc_del_qch_msg(vf, msg);\n+\t\tbreak;\n \tcase VIRTCHNL_OP_UNKNOWN:\n \tdefault:\n \t\tdev_err(&pf->pdev->dev, \"Unsupported opcode %d from VF %d\\n\",\n",
    "prefixes": [
        "06/12"
    ]
}