Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/88381/?format=api
http://patches.dpdk.org/api/patches/88381/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1614693534-27620-4-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": "<1614693534-27620-4-git-send-email-oulijun@huawei.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1614693534-27620-4-git-send-email-oulijun@huawei.com", "date": "2021-03-02T13:58:43", "name": "[V2,03/14] net/hns3: implement cleanup for Tx done", "commit_ref": null, "pull_url": null, "state": "changes-requested", "archived": true, "hash": "0b4b1197a42ed255f9bad16b12772621ccf87a1a", "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/1614693534-27620-4-git-send-email-oulijun@huawei.com/mbox/", "series": [ { "id": 15449, "url": "http://patches.dpdk.org/api/series/15449/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=15449", "date": "2021-03-02T13:58:40", "name": "Features and bugfixes for hns3", "version": 2, "mbox": "http://patches.dpdk.org/series/15449/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/88381/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/88381/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 0FAF4A054F;\n\tTue, 2 Mar 2021 14:58:35 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B0FC722A2AA;\n\tTue, 2 Mar 2021 14:58:22 +0100 (CET)", "from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190])\n by mails.dpdk.org (Postfix) with ESMTP id 567C622A295\n for <dev@dpdk.org>; Tue, 2 Mar 2021 14:58:17 +0100 (CET)", "from DGGEMS412-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Dqdw30Rwmz16Fht;\n Tue, 2 Mar 2021 21:56:35 +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; Tue, 2 Mar 2021 21:58:10 +0800" ], "From": "Lijun Ou <oulijun@huawei.com>", "To": "<ferruh.yigit@intel.com>", "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>", "Date": "Tue, 2 Mar 2021 21:58:43 +0800", "Message-ID": "<1614693534-27620-4-git-send-email-oulijun@huawei.com>", "X-Mailer": "git-send-email 2.7.4", "In-Reply-To": "<1614693534-27620-1-git-send-email-oulijun@huawei.com>", "References": "<1614130139-42926-1-git-send-email-oulijun@huawei.com>\n <1614693534-27620-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 V2 03/14] 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---\n doc/guides/nics/features/hns3.ini | 1 +\n doc/guides/nics/features/hns3_vf.ini | 1 +\n doc/guides/rel_notes/release_21_05.rst | 2 +-\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 7 files changed, 65 insertions(+), 1 deletion(-)", "diff": "diff --git a/doc/guides/nics/features/hns3.ini b/doc/guides/nics/features/hns3.ini\nindex ef432af..8e82d68 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/doc/guides/rel_notes/release_21_05.rst b/doc/guides/rel_notes/release_21_05.rst\nindex 67a0daa..baae077 100644\n--- a/doc/guides/rel_notes/release_21_05.rst\n+++ b/doc/guides/rel_notes/release_21_05.rst\n@@ -67,7 +67,7 @@ New Features\n * **Updated Hisilicon hns3 driver.**\n \n * Added support for module EEPROM dumping.\n-\n+ * Added support for freeing Tx mbuf on demand.\n \n Removed Items\n -------------\ndiff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex e02a7ec..91d720a 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -6388,6 +6388,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 3f9f328..1b8c029 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -2763,6 +2763,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": [ "V2", "03/14" ] }{ "id": 88381, "url": "