get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 88492,
    "url": "http://patches.dpdk.org/api/patches/88492/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1614905757-33791-2-git-send-email-oulijun@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://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": "<1614905757-33791-2-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1614905757-33791-2-git-send-email-oulijun@huawei.com",
    "date": "2021-03-05T00:55:55",
    "name": "[1/3] app/testpmd: support Tx mbuf free on demand cmd",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "88de18ad20049a877b6c842e83686366e9748b75",
    "submitter": {
        "id": 1675,
        "url": "http://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/1614905757-33791-2-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15494,
            "url": "http://patches.dpdk.org/api/series/15494/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15494",
            "date": "2021-03-05T00:55:54",
            "name": "testpmd updates",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/15494/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/88492/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/88492/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 DC217A0561;\n\tFri,  5 Mar 2021 01:55:36 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5B81222A2FA;\n\tFri,  5 Mar 2021 01:55:21 +0100 (CET)",
            "from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by mails.dpdk.org (Postfix) with ESMTP id BAEB622A2DA\n for <dev@dpdk.org>; Fri,  5 Mar 2021 01:55:16 +0100 (CET)",
            "from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Ds8Nb3vYqzMjCY;\n Fri,  5 Mar 2021 08:53:03 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS412-HUB.china.huawei.com (10.3.19.212) with Microsoft SMTP Server id\n 14.3.498.0; Fri, 5 Mar 2021 08:55:12 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Fri, 5 Mar 2021 08:55:55 +0800",
        "Message-ID": "<1614905757-33791-2-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1614905757-33791-1-git-send-email-oulijun@huawei.com>",
        "References": "<1614905757-33791-1-git-send-email-oulijun@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-CFilter-Loop": "Reflected",
        "Subject": "[dpdk-dev] [PATCH 1/3] app/testpmd: support Tx mbuf free on demand\n cmd",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Chengwen Feng <fengchengwen@huawei.com>\n\nThis patch support tx_done_cleanup command:\ntx_done_cleanup port (port_id) (queue_id) (free_cnt)\n\nUser must make sure there are no concurrent access to the same Tx\nqueue (like rte_eth_tx_burst, rte_eth_dev_tx_queue_stop and so on)\nwhen this command executed.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n app/test-pmd/cmdline.c                      | 91 +++++++++++++++++++++++++++++\n doc/guides/rel_notes/release_21_05.rst      |  2 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst |  7 +++\n 3 files changed, 100 insertions(+)",
    "diff": "diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c\nindex 14110eb..832ae70 100644\n--- a/app/test-pmd/cmdline.c\n+++ b/app/test-pmd/cmdline.c\n@@ -36,6 +36,7 @@\n #include <rte_pci.h>\n #include <rte_ether.h>\n #include <rte_ethdev.h>\n+#include <rte_ethdev_driver.h>\n #include <rte_string_fns.h>\n #include <rte_devargs.h>\n #include <rte_flow.h>\n@@ -675,6 +676,9 @@ static void cmd_help_long_parsed(void *parsed_result,\n \t\t\t\"set port (port_id) ptype_mask (ptype_mask)\\n\"\n \t\t\t\"    set packet types classification for a specific port\\n\\n\"\n \n+\t\t\t\"tx_done_cleanup (port_id) (queue_id) (free_cnt)\\n\"\n+\t\t\t\"    Cleanup a tx queue's mbuf on a port\\n\\n\"\n+\n \t\t\t\"set port (port_id) queue-region region_id (value) \"\n \t\t\t\"queue_start_index (value) queue_num (value)\\n\"\n \t\t\t\"    Set a queue region on a port\\n\\n\"\n@@ -16910,6 +16914,92 @@ cmdline_parse_inst_t cmd_showport_macs = {\n \t},\n };\n \n+/* *** tx_done_cleanup *** */\n+struct cmd_tx_done_cleanup_result {\n+\tcmdline_fixed_string_t clean;\n+\tcmdline_fixed_string_t port;\n+\tuint16_t port_id;\n+\tuint16_t queue_id;\n+\tuint32_t free_cnt;\n+};\n+\n+static void\n+cmd_tx_done_cleanup_parsed(void *parsed_result,\n+\t\t\t   __rte_unused struct cmdline *cl,\n+\t\t\t   __rte_unused void *data)\n+{\n+\tstruct cmd_tx_done_cleanup_result *res = parsed_result;\n+\tstruct rte_eth_dev *dev;\n+\tuint16_t port_id = res->port_id;\n+\tuint16_t queue_id = res->queue_id;\n+\tuint32_t free_cnt = res->free_cnt;\n+\tint ret;\n+\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\n+\t\tprintf(\"Invalid port_id %u\\n\", port_id);\n+\t\treturn;\n+\t}\n+\n+\tdev = &rte_eth_devices[port_id];\n+\tif (queue_id >= dev->data->nb_tx_queues) {\n+\t\tprintf(\"Invalid TX queue_id %u\\n\", queue_id);\n+\t\treturn;\n+\t}\n+\n+\tif (dev->data->tx_queue_state[queue_id] !=\n+\t\tRTE_ETH_QUEUE_STATE_STARTED) {\n+\t\tprintf(\"TX queue_id %u not started!\\n\", queue_id);\n+\t\treturn;\n+\t}\n+\n+\t/*\n+\t * rte_eth_tx_done_cleanup is a dataplane API, user must make sure\n+\t * there are no concurrent access to the same Tx queue (like\n+\t * rte_eth_tx_burst, rte_eth_dev_tx_queue_stop and so on) when this API\n+\t * called.\n+\t */\n+\tret = rte_eth_tx_done_cleanup(port_id, queue_id, free_cnt);\n+\tif (ret < 0) {\n+\t\tprintf(\"Failed to cleanup mbuf for port %u TX queue %u \"\n+\t\t       \"error desc: %s(%d)\\n\",\n+\t\t       port_id, queue_id, strerror(-ret), ret);\n+\t\treturn;\n+\t}\n+\n+\tprintf(\"Cleanup port %u TX queue %u mbuf nums: %u\\n\",\n+\t       port_id, queue_id, ret);\n+}\n+\n+cmdline_parse_token_string_t cmd_tx_done_cleanup_clean =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tx_done_cleanup_result, clean,\n+\t\t\t\t \"tx_done_cleanup\");\n+cmdline_parse_token_string_t cmd_tx_done_cleanup_port =\n+\tTOKEN_STRING_INITIALIZER(struct cmd_tx_done_cleanup_result, port,\n+\t\t\t\t \"port\");\n+cmdline_parse_token_num_t cmd_tx_done_cleanup_port_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tx_done_cleanup_result, port_id,\n+\t\t\t      UINT16);\n+cmdline_parse_token_num_t cmd_tx_done_cleanup_queue_id =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tx_done_cleanup_result, queue_id,\n+\t\t\t      UINT16);\n+cmdline_parse_token_num_t cmd_tx_done_cleanup_free_cnt =\n+\tTOKEN_NUM_INITIALIZER(struct cmd_tx_done_cleanup_result, free_cnt,\n+\t\t\t      UINT32);\n+\n+cmdline_parse_inst_t cmd_tx_done_cleanup = {\n+\t.f = cmd_tx_done_cleanup_parsed,\n+\t.data = NULL,\n+\t.help_str = \"tx_done_cleanup port <port_id> <queue_id> <free_cnt>\",\n+\t.tokens = {\n+\t\t(void *)&cmd_tx_done_cleanup_clean,\n+\t\t(void *)&cmd_tx_done_cleanup_port,\n+\t\t(void *)&cmd_tx_done_cleanup_port_id,\n+\t\t(void *)&cmd_tx_done_cleanup_queue_id,\n+\t\t(void *)&cmd_tx_done_cleanup_free_cnt,\n+\t\tNULL,\n+\t},\n+};\n+\n /* ******************************************************************************** */\n \n /* list of instructions */\n@@ -17035,6 +17125,7 @@ cmdline_parse_ctx_t main_ctx[] = {\n \t(cmdline_parse_inst_t *)&cmd_config_rss_reta,\n \t(cmdline_parse_inst_t *)&cmd_showport_reta,\n \t(cmdline_parse_inst_t *)&cmd_showport_macs,\n+\t(cmdline_parse_inst_t *)&cmd_tx_done_cleanup,\n \t(cmdline_parse_inst_t *)&cmd_config_burst,\n \t(cmdline_parse_inst_t *)&cmd_config_thresh,\n \t(cmdline_parse_inst_t *)&cmd_config_threshold,\ndiff --git a/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst\nindex 23f7f0b..8077573 100644\n--- a/doc/guides/rel_notes/release_21_05.rst\n+++ b/doc/guides/rel_notes/release_21_05.rst\n@@ -69,6 +69,8 @@ New Features\n \n   * Added command to display Rx queue used descriptor count.\n     ``show port (port_id) rxq (queue_id) desc used count``\n+  * Added command to cleanup a Tx queue's mbuf on a port.\n+    ``tx_done_cleanup port <port_id> <queue_id> <free_cnt>``\n \n \n Removed Items\ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex f59eb8a..39281f5 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -272,6 +272,13 @@ and ready to be processed by the driver on a given RX queue::\n \n    testpmd> show port (port_id) rxq (queue_id) desc used count\n \n+cleanup txq mbufs\n+~~~~~~~~~~~~~~~~~~~~~~~~\n+\n+Request the driver to free mbufs currently cached by the driver for a given port's\n+Tx queue::\n+   testpmd> tx_done_cleanup port (port_id) (queue_id) (free_cnt)\n+\n show config\n ~~~~~~~~~~~\n \n",
    "prefixes": [
        "1/3"
    ]
}