get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122655,
    "url": "http://patchwork.dpdk.org/api/patches/122655/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230130062642.3337239-5-junfeng.guo@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": "<20230130062642.3337239-5-junfeng.guo@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230130062642.3337239-5-junfeng.guo@intel.com",
    "date": "2023-01-30T06:26:37",
    "name": "[RFC,v2,4/9] net/gve: support queue release and stop for DQO",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "876ca8b1227eabc0fa4ce8b5afa8c507a9939356",
    "submitter": {
        "id": 1785,
        "url": "http://patchwork.dpdk.org/api/people/1785/?format=api",
        "name": "Junfeng Guo",
        "email": "junfeng.guo@intel.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230130062642.3337239-5-junfeng.guo@intel.com/mbox/",
    "series": [
        {
            "id": 26684,
            "url": "http://patchwork.dpdk.org/api/series/26684/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=26684",
            "date": "2023-01-30T06:26:33",
            "name": "gve PMD enhancement",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/26684/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/122655/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/122655/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 44370424BA;\n\tMon, 30 Jan 2023 07:32:42 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 239EA42B8E;\n\tMon, 30 Jan 2023 07:32:29 +0100 (CET)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n by mails.dpdk.org (Postfix) with ESMTP id F17C142D29\n for <dev@dpdk.org>; Mon, 30 Jan 2023 07:32:27 +0100 (CET)",
            "from orsmga004.jf.intel.com ([10.7.209.38])\n by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 29 Jan 2023 22:32:27 -0800",
            "from dpdk-jf-ntb-one.sh.intel.com ([10.67.111.104])\n by orsmga004.jf.intel.com with ESMTP; 29 Jan 2023 22:32:24 -0800"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple;\n d=intel.com; i=@intel.com; q=dns/txt; s=Intel;\n t=1675060348; x=1706596348;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=s4csOlqgcxrtmJhT5Ew7Sx7toMhq7kjfzK+NzcvnKRc=;\n b=WEIgN7PnEweg3HWGlPzSxQUzkbNh69sdTZ0otMzMeR5yyeg7vAVwAosl\n DSAvGHANH4C1StOdBLj6sA0clwZgkWuUOdAEMr8Z9oqGhESw5FAgeJS7X\n 3dZIA++nG9G6hplUjI4IZRaLGYklQGwFzc3jGSi1ZVPd38Zb0jx/8B9+P\n 91d09OxWl9YFm4K3hQgmrR7V+8mTvsKgN5FnnL0Qv7AAUdYLYQ7QNeJ9M\n yRrhxlv0tr5pjEoG/cZTA6ynE73o/TdFPxlNV/20QqBgq5MDp6y4se2xY\n pB0E6TpiW8w7PmwkJr3V83oljdgT1QHFyJwJJfitXRtmISo3z8K39B3bT Q==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10605\"; a=\"392035686\"",
            "E=Sophos;i=\"5.97,257,1669104000\"; d=\"scan'208\";a=\"392035686\"",
            "E=McAfee;i=\"6500,9779,10605\"; a=\"787906454\"",
            "E=Sophos;i=\"5.97,257,1669104000\"; d=\"scan'208\";a=\"787906454\""
        ],
        "X-ExtLoop1": "1",
        "From": "Junfeng Guo <junfeng.guo@intel.com>",
        "To": "qi.z.zhang@intel.com, jingjing.wu@intel.com, ferruh.yigit@amd.com,\n beilei.xing@intel.com",
        "Cc": "dev@dpdk.org, xiaoyun.li@intel.com, helin.zhang@intel.com,\n Junfeng Guo <junfeng.guo@intel.com>, Rushil Gupta <rushilg@google.com>,\n Jordan Kimbrough <jrkim@google.com>, Jeroen de Borst <jeroendb@google.com>",
        "Subject": "[RFC v2 4/9] net/gve: support queue release and stop for DQO",
        "Date": "Mon, 30 Jan 2023 14:26:37 +0800",
        "Message-Id": "<20230130062642.3337239-5-junfeng.guo@intel.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230130062642.3337239-1-junfeng.guo@intel.com>",
        "References": "<20230118025347.1567078-1-junfeng.guo@intel.com>\n <20230130062642.3337239-1-junfeng.guo@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": "Add support for queue operations:\n - gve_tx_queue_release_dqo\n - gve_rx_queue_release_dqo\n - gve_stop_tx_queues_dqo\n - gve_stop_rx_queues_dqo\n\nSigned-off-by: Junfeng Guo <junfeng.guo@intel.com>\nSigned-off-by: Rushil Gupta <rushilg@google.com>\nSigned-off-by: Jordan Kimbrough <jrkim@google.com>\nSigned-off-by: Jeroen de Borst <jeroendb@google.com>\n---\n drivers/net/gve/gve_ethdev.c | 18 +++++++++---\n drivers/net/gve/gve_ethdev.h | 12 ++++++++\n drivers/net/gve/gve_rx.c     |  3 ++\n drivers/net/gve/gve_rx_dqo.c | 57 ++++++++++++++++++++++++++++++++++++\n drivers/net/gve/gve_tx.c     |  3 ++\n drivers/net/gve/gve_tx_dqo.c | 55 ++++++++++++++++++++++++++++++++++\n 6 files changed, 144 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/gve/gve_ethdev.c b/drivers/net/gve/gve_ethdev.c\nindex 3543378978..7c4be3a1cb 100644\n--- a/drivers/net/gve/gve_ethdev.c\n+++ b/drivers/net/gve/gve_ethdev.c\n@@ -292,11 +292,19 @@ gve_dev_close(struct rte_eth_dev *dev)\n \t\t\tPMD_DRV_LOG(ERR, \"Failed to stop dev.\");\n \t}\n \n-\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n-\t\tgve_tx_queue_release(dev, i);\n+\tif (gve_is_gqi(priv)) {\n+\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n+\t\t\tgve_tx_queue_release(dev, i);\n+\n+\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\t\tgve_rx_queue_release(dev, i);\n+\t} else {\n+\t\tfor (i = 0; i < dev->data->nb_tx_queues; i++)\n+\t\t\tgve_tx_queue_release_dqo(dev, i);\n \n-\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n-\t\tgve_rx_queue_release(dev, i);\n+\t\tfor (i = 0; i < dev->data->nb_rx_queues; i++)\n+\t\t\tgve_rx_queue_release_dqo(dev, i);\n+\t}\n \n \tgve_free_qpls(priv);\n \trte_free(priv->adminq);\n@@ -408,6 +416,8 @@ gve_eth_dev_ops_override(struct eth_dev_ops *local_eth_dev_ops)\n \t/* override eth_dev ops for DQO */\n \tlocal_eth_dev_ops->tx_queue_setup = gve_tx_queue_setup_dqo;\n \tlocal_eth_dev_ops->rx_queue_setup = gve_rx_queue_setup_dqo;\n+\tlocal_eth_dev_ops->tx_queue_release = gve_tx_queue_release_dqo;\n+\tlocal_eth_dev_ops->rx_queue_release = gve_rx_queue_release_dqo;\n }\n \n static void\ndiff --git a/drivers/net/gve/gve_ethdev.h b/drivers/net/gve/gve_ethdev.h\nindex 0adfc90554..93314f2db3 100644\n--- a/drivers/net/gve/gve_ethdev.h\n+++ b/drivers/net/gve/gve_ethdev.h\n@@ -353,4 +353,16 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,\n \t\t       uint16_t nb_desc, unsigned int socket_id,\n \t\t       const struct rte_eth_txconf *conf);\n \n+void\n+gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);\n+\n+void\n+gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid);\n+\n+void\n+gve_stop_tx_queues_dqo(struct rte_eth_dev *dev);\n+\n+void\n+gve_stop_rx_queues_dqo(struct rte_eth_dev *dev);\n+\n #endif /* _GVE_ETHDEV_H_ */\ndiff --git a/drivers/net/gve/gve_rx.c b/drivers/net/gve/gve_rx.c\nindex 518c9d109c..9ba975c9b4 100644\n--- a/drivers/net/gve/gve_rx.c\n+++ b/drivers/net/gve/gve_rx.c\n@@ -343,6 +343,9 @@ gve_stop_rx_queues(struct rte_eth_dev *dev)\n \tuint16_t i;\n \tint err;\n \n+\tif (!gve_is_gqi(hw))\n+\t\treturn gve_stop_rx_queues_dqo(dev);\n+\n \terr = gve_adminq_destroy_rx_queues(hw, dev->data->nb_rx_queues);\n \tif (err != 0)\n \t\tPMD_DRV_LOG(WARNING, \"failed to destroy rxqs\");\ndiff --git a/drivers/net/gve/gve_rx_dqo.c b/drivers/net/gve/gve_rx_dqo.c\nindex e8a6d575fc..aca6f8ea2d 100644\n--- a/drivers/net/gve/gve_rx_dqo.c\n+++ b/drivers/net/gve/gve_rx_dqo.c\n@@ -5,6 +5,38 @@\n #include \"gve_ethdev.h\"\n #include \"base/gve_adminq.h\"\n \n+static inline void\n+gve_release_rxq_mbufs_dqo(struct gve_rx_queue *rxq)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < rxq->nb_rx_desc; i++) {\n+\t\tif (rxq->sw_ring[i]) {\n+\t\t\trte_pktmbuf_free_seg(rxq->sw_ring[i]);\n+\t\t\trxq->sw_ring[i] = NULL;\n+\t\t}\n+\t}\n+\n+\trxq->nb_avail = rxq->nb_rx_desc;\n+}\n+\n+void\n+gve_rx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid)\n+{\n+\tstruct gve_rx_queue *q = dev->data->rx_queues[qid];\n+\n+\tif (q == NULL)\n+\t\treturn;\n+\n+\tgve_release_rxq_mbufs_dqo(q);\n+\trte_free(q->sw_ring);\n+\trte_memzone_free(q->compl_ring_mz);\n+\trte_memzone_free(q->mz);\n+\trte_memzone_free(q->qres_mz);\n+\tq->qres = NULL;\n+\trte_free(q);\n+}\n+\n static void\n gve_reset_rxq_dqo(struct gve_rx_queue *rxq)\n {\n@@ -54,6 +86,12 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,\n \t}\n \tnb_desc = hw->rx_desc_cnt;\n \n+\t/* Free memory if needed */\n+\tif (dev->data->rx_queues[queue_id]) {\n+\t\tgve_rx_queue_release_dqo(dev, queue_id);\n+\t\tdev->data->rx_queues[queue_id] = NULL;\n+\t}\n+\n \t/* Allocate the RX queue data structure. */\n \trxq = rte_zmalloc_socket(\"gve rxq\",\n \t\t\t\t sizeof(struct gve_rx_queue),\n@@ -146,3 +184,22 @@ gve_rx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,\n \trte_free(rxq);\n \treturn err;\n }\n+\n+void\n+gve_stop_rx_queues_dqo(struct rte_eth_dev *dev)\n+{\n+\tstruct gve_priv *hw = dev->data->dev_private;\n+\tstruct gve_rx_queue *rxq;\n+\tuint16_t i;\n+\tint err;\n+\n+\terr = gve_adminq_destroy_rx_queues(hw, dev->data->nb_rx_queues);\n+\tif (err != 0)\n+\t\tPMD_DRV_LOG(WARNING, \"failed to destroy rxqs\");\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tgve_release_rxq_mbufs_dqo(rxq);\n+\t\tgve_reset_rxq_dqo(rxq);\n+\t}\n+}\ndiff --git a/drivers/net/gve/gve_tx.c b/drivers/net/gve/gve_tx.c\nindex bf4e8fea2c..0eb42b1216 100644\n--- a/drivers/net/gve/gve_tx.c\n+++ b/drivers/net/gve/gve_tx.c\n@@ -658,6 +658,9 @@ gve_stop_tx_queues(struct rte_eth_dev *dev)\n \tuint16_t i;\n \tint err;\n \n+\tif (!gve_is_gqi(hw))\n+\t\treturn gve_stop_tx_queues_dqo(dev);\n+\n \terr = gve_adminq_destroy_tx_queues(hw, dev->data->nb_tx_queues);\n \tif (err != 0)\n \t\tPMD_DRV_LOG(WARNING, \"failed to destroy txqs\");\ndiff --git a/drivers/net/gve/gve_tx_dqo.c b/drivers/net/gve/gve_tx_dqo.c\nindex 4f8bad31bb..e2e4153f27 100644\n--- a/drivers/net/gve/gve_tx_dqo.c\n+++ b/drivers/net/gve/gve_tx_dqo.c\n@@ -5,6 +5,36 @@\n #include \"gve_ethdev.h\"\n #include \"base/gve_adminq.h\"\n \n+static inline void\n+gve_release_txq_mbufs_dqo(struct gve_tx_queue *txq)\n+{\n+\tuint16_t i;\n+\n+\tfor (i = 0; i < txq->sw_size; i++) {\n+\t\tif (txq->sw_ring[i]) {\n+\t\t\trte_pktmbuf_free_seg(txq->sw_ring[i]);\n+\t\t\ttxq->sw_ring[i] = NULL;\n+\t\t}\n+\t}\n+}\n+\n+void\n+gve_tx_queue_release_dqo(struct rte_eth_dev *dev, uint16_t qid)\n+{\n+\tstruct gve_tx_queue *q = dev->data->tx_queues[qid];\n+\n+\tif (q == NULL)\n+\t\treturn;\n+\n+\tgve_release_txq_mbufs_dqo(q);\n+\trte_free(q->sw_ring);\n+\trte_memzone_free(q->mz);\n+\trte_memzone_free(q->compl_ring_mz);\n+\trte_memzone_free(q->qres_mz);\n+\tq->qres = NULL;\n+\trte_free(q);\n+}\n+\n static int\n check_tx_thresh_dqo(uint16_t nb_desc, uint16_t tx_rs_thresh,\n \t\t    uint16_t tx_free_thresh)\n@@ -90,6 +120,12 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,\n \t}\n \tnb_desc = hw->tx_desc_cnt;\n \n+\t/* Free memory if needed. */\n+\tif (dev->data->tx_queues[queue_id]) {\n+\t\tgve_tx_queue_release_dqo(dev, queue_id);\n+\t\tdev->data->tx_queues[queue_id] = NULL;\n+\t}\n+\n \t/* Allocate the TX queue data structure. */\n \ttxq = rte_zmalloc_socket(\"gve txq\",\n \t\t\t\t sizeof(struct gve_tx_queue),\n@@ -176,3 +212,22 @@ gve_tx_queue_setup_dqo(struct rte_eth_dev *dev, uint16_t queue_id,\n \trte_free(txq);\n \treturn err;\n }\n+\n+void\n+gve_stop_tx_queues_dqo(struct rte_eth_dev *dev)\n+{\n+\tstruct gve_priv *hw = dev->data->dev_private;\n+\tstruct gve_tx_queue *txq;\n+\tuint16_t i;\n+\tint err;\n+\n+\terr = gve_adminq_destroy_tx_queues(hw, dev->data->nb_tx_queues);\n+\tif (err != 0)\n+\t\tPMD_DRV_LOG(WARNING, \"failed to destroy txqs\");\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\ttxq = dev->data->tx_queues[i];\n+\t\tgve_release_txq_mbufs_dqo(txq);\n+\t\tgve_reset_txq_dqo(txq);\n+\t}\n+}\n",
    "prefixes": [
        "RFC",
        "v2",
        "4/9"
    ]
}