get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132080,
    "url": "https://patches.dpdk.org/api/patches/132080/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20230928074305.2991100-2-haijie1@huawei.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": "<20230928074305.2991100-2-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230928074305.2991100-2-haijie1@huawei.com",
    "date": "2023-09-28T07:42:58",
    "name": "[v2,1/8] lib/ethdev: update Rx and Tx queue status",
    "commit_ref": null,
    "pull_url": null,
    "state": "rejected",
    "archived": true,
    "hash": "74ae2e3e02cf4f3d9365be528100115d18aa8516",
    "submitter": {
        "id": 2935,
        "url": "https://patches.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20230928074305.2991100-2-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 29668,
            "url": "https://patches.dpdk.org/api/series/29668/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=29668",
            "date": "2023-09-28T07:42:57",
            "name": "fix Rx and Tx queue state",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/29668/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/132080/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/132080/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 168014265D;\n\tThu, 28 Sep 2023 09:46:26 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id CB20E4029D;\n\tThu, 28 Sep 2023 09:46:21 +0200 (CEST)",
            "from szxga08-in.huawei.com (szxga08-in.huawei.com [45.249.212.255])\n by mails.dpdk.org (Postfix) with ESMTP id 4F10240273\n for <dev@dpdk.org>; Thu, 28 Sep 2023 09:46:15 +0200 (CEST)",
            "from kwepemi500020.china.huawei.com (unknown [172.30.72.57])\n by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4Rx58D3Rf9z15NRL;\n Thu, 28 Sep 2023 15:43:56 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) by\n kwepemi500020.china.huawei.com (7.221.188.8) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2507.31; Thu, 28 Sep 2023 15:46:12 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<dev@dpdk.org>, Thomas Monjalon <thomas@monjalon.net>, Ferruh Yigit\n <ferruh.yigit@amd.com>, Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "CC": "<haijie1@huawei.com>, <lihuisong@huawei.com>",
        "Subject": "[PATCH v2 1/8] lib/ethdev: update Rx and Tx queue status",
        "Date": "Thu, 28 Sep 2023 15:42:58 +0800",
        "Message-ID": "<20230928074305.2991100-2-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20230928074305.2991100-1-haijie1@huawei.com>",
        "References": "<20230908112901.1169869-1-haijie1@huawei.com>\n <20230928074305.2991100-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.2]",
        "X-ClientProxiedBy": "dggems704-chm.china.huawei.com (10.3.19.181) To\n kwepemi500020.china.huawei.com (7.221.188.8)",
        "X-CFilter-Loop": "Reflected",
        "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": "The DPDK framework reports the queue status, which is stored in\n'dev->data->tx_queue_state' and 'dev->data->rx_queue_state'.The\nstate is currently maintained by the drivers. Users may determine\nwhether a queue participates in packet forwarding based on the\nstate. However, not all drivers correctly report the queue status.\nThis may cause forwarding problems.\n\nSince it is difficult to modify the queue status of all drivers,\nwe consider updating the queue status at the framework level.\nSome drivers support queues for hairpin, leaving status updating\nfor such queues to the drivers. Some drivers support\n'deferred_start'. Assume that all drivers that support\n'deferred_start' can obtain the configuration through\n'rte_eth_tx_queue_info_get' and 'rte_eth_rx_queue_info_get'. So\nwe can directly update the queue status in 'rte_eth_dev_start'\nand 'rte_eth_dev_stop'.\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n lib/ethdev/rte_ethdev.c | 40 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 40 insertions(+)",
    "diff": "diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 0840d2b5942a..e3aaa71eba9e 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -1641,6 +1641,9 @@ rte_eth_dev_start(uint16_t port_id)\n \tstruct rte_eth_dev_info dev_info;\n \tint diag;\n \tint ret, ret_stop;\n+\tuint16_t i;\n+\tstruct rte_eth_rxq_info rxq_info;\n+\tstruct rte_eth_txq_info txq_info;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n \tdev = &rte_eth_devices[port_id];\n@@ -1697,6 +1700,30 @@ rte_eth_dev_start(uint16_t port_id)\n \t\t(*dev->dev_ops->link_update)(dev, 0);\n \t}\n \n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\tif (rte_eth_dev_is_rx_hairpin_queue(dev, i))\n+\t\t\tcontinue;\n+\n+\t\tmemset(&rxq_info, 0, sizeof(rxq_info));\n+\t\tret = rte_eth_rx_queue_info_get(port_id, i, &rxq_info);\n+\t\tif (ret == 0 && rxq_info.conf.rx_deferred_start != 0)\n+\t\t\tdev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t\telse\n+\t\t\tdev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;\n+\t}\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\tif (rte_eth_dev_is_tx_hairpin_queue(dev, i))\n+\t\t\tcontinue;\n+\n+\t\tmemset(&txq_info, 0, sizeof(txq_info));\n+\t\tret = rte_eth_tx_queue_info_get(port_id, i, &txq_info);\n+\t\tif (ret == 0 && txq_info.conf.tx_deferred_start != 0)\n+\t\t\tdev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t\telse\n+\t\t\tdev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STARTED;\n+\t}\n+\n \t/* expose selection of PMD fast-path functions */\n \teth_dev_fp_ops_setup(rte_eth_fp_ops + port_id, dev);\n \n@@ -1708,6 +1735,7 @@ int\n rte_eth_dev_stop(uint16_t port_id)\n {\n \tstruct rte_eth_dev *dev;\n+\tuint16_t i;\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n@@ -1731,6 +1759,18 @@ rte_eth_dev_stop(uint16_t port_id)\n \t\tdev->data->dev_started = 0;\n \trte_ethdev_trace_stop(port_id, ret);\n \n+\tfor (i = 0; i < dev->data->nb_rx_queues; i++) {\n+\t\tif (rte_eth_dev_is_rx_hairpin_queue(dev, i))\n+\t\t\tcontinue;\n+\t\tdev->data->rx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t}\n+\n+\tfor (i = 0; i < dev->data->nb_tx_queues; i++) {\n+\t\tif (rte_eth_dev_is_tx_hairpin_queue(dev, i))\n+\t\t\tcontinue;\n+\t\tdev->data->tx_queue_state[i] = RTE_ETH_QUEUE_STATE_STOPPED;\n+\t}\n+\n \treturn ret;\n }\n \n",
    "prefixes": [
        "v2",
        "1/8"
    ]
}