get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81248,
    "url": "http://patches.dpdk.org/api/patches/81248/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201018103430.30997-4-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": "<20201018103430.30997-4-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201018103430.30997-4-ting.xu@intel.com",
    "date": "2020-10-18T10:34:27",
    "name": "[v7,3/6] net/iavf: negotiate large VF and request more queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "45ef0e5f7ead61a3e0a4d1a680b17e258ebbdc27",
    "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/20201018103430.30997-4-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 13079,
            "url": "http://patches.dpdk.org/api/series/13079/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13079",
            "date": "2020-10-18T10:34:24",
            "name": "enable large VF configuration",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/13079/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81248/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81248/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 E19C6A04B0;\n\tSun, 18 Oct 2020 12:45:42 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id DE0B1CFEB;\n\tSun, 18 Oct 2020 12:44:59 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n by dpdk.org (Postfix) with ESMTP id 06446CF9B\n for <dev@dpdk.org>; Sun, 18 Oct 2020 12:44:53 +0200 (CEST)",
            "from fmsmga004.fm.intel.com ([10.253.24.48])\n by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 18 Oct 2020 03:44:51 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.154])\n by fmsmga004.fm.intel.com with ESMTP; 18 Oct 2020 03:44:49 -0700"
        ],
        "IronPort-SDR": [
            "\n 9tnXfoWiHYqPPLvhAmF4FlHPD4Vpzta7Z+hhUlD+fnttjzV4PK3Tb3Kj8MztuNm2gx7qOMfklx\n N8Uej+fHkypg==",
            "\n tIoZAU2QIHkbFfCAI9rsm+vqdZLn6/l2fRY3BeGNBef1N41LIrxjttu+VnEzcrtGmHFQca9b4q\n NSfve2iOcLHA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9777\"; a=\"153826029\"",
            "E=Sophos;i=\"5.77,390,1596524400\"; d=\"scan'208\";a=\"153826029\"",
            "E=Sophos;i=\"5.77,390,1596524400\"; d=\"scan'208\";a=\"347087266\""
        ],
        "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": "Sun, 18 Oct 2020 18:34:27 +0800",
        "Message-Id": "<20201018103430.30997-4-ting.xu@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201018103430.30997-1-ting.xu@intel.com>",
        "References": "<20200909072028.16726-1-ting.xu@intel.com>\n <20201018103430.30997-1-ting.xu@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v7 3/6] net/iavf: negotiate large VF and 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 <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": "Negotiate large VF capability with PF during VF initialization. If large\nVF is supported and the number of queues larger than 16 is required, VF\nrequests additional queues from PF. Mark the state that large VF is\nsupported.\n\nIf the allocated queues number is larger than 16, the max RSS queue\nregion cannot be 16 anymore. Add the function to query max RSS queue\nregion from PF, use it in the RSS initialization and future filters\nconfiguration.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/iavf/iavf.h        |  7 +++-\n drivers/net/iavf/iavf_ethdev.c | 74 ++++++++++++++++++++++++++++++++--\n drivers/net/iavf/iavf_vchnl.c  | 33 ++++++++++++++-\n 3 files changed, 109 insertions(+), 5 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 778b6c23c..49ccfeece 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -19,7 +19,8 @@\n #define IAVF_FRAME_SIZE_MAX       9728\n #define IAVF_QUEUE_BASE_ADDR_UNIT 128\n \n-#define IAVF_MAX_NUM_QUEUES       16\n+#define IAVF_MAX_NUM_QUEUES_DFLT\t 16\n+#define IAVF_MAX_NUM_QUEUES_LV\t\t 256\n \n #define IAVF_NUM_MACADDR_MAX      64\n \n@@ -149,6 +150,7 @@ struct iavf_info {\n \tuint8_t *rss_key;\n \tuint16_t nb_msix;   /* number of MSI-X interrupts on Rx */\n \tuint16_t msix_base; /* msix vector base from */\n+\tuint16_t max_rss_qregion; /* max RSS queue region supported by PF */\n \t/* queue bitmask for each vector */\n \tuint16_t rxq_map[IAVF_MAX_MSIX_VECTORS];\n \tstruct iavf_flow_list flow_list;\n@@ -157,6 +159,8 @@ struct iavf_info {\n \tstruct iavf_parser_list dist_parser_list;\n \n \tstruct iavf_fdir_info fdir; /* flow director info */\n+\t/* indicate large VF support enabled or not */\n+\tbool lv_enabled;\n };\n \n #define IAVF_MAX_PKT_TYPE 1024\n@@ -288,4 +292,5 @@ 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+int iavf_get_max_rss_queue_region(struct iavf_adapter *adapter);\n #endif /* _IAVF_ETHDEV_H_ */\ndiff --git a/drivers/net/iavf/iavf_ethdev.c b/drivers/net/iavf/iavf_ethdev.c\nindex f5e6e852a..f41be2b7d 100644\n--- a/drivers/net/iavf/iavf_ethdev.c\n+++ b/drivers/net/iavf/iavf_ethdev.c\n@@ -195,7 +195,7 @@ iavf_init_rss(struct iavf_adapter *adapter)\n \n \trss_conf = &adapter->eth_dev->data->dev_conf.rx_adv_conf.rss_conf;\n \tnb_q = RTE_MIN(adapter->eth_dev->data->nb_rx_queues,\n-\t\t       IAVF_MAX_NUM_QUEUES);\n+\t\t       vf->max_rss_qregion);\n \n \tif (!(vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_RSS_PF)) {\n \t\tPMD_DRV_LOG(DEBUG, \"RSS is not supported\");\n@@ -241,6 +241,31 @@ iavf_init_rss(struct iavf_adapter *adapter)\n \treturn 0;\n }\n \n+static int\n+iavf_queues_req_reset(struct rte_eth_dev *dev, uint16_t num)\n+{\n+\tstruct iavf_adapter *ad =\n+\t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tstruct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(ad);\n+\tint ret;\n+\n+\tret = iavf_request_queues(ad, num);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"request queues from PF failed\");\n+\t\treturn ret;\n+\t}\n+\tPMD_DRV_LOG(INFO, \"change queue pairs from %u to %u\",\n+\t\t\tvf->vsi_res->num_queue_pairs, num);\n+\n+\tret = iavf_dev_reset(dev);\n+\tif (ret) {\n+\t\tPMD_DRV_LOG(ERR, \"vf reset failed\");\n+\t\treturn ret;\n+\t}\n+\n+\treturn 0;\n+}\n+\n static int\n iavf_dev_configure(struct rte_eth_dev *dev)\n {\n@@ -248,6 +273,9 @@ iavf_dev_configure(struct rte_eth_dev *dev)\n \t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n \tstruct iavf_info *vf =  IAVF_DEV_PRIVATE_TO_VF(ad);\n \tstruct rte_eth_conf *dev_conf = &dev->data->dev_conf;\n+\tuint16_t num_queue_pairs = RTE_MAX(dev->data->nb_rx_queues,\n+\t\tdev->data->nb_tx_queues);\n+\tint ret;\n \n \tad->rx_bulk_alloc_allowed = true;\n \t/* Initialize to TRUE. If any of Rx queues doesn't meet the\n@@ -259,6 +287,46 @@ iavf_dev_configure(struct rte_eth_dev *dev)\n \tif (dev->data->dev_conf.rxmode.mq_mode & ETH_MQ_RX_RSS_FLAG)\n \t\tdev->data->dev_conf.rxmode.offloads |= DEV_RX_OFFLOAD_RSS_HASH;\n \n+\t/* Large VF setting */\n+\tif (num_queue_pairs > IAVF_MAX_NUM_QUEUES_DFLT) {\n+\t\tif (!(vf->vf_res->vf_cap_flags &\n+\t\t\t\tVIRTCHNL_VF_LARGE_NUM_QPAIRS)) {\n+\t\t\tPMD_DRV_LOG(ERR, \"large VF is not supported\");\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tif (num_queue_pairs > IAVF_MAX_NUM_QUEUES_LV) {\n+\t\t\tPMD_DRV_LOG(ERR, \"queue pairs number cannot be larger \"\n+\t\t\t\t\"than %u\", IAVF_MAX_NUM_QUEUES_LV);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tret = iavf_queues_req_reset(dev, num_queue_pairs);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n+\t\tret = iavf_get_max_rss_queue_region(ad);\n+\t\tif (ret) {\n+\t\t\tPMD_INIT_LOG(ERR, \"get max rss queue region failed\");\n+\t\t\treturn ret;\n+\t\t}\n+\n+\t\tvf->lv_enabled = true;\n+\t} else {\n+\t\t/* Check if large VF is already enabled. If so, disable and\n+\t\t * release redundant queue resource.\n+\t\t */\n+\t\tif (vf->lv_enabled) {\n+\t\t\tret = iavf_queues_req_reset(dev, num_queue_pairs);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\tvf->lv_enabled = false;\n+\t\t}\n+\t\t/* if large VF is not required, use default rss queue region */\n+\t\tvf->max_rss_qregion = IAVF_MAX_NUM_QUEUES_DFLT;\n+\t}\n+\n \t/* Vlan stripping setting */\n \tif (vf->vf_res->vf_cap_flags & VIRTCHNL_VF_OFFLOAD_VLAN) {\n \t\tif (dev_conf->rxmode.offloads & DEV_RX_OFFLOAD_VLAN_STRIP)\n@@ -569,8 +637,8 @@ iavf_dev_info_get(struct rte_eth_dev *dev, struct rte_eth_dev_info *dev_info)\n {\n \tstruct iavf_info *vf = IAVF_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 = IAVF_MAX_NUM_QUEUES_LV;\n+\tdev_info->max_tx_queues = IAVF_MAX_NUM_QUEUES_LV;\n \tdev_info->min_rx_bufsize = IAVF_BUF_SIZE_MIN;\n \tdev_info->max_rx_pktlen = IAVF_FRAME_SIZE_MAX;\n \tdev_info->max_mtu = dev_info->max_rx_pktlen - IAVF_ETH_OVERHEAD;\ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex 9caf8ee70..e939b275a 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -457,7 +457,8 @@ iavf_get_vf_resource(struct iavf_adapter *adapter)\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_REQ_QUEUES;\n+\t\tVIRTCHNL_VF_OFFLOAD_REQ_QUEUES |\n+\t\tVIRTCHNL_VF_LARGE_NUM_QPAIRS;\n \n \targs.in_args = (uint8_t *)&caps;\n \targs.in_args_size = sizeof(caps);\n@@ -1270,3 +1271,33 @@ iavf_request_queues(struct iavf_adapter *adapter, uint16_t num)\n \n \treturn -1;\n }\n+\n+int\n+iavf_get_max_rss_queue_region(struct iavf_adapter *adapter)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct iavf_cmd_info args;\n+\tuint16_t qregion_width;\n+\tint err;\n+\n+\targs.ops = VIRTCHNL_OP_GET_MAX_RSS_QREGION;\n+\targs.in_args = NULL;\n+\targs.in_args_size = 0;\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\n+\terr = iavf_execute_vf_cmd(adapter, &args);\n+\tif (err) {\n+\t\tPMD_DRV_LOG(ERR,\n+\t\t\t    \"Failed to execute command of \"\n+\t\t\t    \"VIRTCHNL_OP_GET_MAX_RSS_QREGION\");\n+\t\treturn err;\n+\t}\n+\n+\tqregion_width =\n+\t((struct virtchnl_max_rss_qregion *)args.out_buffer)->qregion_width;\n+\n+\tvf->max_rss_qregion = (uint16_t)(1 << qregion_width);\n+\n+\treturn 0;\n+}\n",
    "prefixes": [
        "v7",
        "3/6"
    ]
}