get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49041,
    "url": "https://patches.dpdk.org/api/patches/49041/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181218160933.11113-3-zhirun.yan@intel.com/",
    "project": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20181218160933.11113-3-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181218160933.11113-3-zhirun.yan@intel.com",
    "date": "2018-12-18T16:09:32",
    "name": "[v6,2/3] net/i40e: support PF respond VF request more queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "47d71387bd21ad953a3c1c8c5d16688e25f18e0c",
    "submitter": {
        "id": 1154,
        "url": "https://patches.dpdk.org/api/people/1154/?format=api",
        "name": "Yan, Zhirun",
        "email": "zhirun.yan@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20181218160933.11113-3-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 2841,
            "url": "https://patches.dpdk.org/api/series/2841/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2841",
            "date": "2018-12-18T16:09:30",
            "name": "Support request more queues",
            "version": 6,
            "mbox": "https://patches.dpdk.org/series/2841/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/49041/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/49041/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DFB5F1BB0C;\n\tTue, 18 Dec 2018 09:32:45 +0100 (CET)",
            "from mga03.intel.com (mga03.intel.com [134.134.136.65])\n\tby dpdk.org (Postfix) with ESMTP id E18401B5F7\n\tfor <dev@dpdk.org>; Tue, 18 Dec 2018 09:32:41 +0100 (CET)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t18 Dec 2018 00:32:41 -0800",
            "from dpdk-server.sh.intel.com ([10.67.110.170])\n\tby fmsmga008.fm.intel.com with ESMTP; 18 Dec 2018 00:32:40 -0800"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.56,367,1539673200\"; d=\"scan'208\";a=\"110307280\"",
        "From": "Zhirun Yan <zhirun.yan@intel.com>",
        "To": "dev@dpdk.org,\n\tqi.z.zhang@intel.com",
        "Cc": "Zhirun Yan <zhirun.yan@intel.com>,\n\tHaiyue Wang <haiyue.wang@intel.com>",
        "Date": "Tue, 18 Dec 2018 16:09:32 +0000",
        "Message-Id": "<20181218160933.11113-3-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20181218160933.11113-1-zhirun.yan@intel.com>",
        "References": "<20181217111054.45414-1-zhirun.yan@intel.com>\n\t<20181218160933.11113-1-zhirun.yan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v6 2/3] net/i40e: support PF respond VF request\n\tmore queues",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "This patch respond the VIRTCHNL_OP_REQUEST_QUEUES msg from VF, and\nprocess to allocated more queues for the requested VF. If successful,\nPF will notify VF to reset. If unsuccessful, PF will send message to\ninform VF.\n\nSigned-off-by: Zhirun Yan <zhirun.yan@intel.com>\nSigned-off-by: Haiyue Wang <haiyue.wang@intel.com>\n---\n drivers/net/i40e/i40e_pf.c | 65 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 65 insertions(+)",
    "diff": "diff --git a/drivers/net/i40e/i40e_pf.c b/drivers/net/i40e/i40e_pf.c\nindex dd3962d38..da0e5d6c5 100644\n--- a/drivers/net/i40e/i40e_pf.c\n+++ b/drivers/net/i40e/i40e_pf.c\n@@ -1218,6 +1218,66 @@ i40e_notify_vf_link_status(struct rte_eth_dev *dev, struct i40e_pf_vf *vf)\n \t\t\tI40E_SUCCESS, (uint8_t *)&event, sizeof(event));\n }\n \n+/**\n+ * i40e_vc_notify_vf_reset\n+ * @vf: pointer to the VF structure\n+ *\n+ * indicate a pending reset to the given VF\n+ **/\n+static void\n+i40e_vc_notify_vf_reset(struct i40e_pf_vf *vf)\n+{\n+\tstruct i40e_hw *hw = I40E_PF_TO_HW(vf->pf);\n+\tstruct virtchnl_pf_event pfe;\n+\tint abs_vf_id;\n+\tuint16_t vf_id = vf->vf_idx;\n+\n+\tabs_vf_id = vf_id + hw->func_caps.vf_base_id;\n+\tpfe.event = VIRTCHNL_EVENT_RESET_IMPENDING;\n+\tpfe.severity = PF_EVENT_SEVERITY_CERTAIN_DOOM;\n+\ti40e_aq_send_msg_to_vf(hw, abs_vf_id, VIRTCHNL_OP_EVENT, 0, (u8 *)&pfe,\n+\t\t\t       sizeof(struct virtchnl_pf_event), NULL);\n+}\n+\n+static int\n+i40e_pf_host_process_cmd_request_queues(struct i40e_pf_vf *vf, uint8_t *msg)\n+{\n+\tstruct virtchnl_vf_res_request *vfres =\n+\t\t(struct virtchnl_vf_res_request *)msg;\n+\tstruct i40e_pf *pf;\n+\tuint32_t req_pairs = vfres->num_queue_pairs;\n+\tuint32_t cur_pairs = vf->vsi->nb_used_qps;\n+\n+\tpf = vf->pf;\n+\n+\tif (req_pairs <= 0) {\n+\t\tPMD_DRV_LOG(ERR, \"VF %d tried to request %d queues. Ignoring.\\n\",\n+\t\t\t    vf->vf_idx,\n+\t\t\t    I40E_MAX_QP_NUM_PER_VF);\n+\t} else if (req_pairs > I40E_MAX_QP_NUM_PER_VF) {\n+\t\tPMD_DRV_LOG(ERR, \"VF %d tried to request more than %d queues.\\n\",\n+\t\t\t    vf->vf_idx,\n+\t\t\t    I40E_MAX_QP_NUM_PER_VF);\n+\t\tvfres->num_queue_pairs = I40E_MAX_QP_NUM_PER_VF;\n+\t} else if (req_pairs > cur_pairs + pf->qp_pool.num_free) {\n+\t\tPMD_DRV_LOG(ERR, \"VF %d requested %d more queues, but noly %d left\\n\",\n+\t\t\t    vf->vf_idx,\n+\t\t\t    req_pairs - cur_pairs,\n+\t\t\t    pf->qp_pool.num_free);\n+\t\tvfres->num_queue_pairs = pf->qp_pool.num_free + cur_pairs;\n+\t} else {\n+\t\ti40e_vc_notify_vf_reset(vf);\n+\t\tvf->vsi->nb_qps = req_pairs;\n+\t\tpf->vf_nb_qps = req_pairs;\n+\t\ti40e_pf_host_process_cmd_reset_vf(vf);\n+\n+\t\treturn 0;\n+\t}\n+\n+\treturn i40e_pf_host_send_msg_to_vf(vf, VIRTCHNL_OP_REQUEST_QUEUES, 0,\n+\t\t\t\t(u8 *)vfres, sizeof(*vfres));\n+}\n+\n void\n i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,\n \t\t\t   uint16_t abs_vf_id, uint32_t opcode,\n@@ -1351,6 +1411,11 @@ i40e_pf_host_handle_vf_msg(struct rte_eth_dev *dev,\n \t\tPMD_DRV_LOG(INFO, \"OP_CONFIG_RSS_KEY received\");\n \t\ti40e_pf_host_process_cmd_set_rss_key(vf, msg, msglen, b_op);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n+\t\tPMD_DRV_LOG(INFO, \"OP_REQUEST_QUEUES received\");\n+\t\ti40e_pf_host_process_cmd_request_queues(vf, msg);\n+\t\tbreak;\n+\n \t/* Don't add command supported below, which will\n \t * return an error code.\n \t */\n",
    "prefixes": [
        "v6",
        "2/3"
    ]
}