get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87653,
    "url": "https://patches.dpdk.org/api/patches/87653/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1612338382-3253-4-git-send-email-oulijun@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": "<1612338382-3253-4-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612338382-3253-4-git-send-email-oulijun@huawei.com",
    "date": "2021-02-03T07:46:08",
    "name": "[03/17] net/hns3: implement cleanup for Tx done",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "afda937ee7d71abad7b7b1ff5bdd59c8bf3a1373",
    "submitter": {
        "id": 1675,
        "url": "https://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@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/1612338382-3253-4-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15115,
            "url": "https://patches.dpdk.org/api/series/15115/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15115",
            "date": "2021-02-03T07:46:05",
            "name": "bugfixes and small functionality for hns3",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15115/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87653/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/87653/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 6C2F8A0A0E;\n\tWed,  3 Feb 2021 08:47:02 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 38E05240449;\n\tWed,  3 Feb 2021 08:46:55 +0100 (CET)",
            "from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by mails.dpdk.org (Postfix) with ESMTP id F131E24043E\n for <dev@dpdk.org>; Wed,  3 Feb 2021 08:46:52 +0100 (CET)",
            "from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DVtyf5Vv2zjGRW;\n Wed,  3 Feb 2021 15:45:46 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id\n 14.3.498.0; Wed, 3 Feb 2021 15:46:48 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Wed, 3 Feb 2021 15:46:08 +0800",
        "Message-ID": "<1612338382-3253-4-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1612338382-3253-1-git-send-email-oulijun@huawei.com>",
        "References": "<1612338382-3253-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 03/17] net/hns3: implement cleanup for Tx done",
        "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 add support tx_done_cleanup ops, which could support for\nthe API rte_eth_tx_done_cleanup to free consumed mbufs on Tx ring.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\nDepends-on: series-10000 (\"update doc for hns3\")\n---\n doc/guides/nics/features/hns3.ini    |  1 +\n doc/guides/nics/features/hns3_vf.ini |  1 +\n drivers/net/hns3/hns3_ethdev.c       |  1 +\n drivers/net/hns3/hns3_ethdev_vf.c    |  1 +\n drivers/net/hns3/hns3_rxtx.c         | 59 ++++++++++++++++++++++++++++++++++++\n drivers/net/hns3/hns3_rxtx.h         |  1 +\n 6 files changed, 64 insertions(+)",
    "diff": "diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini\nindex 40febb0..aa4cba2 100644\n--- a/doc/guides/nics/features/hns3.ini\n+++ b/doc/guides/nics/features/hns3.ini\n@@ -10,6 +10,7 @@ Queue start/stop     = Y\n Runtime Rx queue setup = Y\n Runtime Tx queue setup = Y\n Burst mode info      = Y\n+Free Tx mbuf on demand = Y\n MTU update           = Y\n Jumbo frame          = Y\n Scattered Rx         = Y\ndiff --git a/doc/guides/nics/features/hns3_vf.ini b/doc/guides/nics/features/hns3_vf.ini\nindex 99a0bf0..c796cd5 100644\n--- a/doc/guides/nics/features/hns3_vf.ini\n+++ b/doc/guides/nics/features/hns3_vf.ini\n@@ -10,6 +10,7 @@ Queue start/stop     = Y\n Runtime Rx queue setup = Y\n Runtime Tx queue setup = Y\n Burst mode info      = Y\n+Free Tx mbuf on demand = Y\n MTU update           = Y\n Jumbo frame          = Y\n Scattered Rx         = Y\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 31418b8..f85149d 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -6321,6 +6321,7 @@ static const struct eth_dev_ops hns3_eth_dev_ops = {\n \t.fec_get                = hns3_fec_get,\n \t.fec_set                = hns3_fec_set,\n \t.tm_ops_get             = hns3_tm_ops_get,\n+\t.tx_done_cleanup        = hns3_tx_done_cleanup,\n };\n \n static const struct hns3_reset_ops hns3_reset_ops = {\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex faf7e01..11cab37 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -2738,6 +2738,7 @@ static const struct eth_dev_ops hns3vf_eth_dev_ops = {\n \t.vlan_offload_set   = hns3vf_vlan_offload_set,\n \t.get_reg            = hns3_get_regs,\n \t.dev_supported_ptypes_get = hns3_dev_supported_ptypes_get,\n+\t.tx_done_cleanup    = hns3_tx_done_cleanup,\n };\n \n static const struct hns3_reset_ops hns3vf_reset_ops = {\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 222cf8a..5e79177 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -3913,6 +3913,65 @@ hns3_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \treturn 0;\n }\n \n+static int\n+hns3_tx_done_cleanup_full(struct hns3_tx_queue *txq, uint32_t free_cnt)\n+{\n+\tuint16_t next_to_clean = txq->next_to_clean;\n+\tuint16_t next_to_use   = txq->next_to_use;\n+\tuint16_t tx_bd_ready   = txq->tx_bd_ready;\n+\tstruct hns3_entry *tx_pkt = &txq->sw_ring[next_to_clean];\n+\tstruct hns3_desc *desc = &txq->tx_ring[next_to_clean];\n+\tuint32_t idx;\n+\n+\tif (free_cnt == 0 || free_cnt > txq->nb_tx_desc)\n+\t\tfree_cnt = txq->nb_tx_desc;\n+\n+\tfor (idx = 0; idx < free_cnt; idx++) {\n+\t\tif (next_to_clean == next_to_use)\n+\t\t\tbreak;\n+\n+\t\tif (desc->tx.tp_fe_sc_vld_ra_ri &\n+\t\t    rte_cpu_to_le_16(BIT(HNS3_TXD_VLD_B)))\n+\t\t\tbreak;\n+\n+\t\tif (tx_pkt->mbuf != NULL) {\n+\t\t\trte_pktmbuf_free_seg(tx_pkt->mbuf);\n+\t\t\ttx_pkt->mbuf = NULL;\n+\t\t}\n+\n+\t\tnext_to_clean++;\n+\t\ttx_bd_ready++;\n+\t\ttx_pkt++;\n+\t\tdesc++;\n+\t\tif (next_to_clean == txq->nb_tx_desc) {\n+\t\t\ttx_pkt = txq->sw_ring;\n+\t\t\tdesc = txq->tx_ring;\n+\t\t\tnext_to_clean = 0;\n+\t\t}\n+\t}\n+\n+\tif (idx > 0) {\n+\t\ttxq->next_to_clean = next_to_clean;\n+\t\ttxq->tx_bd_ready = tx_bd_ready;\n+\t}\n+\n+\treturn (int)idx;\n+}\n+\n+int\n+hns3_tx_done_cleanup(void *txq, uint32_t free_cnt)\n+{\n+\tstruct hns3_tx_queue *q = (struct hns3_tx_queue *)txq;\n+\tstruct rte_eth_dev *dev = &rte_eth_devices[q->port_id];\n+\n+\tif (dev->tx_pkt_burst == hns3_xmit_pkts)\n+\t\treturn hns3_tx_done_cleanup_full(q, free_cnt);\n+\telse if (dev->tx_pkt_burst == hns3_dummy_rxtx_burst)\n+\t\treturn 0;\n+\telse\n+\t\treturn -ENOTSUP;\n+}\n+\n uint32_t\n hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n {\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 8f5ae5c..7118bd4 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -706,5 +706,6 @@ int hns3_start_all_txqs(struct rte_eth_dev *dev);\n int hns3_start_all_rxqs(struct rte_eth_dev *dev);\n void hns3_stop_all_txqs(struct rte_eth_dev *dev);\n void hns3_restore_tqp_enable_state(struct hns3_hw *hw);\n+int hns3_tx_done_cleanup(void *txq, uint32_t free_cnt);\n \n #endif /* _HNS3_RXTX_H_ */\n",
    "prefixes": [
        "03/17"
    ]
}