get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 104193,
    "url": "https://patches.dpdk.org/api/patches/104193/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20211111133859.13705-2-humin29@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": "<20211111133859.13705-2-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20211111133859.13705-2-humin29@huawei.com",
    "date": "2021-11-11T13:38:58",
    "name": "[1/2] net/hns3: optimized Tx performance by mbuf fast free",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "43dd8410c60b41de55df08eac5b5c0900f3b4130",
    "submitter": {
        "id": 1944,
        "url": "https://patches.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@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/20211111133859.13705-2-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 20500,
            "url": "https://patches.dpdk.org/api/series/20500/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=20500",
            "date": "2021-11-11T13:38:57",
            "name": "performance optimized for hns3 PMD",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/20500/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/104193/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/104193/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 3A7EEA0548;\n\tThu, 11 Nov 2021 14:41:20 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E8ADB41176;\n\tThu, 11 Nov 2021 14:41:09 +0100 (CET)",
            "from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189])\n by mails.dpdk.org (Postfix) with ESMTP id E372E410F7\n for <dev@dpdk.org>; Thu, 11 Nov 2021 14:41:07 +0100 (CET)",
            "from dggeme756-chm.china.huawei.com (unknown [172.30.72.54])\n by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4HqjW26BZ3z8vMv;\n Thu, 11 Nov 2021 21:39:26 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n dggeme756-chm.china.huawei.com (10.3.19.102) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id\n 15.1.2308.15; Thu, 11 Nov 2021 21:41:04 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ferruh.yigit@intel.com>, <thomas@monjalon.net>",
        "Subject": "[PATCH 1/2] net/hns3: optimized Tx performance by mbuf fast free",
        "Date": "Thu, 11 Nov 2021 21:38:58 +0800",
        "Message-ID": "<20211111133859.13705-2-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20211111133859.13705-1-humin29@huawei.com>",
        "References": "<20211111133859.13705-1-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems701-chm.china.huawei.com (10.3.19.178) To\n dggeme756-chm.china.huawei.com (10.3.19.102)",
        "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": "From: Chengwen Feng <fengchengwen@huawei.com>\n\nCurrently the vector and simple xmit algorithm don't support multi_segs,\nso if Tx offload support MBUF_FAST_FREE, driver could invoke\nrte_mempool_put_bulk() to free Tx mbufs in this situation.\n\nIn the testpmd single core MAC forwarding scenario, the performance is\nimproved by 8% at 64B on Kunpeng920 platform.\n\nCc: stable@dpdk.org\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n drivers/net/hns3/hns3_rxtx.c     | 11 +++++++++++\n drivers/net/hns3/hns3_rxtx.h     |  2 ++\n drivers/net/hns3/hns3_rxtx_vec.h |  9 +++++++++\n 3 files changed, 22 insertions(+)",
    "diff": "diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex d26e262335..78227a139f 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -3059,6 +3059,8 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \ttxq->min_tx_pkt_len = hw->min_tx_pkt_len;\n \ttxq->tso_mode = hw->tso_mode;\n \ttxq->udp_cksum_mode = hw->udp_cksum_mode;\n+\ttxq->mbuf_fast_free_en = !!(dev->data->dev_conf.txmode.offloads &\n+\t\t\t\t    DEV_TX_OFFLOAD_MBUF_FAST_FREE);\n \tmemset(&txq->basic_stats, 0, sizeof(struct hns3_tx_basic_stats));\n \tmemset(&txq->dfx_stats, 0, sizeof(struct hns3_tx_dfx_stats));\n \n@@ -3991,6 +3993,14 @@ hns3_tx_free_buffer_simple(struct hns3_tx_queue *txq)\n \n \t\ttx_entry = &txq->sw_ring[txq->next_to_clean];\n \n+\t\tif (txq->mbuf_fast_free_en) {\n+\t\t\trte_mempool_put_bulk(tx_entry->mbuf->pool,\n+\t\t\t\t\t(void **)tx_entry, txq->tx_rs_thresh);\n+\t\t\tfor (i = 0; i < txq->tx_rs_thresh; i++)\n+\t\t\t\ttx_entry[i].mbuf = NULL;\n+\t\t\tgoto update_field;\n+\t\t}\n+\n \t\tfor (i = 0; i < txq->tx_rs_thresh; i++)\n \t\t\trte_prefetch0((tx_entry + i)->mbuf);\n \t\tfor (i = 0; i < txq->tx_rs_thresh; i++, tx_entry++) {\n@@ -3998,6 +4008,7 @@ hns3_tx_free_buffer_simple(struct hns3_tx_queue *txq)\n \t\t\ttx_entry->mbuf = NULL;\n \t\t}\n \n+update_field:\n \t\ttxq->next_to_clean = (tx_next_clean + 1) % txq->nb_tx_desc;\n \t\ttxq->tx_bd_ready += txq->tx_rs_thresh;\n \t}\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 63bafc68b6..df731856ef 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -495,6 +495,8 @@ struct hns3_tx_queue {\n \t * this point.\n \t */\n \tuint16_t pvid_sw_shift_en:1;\n+\t/* check whether the mbuf fast free offload is enabled */\n+\tuint16_t mbuf_fast_free_en:1;\n \n \t/*\n \t * For better performance in tx datapath, releasing mbuf in batches is\ndiff --git a/drivers/net/hns3/hns3_rxtx_vec.h b/drivers/net/hns3/hns3_rxtx_vec.h\nindex 67c75e44ef..4985a7cae8 100644\n--- a/drivers/net/hns3/hns3_rxtx_vec.h\n+++ b/drivers/net/hns3/hns3_rxtx_vec.h\n@@ -18,6 +18,14 @@ hns3_tx_bulk_free_buffers(struct hns3_tx_queue *txq)\n \tint i;\n \n \ttx_entry = &txq->sw_ring[txq->next_to_clean];\n+\tif (txq->mbuf_fast_free_en) {\n+\t\trte_mempool_put_bulk(tx_entry->mbuf->pool, (void **)tx_entry,\n+\t\t\t\t     txq->tx_rs_thresh);\n+\t\tfor (i = 0; i < txq->tx_rs_thresh; i++)\n+\t\t\ttx_entry[i].mbuf = NULL;\n+\t\tgoto update_field;\n+\t}\n+\n \tfor (i = 0; i < txq->tx_rs_thresh; i++, tx_entry++) {\n \t\tm = rte_pktmbuf_prefree_seg(tx_entry->mbuf);\n \t\ttx_entry->mbuf = NULL;\n@@ -36,6 +44,7 @@ hns3_tx_bulk_free_buffers(struct hns3_tx_queue *txq)\n \tif (nb_free)\n \t\trte_mempool_put_bulk(free[0]->pool, (void **)free, nb_free);\n \n+update_field:\n \t/* Update numbers of available descriptor due to buffer freed */\n \ttxq->tx_bd_ready += txq->tx_rs_thresh;\n \ttxq->next_to_clean += txq->tx_rs_thresh;\n",
    "prefixes": [
        "1/2"
    ]
}