get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81724,
    "url": "http://patches.dpdk.org/api/patches/81724/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201022064902.40143-3-ting.xu@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": "<20201022064902.40143-3-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201022064902.40143-3-ting.xu@intel.com",
    "date": "2020-10-22T06:48:58",
    "name": "[v8,2/6] net/iavf: add IAVF request queues function",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "fb321ec169110cdc5c17d527ff18276d6c522ac7",
    "submitter": {
        "id": 1363,
        "url": "http://patches.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@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/20201022064902.40143-3-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 13188,
            "url": "http://patches.dpdk.org/api/series/13188/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13188",
            "date": "2020-10-22T06:48:56",
            "name": "enable large VF configuration",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/13188/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81724/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81724/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 7123BA04DD;\n\tThu, 22 Oct 2020 08:46:28 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 4C8858D9A;\n\tThu, 22 Oct 2020 08:45:57 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id B6BC67F6C\n for <dev@dpdk.org>; Thu, 22 Oct 2020 08:45:55 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 21 Oct 2020 23:45:55 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.154])\n by orsmga005.jf.intel.com with ESMTP; 21 Oct 2020 23:45:51 -0700"
        ],
        "IronPort-SDR": [
            "\n YRC4EqgylCSEyMe/8yQYbNtnlOgLbuW6UTOp4Qi7zSpg9maro9p1Jy/Tm5UD0HQVUFF4+jB755\n EK9aeZh1wJVw==",
            "\n 7800YTuc6SSDftboJVzCMibYjkY0v9Dia8JdGxjzGGn7y/EE1320uZxD7BoKUjgIMfvyPbsmvz\n 2qSBDyprSPbg=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9781\"; a=\"185158493\"",
            "E=Sophos;i=\"5.77,403,1596524400\"; d=\"scan'208\";a=\"185158493\"",
            "E=Sophos;i=\"5.77,403,1596524400\"; d=\"scan'208\";a=\"533829191\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Ting Xu <ting.xu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qi.z.zhang@intel.com, beilei.xing@intel.com, jingjing.wu@intel.com,\n Ting Xu <ting.xu@intel.com>",
        "Date": "Thu, 22 Oct 2020 14:48:58 +0800",
        "Message-Id": "<20201022064902.40143-3-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201022064902.40143-1-ting.xu@intel.com>",
        "References": "<20200909072028.16726-1-ting.xu@intel.com>\n <20201022064902.40143-1-ting.xu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v8 2/6] net/iavf: add IAVF request queues function",
        "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 <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 <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Add a new virtchnl function to request additional queues from PF. Current\ndefault queue pairs number when creating a VF is 16. In order to support\nup to 256 queue pairs per VF, enable this request queues function.\n\nWhen requesting queues succeeds, PF will return an event message. If it\nis handled by interrupt first, the request queues command cannot receive\nthe correct PF response and will wait until timeout. Therefore, disable\ninterrupt before requesting queues in order to handle the event message\nasynchronously.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/iavf/iavf.h       |  1 +\n drivers/net/iavf/iavf_vchnl.c | 88 ++++++++++++++++++++++++++++++++++-\n 2 files changed, 87 insertions(+), 2 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 9c16324c1..778b6c23c 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -287,4 +287,5 @@ int iavf_add_del_rss_cfg(struct iavf_adapter *adapter,\n int iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,\n \t\t\tstruct rte_ether_addr *mc_addrs,\n \t\t\tuint32_t mc_addrs_num, bool add);\n+int iavf_request_queues(struct iavf_adapter *adapter, uint16_t num);\n #endif /* _IAVF_ETHDEV_H_ */\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex b62c8683c..323e2a843 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -17,6 +17,7 @@\n #include <rte_eal.h>\n #include <rte_ether.h>\n #include <rte_ethdev_driver.h>\n+#include <rte_ethdev_pci.h>\n #include <rte_dev.h>\n \n #include \"iavf.h\"\n@@ -189,7 +190,33 @@ iavf_execute_vf_cmd(struct iavf_adapter *adapter, struct iavf_cmd_info *args)\n \t\t}\n \t\t_clear_cmd(vf);\n \t\tbreak;\n-\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\tdo {\n+\t\t\tresult = iavf_read_msg_from_pf(adapter, args->out_size,\n+\t\t\t\t\t\t   args->out_buffer);\n+\t\t\tif (result == IAVF_MSG_SYS && vf->vf_reset) {\n+\t\t\t\tbreak;\n+\t\t\t} else if (result == IAVF_MSG_CMD ||\n+\t\t\t\tresult == IAVF_MSG_ERR) {\n+\t\t\t\terr = -1;\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\tif (i >= MAX_TRY_TIMES ||\n+\t\t\tvf->cmd_retval != VIRTCHNL_STATUS_SUCCESS) {\n+\t\t\terr = -1;\n+\t\t\tPMD_DRV_LOG(ERR, \"No response or return failure (%d)\"\n+\t\t\t\t    \" for cmd %d\", vf->cmd_retval, args->ops);\n+\t\t}\n+\t\t_clear_cmd(vf);\n+\t\tbreak;\n \tdefault:\n \t\t/* For other virtchnl ops in running time,\n \t\t * wait for the cmd done flag.\n@@ -429,7 +456,8 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)\n \tcaps = IAVF_BASIC_OFFLOAD_CAPS | VIRTCHNL_VF_CAP_ADV_LINK_SPEED |\n \t\tVIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC |\n \t\tVIRTCHNL_VF_OFFLOAD_FDIR_PF |\n-\t\tVIRTCHNL_VF_OFFLOAD_ADV_RSS_PF;\n+\t\tVIRTCHNL_VF_OFFLOAD_ADV_RSS_PF |\n+\t\tVIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\n \n \targs.in_args = (uint8_t *)&caps;\n \targs.in_args_size = sizeof(caps);\n@@ -1183,3 +1211,59 @@ iavf_add_del_mc_addr_list(struct iavf_adapter *adapter,\n \n \treturn 0;\n }\n+\n+int\n+iavf_request_queues(struct iavf_adapter *adapter, uint16_t num)\n+{\n+\tstruct rte_eth_dev *dev = adapter->eth_dev;\n+\tstruct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct rte_pci_device *pci_dev = RTE_ETH_DEV_TO_PCI(dev);\n+\tstruct virtchnl_vf_res_request vfres;\n+\tstruct iavf_cmd_info args;\n+\tuint16_t num_queue_pairs;\n+\tint err;\n+\n+\tif (!(vf->vf_res->vf_cap_flags &\n+\t\tVIRTCHNL_VF_OFFLOAD_REQ_QUEUES)) {\n+\t\tPMD_DRV_LOG(ERR, \"request queues not supported\");\n+\t\treturn -1;\n+\t}\n+\n+\tif (num == 0) {\n+\t\tPMD_DRV_LOG(ERR, \"queue number cannot be zero\");\n+\t\treturn -1;\n+\t}\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 = IAVF_AQ_BUF_SZ;\n+\n+\t/*\n+\t * disable interrupt to avoid the admin queue message to be read\n+\t * before iavf_read_msg_from_pf.\n+\t */\n+\trte_intr_disable(&pci_dev->intr_handle);\n+\terr = iavf_execute_vf_cmd(adapter, &args);\n+\trte_intr_enable(&pci_dev->intr_handle);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR, \"fail to execute command OP_REQUEST_QUEUES\");\n+\t\treturn err;\n+\t}\n+\n+\t/* request queues succeeded, vf is resetting */\n+\tif (vf->vf_reset) {\n+\t\tPMD_DRV_LOG(INFO, \"vf is resetting\");\n+\t\treturn 0;\n+\t}\n+\n+\t/* request additional queues failed, return available number */\n+\tnum_queue_pairs =\n+\t  ((struct virtchnl_vf_res_request *)args.out_buffer)->num_queue_pairs;\n+\tPMD_DRV_LOG(ERR, \"request queues failed, only %u queues \"\n+\t\t\"available\", num_queue_pairs);\n+\n+\treturn -1;\n+}\n",
    "prefixes": [
        "v8",
        "2/6"
    ]
}