get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64314,
    "url": "http://patches.dpdk.org/api/patches/64314/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200109031559.63194-4-huwei013@chinasoftinc.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": "<20200109031559.63194-4-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200109031559.63194-4-huwei013@chinasoftinc.com",
    "date": "2020-01-09T03:15:51",
    "name": "[03/11] net/hns3: reduce the judgements of free Tx ring space",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "c1e2fa47ec023a1ab1e08c719ac04d99fae9be9a",
    "submitter": {
        "id": 1537,
        "url": "http://patches.dpdk.org/api/people/1537/?format=api",
        "name": "Wei Hu (Xavier)",
        "email": "huwei013@chinasoftinc.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/20200109031559.63194-4-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 8023,
            "url": "http://patches.dpdk.org/api/series/8023/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=8023",
            "date": "2020-01-09T03:15:48",
            "name": "misc updates and fixes for hns3 PMD driver",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/8023/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64314/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/64314/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3BC8EA04F3;\n\tThu,  9 Jan 2020 04:23:53 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CD1331DB3F;\n\tThu,  9 Jan 2020 04:23:40 +0100 (CET)",
            "from incedge.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 761D01D53A\n for <dev@dpdk.org>; Thu,  9 Jan 2020 04:23:36 +0100 (CET)",
            "from mail.chinasoftinc.com (inccas002.ito.icss [10.168.0.52]) by\n incedge.chinasoftinc.com with ESMTP id kdum63cUeli9Q4Fq (version=TLSv1\n cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO) for <dev@dpdk.org>;\n Thu, 09 Jan 2020 11:22:48 +0800 (CST)",
            "from localhost.localdomain (203.160.91.226) by INCCAS002.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.439.0; Thu, 9 Jan 2020\n 11:16:11 +0800"
        ],
        "X-ASG-Debug-ID": "1578539804-0a3dd116cf0490000d-TfluYd",
        "X-Barracuda-Envelope-From": "huwei013@chinasoftinc.com",
        "X-Barracuda-RBL-Trusted-Forwarder": [
            "10.168.0.52",
            "10.168.0.60"
        ],
        "X-ASG-Whitelist": "Client",
        "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>",
        "To": "<dev@dpdk.org>",
        "Date": "Thu, 9 Jan 2020 11:15:51 +0800",
        "X-ASG-Orig-Subj": "[PATCH 03/11] net/hns3: reduce the judgements of free Tx ring\n space",
        "Message-ID": "<20200109031559.63194-4-huwei013@chinasoftinc.com>",
        "X-Mailer": "git-send-email 2.23.0",
        "In-Reply-To": "<20200109031559.63194-1-huwei013@chinasoftinc.com>",
        "References": "<20200109031559.63194-1-huwei013@chinasoftinc.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[203.160.91.226]",
        "X-Barracuda-Connect": "inccas002.ito.icss[10.168.0.52]",
        "X-Barracuda-Start-Time": "1578540167",
        "X-Barracuda-Encrypted": "ECDHE-RSA-AES256-SHA",
        "X-Barracuda-URL": "https://spam.chinasoftinc.com:443/cgi-mod/mark.cgi",
        "X-Virus-Scanned": "by bsmtpd at chinasoftinc.com",
        "X-Barracuda-Scan-Msg-Size": "3644",
        "Subject": "[dpdk-dev] [PATCH 03/11] net/hns3: reduce the judgements of free Tx\n\tring space",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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: Yisen Zhuang <yisen.zhuang@huawei.com>\n\nThis patch reduces the number of the judgement of the free Tx ring space\nin the 'tx_pkt_burst' ops implementation function to avoid performance\nloss. According to hardware constraints, we need to reserve a Tx Buffer\nDescriptor in the TX ring in hns3 network engine.\n\nSigned-off-by: Yisen Zhuang <yisen.zhuang@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_rxtx.c | 32 +++++++-------------------------\n 1 file changed, 7 insertions(+), 25 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 3d13ed526..34919cd2c 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -591,7 +591,7 @@ hns3_init_tx_queue(struct hns3_tx_queue *queue)\n \n \ttxq->next_to_use = 0;\n \ttxq->next_to_clean = 0;\n-\ttxq->tx_bd_ready = txq->nb_tx_desc;\n+\ttxq->tx_bd_ready = txq->nb_tx_desc - 1;\n \thns3_init_tx_queue_hw(txq);\n }\n \n@@ -1588,7 +1588,7 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \ttxq->hns = hns;\n \ttxq->next_to_use = 0;\n \ttxq->next_to_clean = 0;\n-\ttxq->tx_bd_ready = txq->nb_tx_desc;\n+\ttxq->tx_bd_ready = txq->nb_tx_desc - 1;\n \ttxq->port_id = dev->data->port_id;\n \ttxq->configured = true;\n \ttxq->io_base = (void *)((char *)hw->io_base + HNS3_TQP_REG_OFFSET +\n@@ -1600,19 +1600,6 @@ hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \treturn 0;\n }\n \n-static inline int\n-tx_ring_dist(struct hns3_tx_queue *txq, int begin, int end)\n-{\n-\treturn (end - begin + txq->nb_tx_desc) % txq->nb_tx_desc;\n-}\n-\n-static inline int\n-tx_ring_space(struct hns3_tx_queue *txq)\n-{\n-\treturn txq->nb_tx_desc -\n-\t\ttx_ring_dist(txq, txq->next_to_clean, txq->next_to_use) - 1;\n-}\n-\n static inline void\n hns3_queue_xmit(struct hns3_tx_queue *txq, uint32_t buf_num)\n {\n@@ -1631,7 +1618,7 @@ hns3_tx_free_useless_buffer(struct hns3_tx_queue *txq)\n \tstruct rte_mbuf *mbuf;\n \n \twhile ((!hns3_get_bit(desc->tx.tp_fe_sc_vld_ra_ri, HNS3_TXD_VLD_B)) &&\n-\t\t(tx_next_use != tx_next_clean || tx_bd_ready < tx_bd_max)) {\n+\t\ttx_next_use != tx_next_clean) {\n \t\tmbuf = tx_bak_pkt->mbuf;\n \t\tif (mbuf) {\n \t\t\trte_pktmbuf_free_seg(mbuf);\n@@ -2054,7 +2041,6 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \tstruct rte_mbuf *m_seg;\n \tuint32_t nb_hold = 0;\n \tuint16_t tx_next_use;\n-\tuint16_t tx_bd_ready;\n \tuint16_t tx_pkt_num;\n \tuint16_t tx_bd_max;\n \tuint16_t nb_buf;\n@@ -2063,13 +2049,10 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \n \t/* free useless buffer */\n \thns3_tx_free_useless_buffer(txq);\n-\ttx_bd_ready = txq->tx_bd_ready;\n-\tif (tx_bd_ready == 0)\n-\t\treturn 0;\n \n \ttx_next_use   = txq->next_to_use;\n \ttx_bd_max     = txq->nb_tx_desc;\n-\ttx_pkt_num = (tx_bd_ready < nb_pkts) ? tx_bd_ready : nb_pkts;\n+\ttx_pkt_num = nb_pkts;\n \n \t/* send packets */\n \ttx_bak_pkt = &txq->sw_ring[tx_next_use];\n@@ -2078,7 +2061,7 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \n \t\tnb_buf = tx_pkt->nb_segs;\n \n-\t\tif (nb_buf > tx_ring_space(txq)) {\n+\t\tif (nb_buf > txq->tx_bd_ready) {\n \t\t\tif (nb_tx == 0)\n \t\t\t\treturn 0;\n \n@@ -2137,14 +2120,13 @@ hns3_xmit_pkts(void *tx_queue, struct rte_mbuf **tx_pkts, uint16_t nb_pkts)\n \n \t\tnb_hold += i;\n \t\ttxq->next_to_use = tx_next_use;\n+\t\ttxq->tx_bd_ready -= i;\n \t}\n \n end_of_tx:\n \n-\tif (likely(nb_tx)) {\n+\tif (likely(nb_tx))\n \t\thns3_queue_xmit(txq, nb_hold);\n-\t\ttxq->tx_bd_ready   = tx_bd_ready - nb_hold;\n-\t}\n \n \treturn nb_tx;\n }\n",
    "prefixes": [
        "03/11"
    ]
}