Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48799/?format=api
https://patches.dpdk.org/api/patches/48799/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181214143720.34163-2-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": "<20181214143720.34163-2-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181214143720.34163-2-zhirun.yan@intel.com", "date": "2018-12-14T14:37:19", "name": "[v4,1/2] net/i40e: support VF request more queues", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "23013cbecdbd47c08854e6ccf351a0b0f2fefb75", "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/20181214143720.34163-2-zhirun.yan@intel.com/mbox/", "series": [ { "id": 2770, "url": "https://patches.dpdk.org/api/series/2770/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2770", "date": "2018-12-14T14:37:18", "name": "Support request more queues", "version": 4, "mbox": "https://patches.dpdk.org/series/2770/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/48799/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/48799/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 739171B5E7;\n\tFri, 14 Dec 2018 08:00:34 +0100 (CET)", "from mga11.intel.com (mga11.intel.com [192.55.52.93])\n\tby dpdk.org (Postfix) with ESMTP id 8C1901B6CD\n\tfor <dev@dpdk.org>; Fri, 14 Dec 2018 08:00:32 +0100 (CET)", "from fmsmga005.fm.intel.com ([10.253.24.32])\n\tby fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t13 Dec 2018 23:00:32 -0800", "from dpdk-server.sh.intel.com ([10.67.110.170])\n\tby fmsmga005.fm.intel.com with ESMTP; 13 Dec 2018 23:00:31 -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,351,1539673200\"; d=\"scan'208\";a=\"303762724\"", "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": "Fri, 14 Dec 2018 14:37:19 +0000", "Message-Id": "<20181214143720.34163-2-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20181214143720.34163-1-zhirun.yan@intel.com>", "References": "<20181213140505.14578-1-zhirun.yan@intel.com>\n\t<20181214143720.34163-1-zhirun.yan@intel.com>", "Subject": "[dpdk-dev] [PATCH v4 1/2] net/i40e: support VF request more 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": "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 | 62 ++++++++++++++++++++++++++++++-\n 1 file changed, 60 insertions(+), 2 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex 05dc6596b..a568fb528 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -359,6 +359,25 @@ 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 /*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\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\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 +1031,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 +1557,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 +1571,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 +2203,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": [ "v4", "1/2" ] }{ "id": 48799, "url": "