get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81728,
    "url": "http://patchwork.dpdk.org/api/patches/81728/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20201022064902.40143-7-ting.xu@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": "<20201022064902.40143-7-ting.xu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201022064902.40143-7-ting.xu@intel.com",
    "date": "2020-10-22T06:49:02",
    "name": "[v8,6/6] net/iavf: add enable/disable queues for large VF",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c48da84fbe1217d420e8b14c37f30ad9fd1f7e9a",
    "submitter": {
        "id": 1363,
        "url": "http://patchwork.dpdk.org/api/people/1363/?format=api",
        "name": "Xu, Ting",
        "email": "ting.xu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20201022064902.40143-7-ting.xu@intel.com/mbox/",
    "series": [
        {
            "id": 13188,
            "url": "http://patchwork.dpdk.org/api/series/13188/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=13188",
            "date": "2020-10-22T06:48:56",
            "name": "enable large VF configuration",
            "version": 8,
            "mbox": "http://patchwork.dpdk.org/series/13188/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/81728/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/81728/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 48D6FA04DD;\n\tThu, 22 Oct 2020 08:47:42 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CC75FA8F7;\n\tThu, 22 Oct 2020 08:46:10 +0200 (CEST)",
            "from mga01.intel.com (mga01.intel.com [192.55.52.88])\n by dpdk.org (Postfix) with ESMTP id A5A547F6C\n for <dev@dpdk.org>; Thu, 22 Oct 2020 08:46:07 +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:46:07 -0700",
            "from dpdk-xuting-second.sh.intel.com ([10.67.116.154])\n by orsmga005.jf.intel.com with ESMTP; 21 Oct 2020 23:46:04 -0700"
        ],
        "IronPort-SDR": [
            "\n ZG/KQPL9vmBfCjuB5lX6SeuX466pNn6P2x2vqgS11nxiBE9KleuJ3droTCuTbhFNUl+/Sy47iP\n g91RbGeh14mA==",
            "\n bUq2ql1dh9mJryV+/NNAs+3BeRNVAY4evOjEQOdQLlO2MOsx89X2laZzS1jffDyLO45tgT5Jt2\n CY0gftZVQsWQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9781\"; a=\"185158518\"",
            "E=Sophos;i=\"5.77,403,1596524400\"; d=\"scan'208\";a=\"185158518\"",
            "E=Sophos;i=\"5.77,403,1596524400\"; d=\"scan'208\";a=\"533829269\""
        ],
        "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:49:02 +0800",
        "Message-Id": "<20201022064902.40143-7-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 6/6] net/iavf: add enable/disable queues for\n\tlarge VF",
        "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": "The current virtchnl structure for enable/disable queues only supports\nmax 32 queue pairs. Use a new opcode and structure to indicate up to 256\nqueue pairs, in order to enable/disable queues in large VF case.\n\nSigned-off-by: Ting Xu <ting.xu@intel.com>\n---\n drivers/net/iavf/iavf.h       |   5 ++\n drivers/net/iavf/iavf_rxtx.c  |  25 ++++++-\n drivers/net/iavf/iavf_vchnl.c | 132 ++++++++++++++++++++++++++++++++++\n 3 files changed, 159 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/drivers/net/iavf/iavf.h b/drivers/net/iavf/iavf.h\nindex 5e330b215..3d3b0da5d 100644\n--- a/drivers/net/iavf/iavf.h\n+++ b/drivers/net/iavf/iavf.h\n@@ -23,6 +23,7 @@\n #define IAVF_MAX_NUM_QUEUES_LV\t\t 256\n #define IAVF_CFG_Q_NUM_PER_BUF\t\t 32\n #define IAVF_IRQ_MAP_NUM_PER_BUF\t 128\n+#define IAVF_RXTX_QUEUE_CHUNKS_NUM\t 2\n \n #define IAVF_NUM_MACADDR_MAX      64\n \n@@ -268,8 +269,12 @@ int iavf_enable_vlan_strip(struct iavf_adapter *adapter);\n int iavf_disable_vlan_strip(struct iavf_adapter *adapter);\n int iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,\n \t\t     bool rx, bool on);\n+int iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,\n+\t\t     bool rx, bool on);\n int iavf_enable_queues(struct iavf_adapter *adapter);\n+int iavf_enable_queues_lv(struct iavf_adapter *adapter);\n int iavf_disable_queues(struct iavf_adapter *adapter);\n+int iavf_disable_queues_lv(struct iavf_adapter *adapter);\n int iavf_configure_rss_lut(struct iavf_adapter *adapter);\n int iavf_configure_rss_key(struct iavf_adapter *adapter);\n int iavf_configure_queues(struct iavf_adapter *adapter,\ndiff --git a/drivers/net/iavf/iavf_rxtx.c b/drivers/net/iavf/iavf_rxtx.c\nindex 7d4f4ed48..6635f7fd9 100644\n--- a/drivers/net/iavf/iavf_rxtx.c\n+++ b/drivers/net/iavf/iavf_rxtx.c\n@@ -532,6 +532,7 @@ iavf_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n {\n \tstruct iavf_adapter *adapter =\n \t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct iavf_rx_queue *rxq;\n \tint err = 0;\n@@ -556,7 +557,11 @@ iavf_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n \tIAVF_WRITE_FLUSH(hw);\n \n \t/* Ready to switch the queue on */\n-\terr = iavf_switch_queue(adapter, rx_queue_id, true, true);\n+\tif (!vf->lv_enabled)\n+\t\terr = iavf_switch_queue(adapter, rx_queue_id, true, true);\n+\telse\n+\t\terr = iavf_switch_queue_lv(adapter, rx_queue_id, true, true);\n+\n \tif (err)\n \t\tPMD_DRV_LOG(ERR, \"Failed to switch RX queue %u on\",\n \t\t\t    rx_queue_id);\n@@ -572,6 +577,7 @@ iavf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n {\n \tstruct iavf_adapter *adapter =\n \t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct iavf_hw *hw = IAVF_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n \tstruct iavf_tx_queue *txq;\n \tint err = 0;\n@@ -588,7 +594,10 @@ iavf_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \tIAVF_WRITE_FLUSH(hw);\n \n \t/* Ready to switch the queue on */\n-\terr = iavf_switch_queue(adapter, tx_queue_id, false, true);\n+\tif (!vf->lv_enabled)\n+\t\terr = iavf_switch_queue(adapter, tx_queue_id, false, true);\n+\telse\n+\t\terr = iavf_switch_queue_lv(adapter, tx_queue_id, false, true);\n \n \tif (err)\n \t\tPMD_DRV_LOG(ERR, \"Failed to switch TX queue %u on\",\n@@ -689,12 +698,22 @@ iavf_stop_queues(struct rte_eth_dev *dev)\n {\n \tstruct iavf_adapter *adapter =\n \t\tIAVF_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(dev->data->dev_private);\n \tstruct iavf_rx_queue *rxq;\n \tstruct iavf_tx_queue *txq;\n \tint ret, i;\n \n \t/* Stop All queues */\n-\tret = iavf_disable_queues(adapter);\n+\tif (!vf->lv_enabled) {\n+\t\tret = iavf_disable_queues(adapter);\n+\t\tif (ret)\n+\t\t\tPMD_DRV_LOG(WARNING, \"Fail to stop queues\");\n+\t} else {\n+\t\tret = iavf_disable_queues_lv(adapter);\n+\t\tif (ret)\n+\t\t\tPMD_DRV_LOG(WARNING, \"Fail to stop queues for large VF\");\n+\t}\n+\n \tif (ret)\n \t\tPMD_DRV_LOG(WARNING, \"Fail to stop queues\");\n \ndiff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.c\nindex 145a4ff9e..54d9917c0 100644\n--- a/drivers/net/iavf/iavf_vchnl.c\n+++ b/drivers/net/iavf/iavf_vchnl.c\n@@ -608,6 +608,138 @@ iavf_switch_queue(struct iavf_adapter *adapter, uint16_t qid,\n \treturn err;\n }\n \n+int\n+iavf_enable_queues_lv(struct iavf_adapter *adapter)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_del_ena_dis_queues *queue_select;\n+\tstruct virtchnl_queue_chunk *queue_chunk;\n+\tstruct iavf_cmd_info args;\n+\tint err, len;\n+\n+\tlen = sizeof(struct virtchnl_del_ena_dis_queues) +\n+\t\t  sizeof(struct virtchnl_queue_chunk) *\n+\t\t  (IAVF_RXTX_QUEUE_CHUNKS_NUM - 1);\n+\tqueue_select = rte_zmalloc(\"queue_select\", len, 0);\n+\tif (!queue_select)\n+\t\treturn -ENOMEM;\n+\n+\tqueue_chunk = queue_select->chunks.chunks;\n+\tqueue_select->chunks.num_chunks = IAVF_RXTX_QUEUE_CHUNKS_NUM;\n+\tqueue_select->vport_id = vf->vsi_res->vsi_id;\n+\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].type = VIRTCHNL_QUEUE_TYPE_TX;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].start_queue_id = 0;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].num_queues =\n+\t\tadapter->eth_dev->data->nb_tx_queues;\n+\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].type = VIRTCHNL_QUEUE_TYPE_RX;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].start_queue_id = 0;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].num_queues =\n+\t\tadapter->eth_dev->data->nb_rx_queues;\n+\n+\targs.ops = VIRTCHNL_OP_ENABLE_QUEUES_V2;\n+\targs.in_args = (u8 *)queue_select;\n+\targs.in_args_size = len;\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\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 OP_ENABLE_QUEUES_V2\");\n+\t\treturn err;\n+\t}\n+\treturn 0;\n+}\n+\n+int\n+iavf_disable_queues_lv(struct iavf_adapter *adapter)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_del_ena_dis_queues *queue_select;\n+\tstruct virtchnl_queue_chunk *queue_chunk;\n+\tstruct iavf_cmd_info args;\n+\tint err, len;\n+\n+\tlen = sizeof(struct virtchnl_del_ena_dis_queues) +\n+\t\t  sizeof(struct virtchnl_queue_chunk) *\n+\t\t  (IAVF_RXTX_QUEUE_CHUNKS_NUM - 1);\n+\tqueue_select = rte_zmalloc(\"queue_select\", len, 0);\n+\tif (!queue_select)\n+\t\treturn -ENOMEM;\n+\n+\tqueue_chunk = queue_select->chunks.chunks;\n+\tqueue_select->chunks.num_chunks = IAVF_RXTX_QUEUE_CHUNKS_NUM;\n+\tqueue_select->vport_id = vf->vsi_res->vsi_id;\n+\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].type = VIRTCHNL_QUEUE_TYPE_TX;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].start_queue_id = 0;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_TX].num_queues =\n+\t\tadapter->eth_dev->data->nb_tx_queues;\n+\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].type = VIRTCHNL_QUEUE_TYPE_RX;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].start_queue_id = 0;\n+\tqueue_chunk[VIRTCHNL_QUEUE_TYPE_RX].num_queues =\n+\t\tadapter->eth_dev->data->nb_rx_queues;\n+\n+\targs.ops = VIRTCHNL_OP_DISABLE_QUEUES_V2;\n+\targs.in_args = (u8 *)queue_select;\n+\targs.in_args_size = len;\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\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 OP_DISABLE_QUEUES_V2\");\n+\t\treturn err;\n+\t}\n+\treturn 0;\n+}\n+\n+int\n+iavf_switch_queue_lv(struct iavf_adapter *adapter, uint16_t qid,\n+\t\t bool rx, bool on)\n+{\n+\tstruct iavf_info *vf = IAVF_DEV_PRIVATE_TO_VF(adapter);\n+\tstruct virtchnl_del_ena_dis_queues *queue_select;\n+\tstruct virtchnl_queue_chunk *queue_chunk;\n+\tstruct iavf_cmd_info args;\n+\tint err, len;\n+\n+\tlen = sizeof(struct virtchnl_del_ena_dis_queues);\n+\tqueue_select = rte_zmalloc(\"queue_select\", len, 0);\n+\tif (!queue_select)\n+\t\treturn -ENOMEM;\n+\n+\tqueue_chunk = queue_select->chunks.chunks;\n+\tqueue_select->chunks.num_chunks = 1;\n+\tqueue_select->vport_id = vf->vsi_res->vsi_id;\n+\n+\tif (rx) {\n+\t\tqueue_chunk->type = VIRTCHNL_QUEUE_TYPE_RX;\n+\t\tqueue_chunk->start_queue_id = qid;\n+\t\tqueue_chunk->num_queues = 1;\n+\t} else {\n+\t\tqueue_chunk->type = VIRTCHNL_QUEUE_TYPE_TX;\n+\t\tqueue_chunk->start_queue_id = qid;\n+\t\tqueue_chunk->num_queues = 1;\n+\t}\n+\n+\tif (on)\n+\t\targs.ops = VIRTCHNL_OP_ENABLE_QUEUES_V2;\n+\telse\n+\t\targs.ops = VIRTCHNL_OP_DISABLE_QUEUES_V2;\n+\targs.in_args = (u8 *)queue_select;\n+\targs.in_args_size = len;\n+\targs.out_buffer = vf->aq_resp;\n+\targs.out_size = IAVF_AQ_BUF_SZ;\n+\terr = iavf_execute_vf_cmd(adapter, &args);\n+\tif (err)\n+\t\tPMD_DRV_LOG(ERR, \"Failed to execute command of %s\",\n+\t\t\t    on ? \"OP_ENABLE_QUEUES_V2\" : \"OP_DISABLE_QUEUES_V2\");\n+\treturn err;\n+}\n+\n int\n iavf_configure_rss_lut(struct iavf_adapter *adapter)\n {\n",
    "prefixes": [
        "v8",
        "6/6"
    ]
}