get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109661,
    "url": "http://patchwork.dpdk.org/api/patches/109661/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220413160932.2074781-28-kevinx.liu@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20220413160932.2074781-28-kevinx.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220413160932.2074781-28-kevinx.liu@intel.com",
    "date": "2022-04-13T16:09:26",
    "name": "[v2,27/33] net/ice: negotiate large VF and request more queues",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "dc1848e47f58fc92199c4fed4230072cc4475ff8",
    "submitter": {
        "id": 2440,
        "url": "http://patchwork.dpdk.org/api/people/2440/?format=api",
        "name": "Kevin Liu",
        "email": "kevinx.liu@intel.com"
    },
    "delegate": null,
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220413160932.2074781-28-kevinx.liu@intel.com/mbox/",
    "series": [
        {
            "id": 22497,
            "url": "http://patchwork.dpdk.org/api/series/22497/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=22497",
            "date": "2022-04-13T16:08:59",
            "name": "support full function of DCF",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/22497/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/109661/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/109661/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 mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 1DC3FA0508;\n\tWed, 13 Apr 2022 10:13:58 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id AD4D342864;\n\tWed, 13 Apr 2022 10:11:54 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 93BB64284A\n for <dev@dpdk.org>; Wed, 13 Apr 2022 10:11:53 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2022 01:11:53 -0700",
            "from intel-cd-odc-kevin.cd.intel.com ([10.240.178.195])\n by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Apr 2022 01:11:51 -0700"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1649837513; x=1681373513;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=fIjotZh2MROq4VuuVjbsamRCTCM56b64epyDL+0hz18=;\n b=Cx1Bo1v+Fl1oDrcwaoXmj4hCQX0lJricmrBBb51xpUrmywghWT5y6S8B\n cOjRMDSDzVPMXKbOsucoGmQCDFQL0uaeq5x9bKBKPv/Bcxmlu8l0R6GSX\n +1dykRb7wpcTBSktOdtp+FNq7TS5/jtPDLDT646ZiUKTMbhsOUntOpEvp\n quny9JVJvXrKf4nEh2J36ofd7gzyn9NsP0nGJqZlayFwXqh8QnCOembWM\n Kfr84nTT765swZvKnTxbHhfKgHkg9/jp4QVzUMuEsNK3jIdtvfhGJASLK\n +OEYWJHv/GMRRAWx8tddDpLIu5i2yzajQgOdXJeM5ZYoKACZkBCvd2f7E g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10315\"; a=\"287630113\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"287630113\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"526847892\""
        ],
        "From": "Kevin Liu <kevinx.liu@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "qiming.yang@intel.com, qi.z.zhang@intel.com, stevex.yang@intel.com,\n Kevin Liu <kevinx.liu@intel.com>",
        "Subject": "[PATCH v2 27/33] net/ice: negotiate large VF and request more queues",
        "Date": "Wed, 13 Apr 2022 16:09:26 +0000",
        "Message-Id": "<20220413160932.2074781-28-kevinx.liu@intel.com>",
        "X-Mailer": "git-send-email 2.33.1",
        "In-Reply-To": "<20220413160932.2074781-1-kevinx.liu@intel.com>",
        "References": "<20220407105706.18889-1-kevinx.liu@intel.com>\n <20220413160932.2074781-1-kevinx.liu@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "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"
    },
    "content": "From: Steve Yang <stevex.yang@intel.com>\n\nNegotiate 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: Steve Yang <stevex.yang@intel.com>\nSigned-off-by: Kevin Liu <kevinx.liu@intel.com>\n---\n drivers/net/ice/ice_dcf.c        | 34 +++++++++++++++-\n drivers/net/ice/ice_dcf.h        |  4 ++\n drivers/net/ice/ice_dcf_ethdev.c | 69 +++++++++++++++++++++++++++++++-\n drivers/net/ice/ice_dcf_ethdev.h |  2 +\n 4 files changed, 106 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c\nindex 6aeafa6681..7091658841 100644\n--- a/drivers/net/ice/ice_dcf.c\n+++ b/drivers/net/ice/ice_dcf.c\n@@ -257,7 +257,8 @@ ice_dcf_get_vf_resource(struct ice_dcf_hw *hw)\n \t       VIRTCHNL_VF_CAP_ADV_LINK_SPEED | VIRTCHNL_VF_CAP_DCF |\n \t       VIRTCHNL_VF_OFFLOAD_VLAN_V2 |\n \t       VF_BASE_MODE_OFFLOADS | VIRTCHNL_VF_OFFLOAD_RX_FLEX_DESC |\n-\t       VIRTCHNL_VF_OFFLOAD_QOS | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\n+\t       VIRTCHNL_VF_OFFLOAD_QOS | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES |\n+\t\t   VIRTCHNL_VF_LARGE_NUM_QPAIRS;\n \n \terr = ice_dcf_send_cmd_req_no_irq(hw, VIRTCHNL_OP_GET_VF_RESOURCES,\n \t\t\t\t\t  (uint8_t *)&caps, sizeof(caps));\n@@ -1083,6 +1084,37 @@ ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)\n \treturn -1;\n }\n \n+int\n+ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw)\n+{\n+\tstruct dcf_virtchnl_cmd args;\n+\tuint16_t qregion_width;\n+\tint err;\n+\n+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_GET_MAX_RSS_QREGION;\n+\targs.req_msg = NULL;\n+\targs.req_msglen = 0;\n+\targs.rsp_msgbuf = hw->arq_buf;\n+\targs.rsp_msglen = ICE_DCF_AQ_BUF_SZ;\n+\targs.rsp_buflen = ICE_DCF_AQ_BUF_SZ;\n+\n+\terr = ice_dcf_execute_virtchnl_cmd(hw, &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 =\t((struct virtchnl_max_rss_qregion *)\n+\t\t\t\targs.rsp_msgbuf)->qregion_width;\n+\thw->max_rss_qregion = (uint16_t)(1 << qregion_width);\n+\n+\treturn 0;\n+}\n+\n+\n int\n ice_dcf_config_irq_map(struct ice_dcf_hw *hw)\n {\ndiff --git a/drivers/net/ice/ice_dcf.h b/drivers/net/ice/ice_dcf.h\nindex 99498e2184..05ea91d2a5 100644\n--- a/drivers/net/ice/ice_dcf.h\n+++ b/drivers/net/ice/ice_dcf.h\n@@ -105,6 +105,7 @@ struct ice_dcf_hw {\n \n \tuint16_t msix_base;\n \tuint16_t nb_msix;\n+\tuint16_t max_rss_qregion; /* max RSS queue region supported by PF */\n \tuint16_t rxq_map[16];\n \tstruct virtchnl_eth_stats eth_stats_offset;\n \tstruct virtchnl_vlan_caps vlan_v2_caps;\n@@ -114,6 +115,8 @@ struct ice_dcf_hw {\n \tuint32_t link_speed;\n \n \tbool resetting;\n+\t/* Indicate large VF support enabled or not */\n+\tbool lv_enabled;\n };\n \n int ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,\n@@ -128,6 +131,7 @@ int ice_dcf_configure_rss_lut(struct ice_dcf_hw *hw);\n int ice_dcf_init_rss(struct ice_dcf_hw *hw);\n int ice_dcf_configure_queues(struct ice_dcf_hw *hw);\n int ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num);\n+int ice_dcf_get_max_rss_queue_region(struct ice_dcf_hw *hw);\n int ice_dcf_config_irq_map(struct ice_dcf_hw *hw);\n int ice_dcf_switch_queue(struct ice_dcf_hw *hw, uint16_t qid, bool rx, bool on);\n int ice_dcf_disable_queues(struct ice_dcf_hw *hw);\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.c b/drivers/net/ice/ice_dcf_ethdev.c\nindex d4bfa182a4..a43c5a320d 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.c\n+++ b/drivers/net/ice/ice_dcf_ethdev.c\n@@ -39,6 +39,8 @@ static int\n ice_dcf_dev_udp_tunnel_port_del(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_eth_udp_tunnel *udp_tunnel);\n \n+static int ice_dcf_queues_req_reset(struct rte_eth_dev *dev, uint16_t num);\n+\n static int\n ice_dcf_dev_init(struct rte_eth_dev *eth_dev);\n \n@@ -663,6 +665,11 @@ ice_dcf_dev_configure(struct rte_eth_dev *dev)\n {\n \tstruct ice_dcf_adapter *dcf_ad = dev->data->dev_private;\n \tstruct ice_adapter *ad = &dcf_ad->parent;\n+\tstruct ice_dcf_hw *hw = &dcf_ad->real_hw;\n+\tint ret;\n+\n+\tuint16_t num_queue_pairs =\n+\t\tRTE_MAX(dev->data->nb_rx_queues, dev->data->nb_tx_queues);\n \n \tad->rx_bulk_alloc_allowed = true;\n \tad->tx_simple_allowed = true;\n@@ -670,6 +677,47 @@ ice_dcf_dev_configure(struct rte_eth_dev *dev)\n \tif (dev->data->dev_conf.rxmode.mq_mode & RTE_ETH_MQ_RX_RSS_FLAG)\n \t\tdev->data->dev_conf.rxmode.offloads |= RTE_ETH_RX_OFFLOAD_RSS_HASH;\n \n+\t\t/* Large VF setting */\n+\tif (num_queue_pairs > ICE_DCF_MAX_NUM_QUEUES_DFLT) {\n+\t\tif (!(hw->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 > ICE_DCF_MAX_NUM_QUEUES_LV) {\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t\"queue pairs number cannot be larger than %u\",\n+\t\t\t\tICE_DCF_MAX_NUM_QUEUES_LV);\n+\t\t\treturn -1;\n+\t\t}\n+\n+\t\tret = ice_dcf_queues_req_reset(dev, num_queue_pairs);\n+\t\tif (ret)\n+\t\t\treturn ret;\n+\n+\t\tret = ice_dcf_get_max_rss_queue_region(hw);\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\thw->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 (hw->lv_enabled) {\n+\t\t\tret = ice_dcf_queues_req_reset(dev, num_queue_pairs);\n+\t\t\tif (ret)\n+\t\t\t\treturn ret;\n+\n+\t\t\thw->lv_enabled = false;\n+\t\t}\n+\t\t/* if large VF is not required, use default rss queue region */\n+\t\thw->max_rss_qregion = ICE_DCF_MAX_NUM_QUEUES_DFLT;\n+\t}\n+\n \treturn 0;\n }\n \n@@ -681,8 +729,8 @@ ice_dcf_dev_info_get(struct rte_eth_dev *dev,\n \tstruct ice_dcf_hw *hw = &adapter->real_hw;\n \n \tdev_info->max_mac_addrs = DCF_NUM_MACADDR_MAX;\n-\tdev_info->max_rx_queues = hw->vsi_res->num_queue_pairs;\n-\tdev_info->max_tx_queues = hw->vsi_res->num_queue_pairs;\n+\tdev_info->max_rx_queues = ICE_DCF_MAX_NUM_QUEUES_LV;\n+\tdev_info->max_tx_queues = ICE_DCF_MAX_NUM_QUEUES_LV;\n \tdev_info->min_rx_bufsize = ICE_BUF_SIZE_MIN;\n \tdev_info->max_rx_pktlen = ICE_FRAME_SIZE_MAX;\n \tdev_info->hash_key_size = hw->vf_res->rss_key_size;\n@@ -1829,6 +1877,23 @@ ice_dcf_dev_uninit(struct rte_eth_dev *eth_dev)\n \treturn 0;\n }\n \n+static int ice_dcf_queues_req_reset(struct rte_eth_dev *dev, uint16_t num)\n+{\n+\tstruct ice_dcf_adapter *adapter = dev->data->dev_private;\n+\tstruct ice_dcf_hw *hw = &adapter->real_hw;\n+\tint ret;\n+\n+\tret = ice_dcf_request_queues(hw, 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\thw->vsi_res->num_queue_pairs, num);\n+\n+\treturn ice_dcf_dev_reset(dev);\n+}\n+\n static int\n ice_dcf_cap_check_handler(__rte_unused const char *key,\n \t\t\t  const char *value, __rte_unused void *opaque)\ndiff --git a/drivers/net/ice/ice_dcf_ethdev.h b/drivers/net/ice/ice_dcf_ethdev.h\nindex 27f6402786..4a08d32e0c 100644\n--- a/drivers/net/ice/ice_dcf_ethdev.h\n+++ b/drivers/net/ice/ice_dcf_ethdev.h\n@@ -20,6 +20,8 @@\n #define ICE_DCF_ETH_OVERHEAD \\\n \t(RTE_ETHER_HDR_LEN + RTE_ETHER_CRC_LEN + ICE_DCF_VLAN_TAG_SIZE * 2)\n #define ICE_DCF_ETH_MAX_LEN (RTE_ETHER_MTU + ICE_DCF_ETH_OVERHEAD)\n+#define ICE_DCF_MAX_NUM_QUEUES_DFLT 16\n+#define ICE_DCF_MAX_NUM_QUEUES_LV   256\n \n struct ice_dcf_queue {\n \tuint64_t dummy;\n",
    "prefixes": [
        "v2",
        "27/33"
    ]
}