get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 49159,
    "url": "http://patches.dpdk.org/api/patches/49159/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20181220110130.37913-2-zhirun.yan@intel.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<20181220110130.37913-2-zhirun.yan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20181220110130.37913-2-zhirun.yan@intel.com",
    "date": "2018-12-20T11:01:28",
    "name": "[v9,1/3] net/i40e: support VF request more queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "42a1e94e9d852ea8d53006a58dbe8700f810baba",
    "submitter": {
        "id": 1154,
        "url": "http://patches.dpdk.org/api/people/1154/?format=api",
        "name": "Yan, Zhirun",
        "email": "zhirun.yan@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20181220110130.37913-2-zhirun.yan@intel.com/mbox/",
    "series": [
        {
            "id": 2886,
            "url": "http://patches.dpdk.org/api/series/2886/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=2886",
            "date": "2018-12-20T11:01:27",
            "name": "[v9,1/3] net/i40e: support VF request more queues",
            "version": 9,
            "mbox": "http://patches.dpdk.org/series/2886/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/49159/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/49159/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 F0F7B1B94B;\n\tThu, 20 Dec 2018 04:24:45 +0100 (CET)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n\tby dpdk.org (Postfix) with ESMTP id E9C091B5F7\n\tfor <dev@dpdk.org>; Thu, 20 Dec 2018 04:24:42 +0100 (CET)",
            "from fmsmga001.fm.intel.com ([10.253.24.23])\n\tby orsmga104.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Dec 2018 19:24:42 -0800",
            "from dpdk-server.sh.intel.com ([10.67.110.170])\n\tby fmsmga001.fm.intel.com with ESMTP; 19 Dec 2018 19:24:41 -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,375,1539673200\"; d=\"scan'208\";a=\"131453969\"",
        "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": "Thu, 20 Dec 2018 11:01:28 +0000",
        "Message-Id": "<20181220110130.37913-2-zhirun.yan@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20181220110130.37913-1-zhirun.yan@intel.com>",
        "References": "<20181220110130.37913-1-zhirun.yan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v9 1/3] net/i40e: support VF request more queues",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "Reply-To": "20181219133743.57423-1-zhirun.yan@intel.com",
        "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": "Before this patch, VF gets a default number of queues from the PF.\nThis patch enables VF to request a different number. When VF configures\nmore queues, it will send VIRTCHNL_OP_REQUEST_QUEUES to PF to request\nmore queues, if success, PF will reset the VF.\n\nUser can run \"port stop all\", \"port config port_id rxq/txq queue_num\"\nand \"port start all\" to reconfigure queue number.\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_ethdev_vf.c | 65 ++++++++++++++++++++++++++++++-\n 1 file changed, 63 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex 05dc6596b..bd2cecafa 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -359,6 +359,28 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)\n \t\t} while (i++ < MAX_TRY_TIMES);\n \t\t_clear_cmd(vf);\n \t\tbreak;\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n+\t\t/**\n+\t\t * ignore async reply, only wait for system message,\n+\t\t * vf_reset = true if get VIRTCHNL_EVENT_RESET_IMPENDING,\n+\t\t * if not, means request queues failed.\n+\t\t */\n+\t\terr = -1;\n+\t\tdo {\n+\t\t\tret = i40evf_read_pfmsg(dev, &info);\n+\t\t\tvf->cmd_retval = info.result;\n+\t\t\tif (ret == I40EVF_MSG_SYS && vf->vf_reset) {\n+\t\t\t\terr = 0;\n+\t\t\t\tbreak;\n+\t\t\t} else if (ret == I40EVF_MSG_ERR ||\n+\t\t\t\t\t   ret == I40EVF_MSG_CMD) {\n+\t\t\t\tbreak;\n+\t\t\t}\n+\t\t\trte_delay_ms(ASQ_DELAY_MS);\n+\t\t\t/* If don't read msg or read sys event, continue */\n+\t\t} while (i++ < MAX_TRY_TIMES);\n+\t\t_clear_cmd(vf);\n+\t\tbreak;\n \n \tdefault:\n \t\t/* for other adminq in running time, waiting the cmd done flag */\n@@ -1012,6 +1034,28 @@ i40evf_add_vlan(struct rte_eth_dev *dev, uint16_t vlanid)\n \treturn err;\n }\n \n+static int\n+i40evf_request_queues(struct rte_eth_dev *dev, uint16_t num)\n+{\n+\tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n+\tstruct virtchnl_vf_res_request vfres;\n+\tstruct vf_cmd_info args;\n+\tint err;\n+\n+\tvfres.num_queue_pairs = num;\n+\n+\targs.ops = VIRTCHNL_OP_REQUEST_QUEUES;\n+\targs.in_args = (u8 *)&vfres;\n+\targs.in_args_size = sizeof(vfres);\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = I40E_AQ_BUF_SZ;\n+\terr = i40evf_execute_vf_cmd(dev, &args);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command OP_REQUEST_QUEUES\");\n+\n+\treturn err;\n+}\n+\n static int\n i40evf_del_vlan(struct rte_eth_dev *dev, uint16_t vlanid)\n {\n@@ -1516,8 +1560,11 @@ RTE_PMD_REGISTER_KMOD_DEP(net_i40e_vf, \"* igb_uio | vfio-pci\");\n static int\n i40evf_dev_configure(struct rte_eth_dev *dev)\n {\n+\tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct i40e_adapter *ad =\n \t\tI40E_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tuint16_t num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,\n+\t\t\t\tdev->data->nb_tx_queues);\n \n \t/* Initialize to TRUE. If any of Rx queues doesn't meet the bulk\n \t * allocation or vector Rx preconditions we will reset it.\n@@ -1527,6 +1574,20 @@ i40evf_dev_configure(struct rte_eth_dev *dev)\n \tad->tx_simple_allowed = true;\n \tad->tx_vec_allowed = true;\n \n+\tif (num_queue_pairs > vf->vsi_res->num_queue_pairs) {\n+\t\tint ret = 0;\n+\n+\t\tPMD_DRV_LOG(INFO, \"change queue pairs from %u to %u\",\n+\t\t\t    vf->vsi_res->num_queue_pairs, num_queue_pairs);\n+\t\tret = i40evf_request_queues(dev, num_queue_pairs);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\n+\t\tret = i40evf_dev_reset(dev);\n+\t\tif (ret != 0)\n+\t\t\treturn ret;\n+\t}\n+\n \treturn i40evf_init_vlan(dev);\n }\n \n@@ -2145,8 +2206,8 @@ i40evf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n {\n \tstruct i40e_vf *vf = I40EVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \n-\tdev_info->max_rx_queues = vf->vsi_res->num_queue_pairs;\n-\tdev_info->max_tx_queues = vf->vsi_res->num_queue_pairs;\n+\tdev_info->max_rx_queues = I40E_MAX_QP_NUM_PER_VF;\n+\tdev_info->max_tx_queues = I40E_MAX_QP_NUM_PER_VF;\n \tdev_info->min_rx_bufsize = I40E_BUF_SIZE_MIN;\n \tdev_info->max_rx_pktlen = I40E_FRAME_SIZE_MAX;\n \tdev_info->hash_key_size = (I40E_VFQF_HKEY_MAX_INDEX + 1) * sizeof(uint32_t);\n",
    "prefixes": [
        "v9",
        "1/3"
    ]
}