get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 122013,
    "url": "https://patches.dpdk.org/api/patches/122013/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230113081931.221576-7-mingxia.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": "<20230113081931.221576-7-mingxia.liu@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230113081931.221576-7-mingxia.liu@intel.com",
    "date": "2023-01-13T08:19:16",
    "name": "[v2,06/21] net/cpfl: support queue stop",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "f987a299d94ba5f952eb2811ae9f6529b51cf213",
    "submitter": {
        "id": 2514,
        "url": "https://patches.dpdk.org/api/people/2514/?format=api",
        "name": "Liu, Mingxia",
        "email": "mingxia.liu@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "https://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230113081931.221576-7-mingxia.liu@intel.com/mbox/",
    "series": [
        {
            "id": 26532,
            "url": "https://patches.dpdk.org/api/series/26532/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=26532",
            "date": "2023-01-13T08:19:10",
            "name": "add support for cpfl PMD in DPDK",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/26532/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/122013/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/122013/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 BE7EE423C1;\n\tFri, 13 Jan 2023 10:15:38 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F026C42DCF;\n\tFri, 13 Jan 2023 10:15:22 +0100 (CET)",
            "from mga17.intel.com (mga17.intel.com [192.55.52.151])\n by mails.dpdk.org (Postfix) with ESMTP id D113B410D4\n for <dev@dpdk.org>; Fri, 13 Jan 2023 10:15:17 +0100 (CET)",
            "from fmsmga006.fm.intel.com ([10.253.24.20])\n by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 13 Jan 2023 01:15:02 -0800",
            "from dpdk-mingxial-01.sh.intel.com ([10.67.119.167])\n by fmsmga006.fm.intel.com with ESMTP; 13 Jan 2023 01:15:00 -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=1673601318; x=1705137318;\n h=from:to:cc:subject:date:message-id:in-reply-to:\n references:mime-version:content-transfer-encoding;\n bh=u4g5hriFiDO7NI4j3wGWGvl1RZwLrjwhpL/qzHoNA2Q=;\n b=cil3hqxhCRFLTHrPcqnQ5wKrSRYQJzFyCHamlWOJ+wVmTVahFqOPqsC1\n r2nWDr/YKjwwuXSXdCsRy8tDEN/ew8SmMc0QjxGYEfVO0UiQR2hMhnwLE\n YobJH8obyX8ZLaA4zREgVMEDCBgdCx/3WcV3WpQbCsqqPXEu/Yjah9g/J\n 5EtDpxQ6nGFfmJev2i8fEBgnSjJ6RXgnewopEldabOMx79NScatMz/67+\n 4YsrOAYp+KhQ7aJhcvreh1AoQwFHxYw7NvPRWsv7OqolkFeS5UBo+UvsK\n gz0AO3Uq8iT9XhTgA5zBtUhQOjXSf1RG7OaQzVJitxqNxr45KdJHBuuqW w==;",
        "X-IronPort-AV": [
            "E=McAfee;i=\"6500,9779,10588\"; a=\"304332488\"",
            "E=Sophos;i=\"5.97,213,1669104000\"; d=\"scan'208\";a=\"304332488\"",
            "E=McAfee;i=\"6500,9779,10588\"; a=\"903522591\"",
            "E=Sophos;i=\"5.97,213,1669104000\"; d=\"scan'208\";a=\"903522591\""
        ],
        "X-ExtLoop1": "1",
        "From": "Mingxia Liu <mingxia.liu@intel.com>",
        "To": "dev@dpdk.org, qi.z.zhang@intel.com, jingjing.wu@intel.com,\n beilei.xing@intel.com",
        "Cc": "wenjun1.wu@intel.com,\n\tMingxia Liu <mingxia.liu@intel.com>",
        "Subject": "[PATCH v2 06/21] net/cpfl: support queue stop",
        "Date": "Fri, 13 Jan 2023 08:19:16 +0000",
        "Message-Id": "<20230113081931.221576-7-mingxia.liu@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230113081931.221576-1-mingxia.liu@intel.com>",
        "References": "<20221223015558.3143279-1-mingxia.liu@intel.com>\n <20230113081931.221576-1-mingxia.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": "Add support for these device ops:\n - rx_queue_stop\n - tx_queue_stop\n\nSigned-off-by: Mingxia Liu <mingxia.liu@intel.com>\n---\n drivers/net/cpfl/cpfl_ethdev.c | 10 +++-\n drivers/net/cpfl/cpfl_rxtx.c   | 87 ++++++++++++++++++++++++++++++++++\n drivers/net/cpfl/cpfl_rxtx.h   |  3 ++\n 3 files changed, 99 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/drivers/net/cpfl/cpfl_ethdev.c b/drivers/net/cpfl/cpfl_ethdev.c\nindex 51d6243028..a80e916ae4 100644\n--- a/drivers/net/cpfl/cpfl_ethdev.c\n+++ b/drivers/net/cpfl/cpfl_ethdev.c\n@@ -233,12 +233,16 @@ cpfl_dev_start(struct rte_eth_dev *dev)\n \tret = idpf_vc_ena_dis_vport(vport, true);\n \tif (ret != 0) {\n \t\tPMD_DRV_LOG(ERR, \"Failed to enable vport\");\n-\t\treturn ret;\n+\t\tgoto err_vport;\n \t}\n \n \tvport->stopped = 0;\n \n \treturn 0;\n+\n+err_vport:\n+\tcpfl_stop_queues(dev);\n+\treturn ret;\n }\n \n static int\n@@ -251,6 +255,8 @@ cpfl_dev_stop(struct rte_eth_dev *dev)\n \n \tidpf_vc_ena_dis_vport(vport, false);\n \n+\tcpfl_stop_queues(dev);\n+\n \tvport->stopped = 1;\n \n \treturn 0;\n@@ -616,6 +622,8 @@ static const struct eth_dev_ops cpfl_eth_dev_ops = {\n \t.link_update\t\t\t= cpfl_dev_link_update,\n \t.rx_queue_start\t\t\t= cpfl_rx_queue_start,\n \t.tx_queue_start\t\t\t= cpfl_tx_queue_start,\n+\t.rx_queue_stop\t\t\t= cpfl_rx_queue_stop,\n+\t.tx_queue_stop\t\t\t= cpfl_tx_queue_stop,\n \t.dev_supported_ptypes_get\t= cpfl_dev_supported_ptypes_get,\n };\n \ndiff --git a/drivers/net/cpfl/cpfl_rxtx.c b/drivers/net/cpfl/cpfl_rxtx.c\nindex aa67db1e92..b7d616de4f 100644\n--- a/drivers/net/cpfl/cpfl_rxtx.c\n+++ b/drivers/net/cpfl/cpfl_rxtx.c\n@@ -612,3 +612,90 @@ cpfl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \n \treturn err;\n }\n+\n+int\n+cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_rx_queue *rxq;\n+\tint err;\n+\n+\tif (rx_queue_id >= dev->data->nb_rx_queues)\n+\t\treturn -EINVAL;\n+\n+\terr = idpf_switch_queue(vport, rx_queue_id, true, false);\n+\tif (err != 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to switch RX queue %u off\",\n+\t\t\t    rx_queue_id);\n+\t\treturn err;\n+\t}\n+\n+\trxq = dev->data->rx_queues[rx_queue_id];\n+\tif (vport->rxq_model == VIRTCHNL2_QUEUE_MODEL_SINGLE) {\n+\t\trxq->ops->release_mbufs(rxq);\n+\t\treset_single_rx_queue(rxq);\n+\t} else {\n+\t\trxq->bufq1->ops->release_mbufs(rxq->bufq1);\n+\t\trxq->bufq2->ops->release_mbufs(rxq->bufq2);\n+\t\treset_split_rx_queue(rxq);\n+\t}\n+\tdev->data->rx_queue_state[rx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\n+\treturn 0;\n+}\n+\n+int\n+cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n+{\n+\tstruct idpf_vport *vport = dev->data->dev_private;\n+\tstruct idpf_tx_queue *txq;\n+\tint err;\n+\n+\tif (tx_queue_id >= dev->data->nb_tx_queues)\n+\t\treturn -EINVAL;\n+\n+\terr = idpf_switch_queue(vport, tx_queue_id, false, false);\n+\tif (err != 0) {\n+\t\tPMD_DRV_LOG(ERR, \"Failed to switch TX queue %u off\",\n+\t\t\t    tx_queue_id);\n+\t\treturn err;\n+\t}\n+\n+\ttxq = dev->data->tx_queues[tx_queue_id];\n+\ttxq->ops->release_mbufs(txq);\n+\tif (vport->txq_model == VIRTCHNL2_QUEUE_MODEL_SINGLE) {\n+\t\treset_single_tx_queue(txq);\n+\t} else {\n+\t\treset_split_tx_descq(txq);\n+\t\treset_split_tx_complq(txq->complq);\n+\t}\n+\tdev->data->tx_queue_state[tx_queue_id] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\n+\treturn 0;\n+}\n+\n+void\n+cpfl_stop_queues(struct rte_eth_dev *dev)\n+{\n+\tstruct idpf_rx_queue *rxq;\n+\tstruct idpf_tx_queue *txq;\n+\tint i;\n+\n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\trxq = dev->data->rx_queues[i];\n+\t\tif (rxq == NULL)\n+\t\t\tcontinue;\n+\n+\t\tif (cpfl_rx_queue_stop(dev, i) != 0)\n+\t\t\tPMD_DRV_LOG(WARNING, \"Fail to stop Rx queue %d\", i);\n+\t}\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\ttxq = dev->data->tx_queues[i];\n+\t\tif (txq == NULL)\n+\t\t\tcontinue;\n+\n+\t\tif (cpfl_tx_queue_stop(dev, i) != 0)\n+\t\t\tPMD_DRV_LOG(WARNING, \"Fail to stop Tx queue %d\", i);\n+\t}\n+}\ndiff --git a/drivers/net/cpfl/cpfl_rxtx.h b/drivers/net/cpfl/cpfl_rxtx.h\nindex 2fa7950775..6b63137d5c 100644\n--- a/drivers/net/cpfl/cpfl_rxtx.h\n+++ b/drivers/net/cpfl/cpfl_rxtx.h\n@@ -32,4 +32,7 @@ int cpfl_rx_queue_init(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int cpfl_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int cpfl_tx_queue_init(struct rte_eth_dev *dev, uint16_t tx_queue_id);\n int cpfl_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);\n+void cpfl_stop_queues(struct rte_eth_dev *dev);\n+int cpfl_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id);\n+int cpfl_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n #endif /* _CPFL_RXTX_H_ */\n",
    "prefixes": [
        "v2",
        "06/21"
    ]
}