get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 109660,
    "url": "https://patches.dpdk.org/api/patches/109660/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220413160932.2074781-27-kevinx.liu@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": "<20220413160932.2074781-27-kevinx.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220413160932.2074781-27-kevinx.liu@intel.com",
    "date": "2022-04-13T16:09:25",
    "name": "[v2,26/33] net/ice: add DCF request queues function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "a1bde1c496c723aeab1da720b3f9df25ba5c1592",
    "submitter": {
        "id": 2440,
        "url": "https://patches.dpdk.org/api/people/2440/?format=api",
        "name": "Kevin Liu",
        "email": "kevinx.liu@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220413160932.2074781-27-kevinx.liu@intel.com/mbox/",
    "series": [
        {
            "id": 22497,
            "url": "https://patches.dpdk.org/api/series/22497/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=22497",
            "date": "2022-04-13T16:08:59",
            "name": "support full function of DCF",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/22497/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/109660/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/109660/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 933EFA0508;\n\tWed, 13 Apr 2022 10:13:51 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B4C504285C;\n\tWed, 13 Apr 2022 10:11:52 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by mails.dpdk.org (Postfix) with ESMTP id 5B48E4285C\n for <dev@dpdk.org>; Wed, 13 Apr 2022 10:11:51 +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:50 -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:48 -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=1649837511; x=1681373511;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=7TAsBqQ3YNcnG1Z7KL7RLjVjf3ECygbjVKiDqccpqxU=;\n b=GxQRXtgPW5ZwEKnynRz0H3cZMhBTCkRKsNpEeWIv3j2Ir9X3scCx5IQl\n JAJ7j337yJjYPEEudx2wlfA0JVNDyrKVxe9sGtI9cpowu7z1P6Fkvfau4\n zXBvSF0rMNSG92XBp696qg4FEifyzWtowN6A3iXgKrpxqoxYIDRvE8UH/\n g8qaqwHBJ5Wvuw6Wp3dBIuzna3xOquYFVGORrscyrqbeU8/Ud/BNhI/cS\n 1nqvoZuLD1gPJM73liXuW2D4ji86OLHXJojKoiXEqsgnP3a5VjU/4hoMr\n 9WH5RMSK0qEsTzWlwnt0ciMhs9AWEGCe5i9crsl9AeKbUdjM3BPQKV8aX g==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6400,9594,10315\"; a=\"287630105\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"287630105\"",
            "E=Sophos;i=\"5.90,256,1643702400\"; d=\"scan'208\";a=\"526847878\""
        ],
        "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 26/33] net/ice: add DCF request queues function",
        "Date": "Wed, 13 Apr 2022 16:09:25 +0000",
        "Message-Id": "<20220413160932.2074781-27-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\nAdd a new virtchnl function to request additional queues from PF. Current\ndefault queue pairs number is 16. In order to support up to 256 queue\npairs DCF port, enable this request queues function.\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 | 98 +++++++++++++++++++++++++++++++++------\n drivers/net/ice/ice_dcf.h |  1 +\n 2 files changed, 86 insertions(+), 13 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/ice_dcf.c b/drivers/net/ice/ice_dcf.c\nindex 1415f26ac3..6aeafa6681 100644\n--- a/drivers/net/ice/ice_dcf.c\n+++ b/drivers/net/ice/ice_dcf.c\n@@ -257,7 +257,7 @@ 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;\n+\t       VIRTCHNL_VF_OFFLOAD_QOS | VIRTCHNL_VF_OFFLOAD_REQ_QUEUES;\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@@ -468,18 +468,38 @@ ice_dcf_execute_virtchnl_cmd(struct ice_dcf_hw *hw,\n \t\tgoto ret;\n \t}\n \n-\tdo {\n-\t\tif (!cmd->pending)\n-\t\t\tbreak;\n-\n-\t\trte_delay_ms(ICE_DCF_ARQ_CHECK_TIME);\n-\t} while (i++ < ICE_DCF_ARQ_MAX_RETRIES);\n-\n-\tif (cmd->v_ret != IAVF_SUCCESS) {\n-\t\terr = -1;\n-\t\tPMD_DRV_LOG(ERR,\n-\t\t\t    \"No response (%d times) or return failure (%d) for cmd %d\",\n-\t\t\t    i, cmd->v_ret, cmd->v_op);\n+\tswitch (cmd->v_op) {\n+\tcase VIRTCHNL_OP_REQUEST_QUEUES:\n+\t\terr = ice_dcf_recv_cmd_rsp_no_irq(hw,\n+\t\t\t\t\t\t  VIRTCHNL_OP_REQUEST_QUEUES,\n+\t\t\t\t\t\t  cmd->rsp_msgbuf,\n+\t\t\t\t\t\t  cmd->rsp_buflen,\n+\t\t\t\t\t\t  NULL);\n+\t\tif (err != IAVF_SUCCESS || !hw->resetting) {\n+\t\t\terr = -1;\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t    \"Failed to get response of \"\n+\t\t\t\t    \"VIRTCHNL_OP_REQUEST_QUEUES %d\",\n+\t\t\t\t    err);\n+\t\t}\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+\t\t */\n+\t\tdo {\n+\t\t\tif (!cmd->pending)\n+\t\t\t\tbreak;\n+\t\t\trte_delay_ms(ICE_DCF_ARQ_CHECK_TIME);\n+\t\t} while (i++ < ICE_DCF_ARQ_MAX_RETRIES);\n+\n+\t\tif (cmd->v_ret != IAVF_SUCCESS) {\n+\t\t\terr = -1;\n+\t\t\tPMD_DRV_LOG(ERR,\n+\t\t\t\t    \"No response (%d times) or \"\n+\t\t\t\t    \"return failure (%d) for cmd %d\",\n+\t\t\t\t    i, cmd->v_ret, cmd->v_op);\n+\t\t}\n \t}\n \n ret:\n@@ -1011,6 +1031,58 @@ ice_dcf_configure_queues(struct ice_dcf_hw *hw)\n \treturn err;\n }\n \n+int\n+ice_dcf_request_queues(struct ice_dcf_hw *hw, uint16_t num)\n+{\n+\tstruct virtchnl_vf_res_request vfres;\n+\tstruct dcf_virtchnl_cmd args;\n+\tuint16_t num_queue_pairs;\n+\tint err;\n+\n+\tif (!(hw->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+\tmemset(&args, 0, sizeof(args));\n+\targs.v_op = VIRTCHNL_OP_REQUEST_QUEUES;\n+\n+\targs.req_msg = (u8 *)&vfres;\n+\targs.req_msglen = sizeof(vfres);\n+\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+\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(hw->eth_dev->intr_handle);\n+\terr = ice_dcf_execute_virtchnl_cmd(hw, &args);\n+\trte_intr_enable(hw->eth_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 additional queues failed, return available number */\n+\tnum_queue_pairs = ((struct virtchnl_vf_res_request *)\n+\t\t\t\targs.rsp_msgbuf)->num_queue_pairs;\n+\tPMD_DRV_LOG(ERR,\n+\t\t    \"request queues failed, only %u queues available\",\n+\t\t    num_queue_pairs);\n+\n+\treturn -1;\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 8cf17e7700..99498e2184 100644\n--- a/drivers/net/ice/ice_dcf.h\n+++ b/drivers/net/ice/ice_dcf.h\n@@ -127,6 +127,7 @@ int ice_dcf_configure_rss_key(struct ice_dcf_hw *hw);\n 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_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);\n",
    "prefixes": [
        "v2",
        "26/33"
    ]
}