Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/48743/?format=api
https://patches.dpdk.org/api/patches/48743/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20181213140505.14578-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": "<20181213140505.14578-2-zhirun.yan@intel.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20181213140505.14578-2-zhirun.yan@intel.com", "date": "2018-12-13T14:05:04", "name": "[v3,1/2] net/i40e: support VF request more queues", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6061358f9790cb46216fb17dbeb1efe9e36b4907", "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/20181213140505.14578-2-zhirun.yan@intel.com/mbox/", "series": [ { "id": 2752, "url": "https://patches.dpdk.org/api/series/2752/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=2752", "date": "2018-12-13T14:05:03", "name": "Support request more queues", "version": 3, "mbox": "https://patches.dpdk.org/series/2752/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/48743/comments/", "check": "success", "checks": "https://patches.dpdk.org/api/patches/48743/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 CCCB01B4A1;\n\tThu, 13 Dec 2018 07:28:15 +0100 (CET)", "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 427DC1B49D\n\tfor <dev@dpdk.org>; Thu, 13 Dec 2018 07:28:13 +0100 (CET)", "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t12 Dec 2018 22:28:13 -0800", "from dpdk-server.sh.intel.com ([10.67.110.170])\n\tby orsmga006.jf.intel.com with ESMTP; 12 Dec 2018 22:28:11 -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,347,1539673200\"; d=\"scan'208\";a=\"100324365\"", "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, 13 Dec 2018 14:05:04 +0000", "Message-Id": "<20181213140505.14578-2-zhirun.yan@intel.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20181213140505.14578-1-zhirun.yan@intel.com>", "References": "<20181128165806.78934-1-zhirun.yan@intel.com>\n\t<20181213140505.14578-1-zhirun.yan@intel.com>", "Subject": "[dpdk-dev] [PATCH v3 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 | 56 ++++++++++++++++++++++++++++---\n 1 file changed, 52 insertions(+), 4 deletions(-)", "diff": "diff --git a/drivers/net/i40e/i40e_ethdev_vf.c b/drivers/net/i40e/i40e_ethdev_vf.c\nindex cecedc91f..50e3f1f4f 100644\n--- a/drivers/net/i40e/i40e_ethdev_vf.c\n+++ b/drivers/net/i40e/i40e_ethdev_vf.c\n@@ -343,6 +343,7 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)\n \t\terr = 0;\n \t\tbreak;\n \tcase VIRTCHNL_OP_VERSION:\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n \tcase VIRTCHNL_OP_GET_VF_RESOURCES:\n \t\t/* for init adminq commands, need to poll the response */\n \t\terr = -1;\n@@ -350,8 +351,15 @@ i40evf_execute_vf_cmd(struct rte_eth_dev *dev, struct vf_cmd_info *args)\n \t\t\tret = i40evf_read_pfmsg(dev, &info);\n \t\t\tvf->cmd_retval = info.result;\n \t\t\tif (ret == I40EVF_MSG_CMD) {\n-\t\t\t\terr = 0;\n+\t\t\t\tif (info.ops != VIRTCHNL_OP_REQUEST_QUEUES)\n+\t\t\t\t\terr = 0;\n \t\t\t\tbreak;\n+\t\t\t} else if (ret == I40EVF_MSG_SYS) {\n+\t\t\t\tif (args->ops == VIRTCHNL_OP_REQUEST_QUEUES &&\n+\t\t\t\t\tvf->vf_reset) {\n+\t\t\t\t\terr = 0;\n+\t\t\t\t\tbreak;\n+\t\t\t\t}\n \t\t\t} else if (ret == I40EVF_MSG_ERR)\n \t\t\t\tbreak;\n \t\t\trte_delay_ms(ASQ_DELAY_MS);\n@@ -1012,6 +1020,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@@ -1515,8 +1545,12 @@ 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+\tint ret = 0;\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@@ -1526,7 +1560,21 @@ i40evf_dev_configure(struct rte_eth_dev *dev)\n \tad->tx_simple_allowed = true;\n \tad->tx_vec_allowed = true;\n \n-\treturn i40evf_init_vlan(dev);\n+\tif (num_queue_pairs != vf->vsi_res->num_queue_pairs) {\n+\t\tPMD_DRV_LOG(INFO, \"change queue pairs from %u to %u\",\n+\t\t\t\tvf->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+\ti40evf_init_vlan(dev);\n+\n+\treturn ret;\n }\n \n static int\n@@ -2137,8 +2185,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": [ "v3", "1/2" ] }{ "id": 48743, "url": "