get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 76653,
    "url": "http://patches.dpdk.org/api/patches/76653/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200907090825.1761-2-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": "<20200907090825.1761-2-huwei013@chinasoftinc.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200907090825.1761-2-huwei013@chinasoftinc.com",
    "date": "2020-09-07T09:08:18",
    "name": "[1/8] net/hns3: report Rx free threshold",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7ba0d582023283927a70c4e4e584811698a82498",
    "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/20200907090825.1761-2-huwei013@chinasoftinc.com/mbox/",
    "series": [
        {
            "id": 11986,
            "url": "http://patches.dpdk.org/api/series/11986/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=11986",
            "date": "2020-09-07T09:08:17",
            "name": "net/hns3: updates for Rx Tx",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/11986/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/76653/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/76653/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 90D30A04B9;\n\tMon,  7 Sep 2020 11:09:12 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 82AB91C0D5;\n\tMon,  7 Sep 2020 11:09:07 +0200 (CEST)",
            "from mail.chinasoftinc.com (unknown [114.113.233.8])\n by dpdk.org (Postfix) with ESMTP id 97D7E1BE85\n for <dev@dpdk.org>; Mon,  7 Sep 2020 11:09:05 +0200 (CEST)",
            "from localhost.localdomain (65.49.108.226) by INCCAS002.ito.icss\n (10.168.0.60) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Sep 2020\n 17:09:01 +0800"
        ],
        "From": "\"Wei Hu (Xavier)\" <huwei013@chinasoftinc.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<xavier.huwei@huawei.com>",
        "Date": "Mon, 7 Sep 2020 17:08:18 +0800",
        "Message-ID": "<20200907090825.1761-2-huwei013@chinasoftinc.com>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20200907090825.1761-1-huwei013@chinasoftinc.com>",
        "References": "<20200907090825.1761-1-huwei013@chinasoftinc.com>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[65.49.108.226]",
        "Subject": "[dpdk-dev] [PATCH 1/8] net/hns3: report Rx free threshold",
        "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: \"Wei Hu (Xavier)\" <xavier.huwei@huawei.com>\n\nThis patch reports .rx_free_thresh value in the .dev_infos_get ops\nimplementation function named hns3_dev_infos_get and hns3vf_dev_infos_get.\nIn addition, the name of the member variable of struct hns3_rx_queue is\nmodified and comments are added to improve code readability.\n\nSigned-off-by: Chengwen Feng <fengchengwen@huawei.com>\nSigned-off-by: Wei Hu (Xavier) <xavier.huwei@huawei.com>\n---\n drivers/net/hns3/hns3_ethdev.c    |  2 ++\n drivers/net/hns3/hns3_ethdev_vf.c |  2 ++\n drivers/net/hns3/hns3_rxtx.c      | 30 ++++++++++++------------------\n drivers/net/hns3/hns3_rxtx.h      |  9 ++++++---\n 4 files changed, 22 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex 4d5fa94..6fa34e8 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -2501,12 +2501,14 @@ hns3_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)\n \t};\n \n \tinfo->default_rxconf = (struct rte_eth_rxconf) {\n+\t\t.rx_free_thresh = HNS3_DEFAULT_RX_FREE_THRESH,\n \t\t/*\n \t\t * If there are no available Rx buffer descriptors, incoming\n \t\t * packets are always dropped by hardware based on hns3 network\n \t\t * engine.\n \t\t */\n \t\t.rx_drop_en = 1,\n+\t\t.offloads = 0,\n \t};\n \n \tinfo->vmdq_queue_num = 0;\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex 7fd0e6a..7226cc5 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -944,12 +944,14 @@ hns3vf_dev_infos_get(struct rte_eth_dev *eth_dev, struct rte_eth_dev_info *info)\n \t};\n \n \tinfo->default_rxconf = (struct rte_eth_rxconf) {\n+\t\t.rx_free_thresh = HNS3_DEFAULT_RX_FREE_THRESH,\n \t\t/*\n \t\t * If there are no available Rx buffer descriptors, incoming\n \t\t * packets are always dropped by hardware based on hns3 network\n \t\t * engine.\n \t\t */\n \t\t.rx_drop_en = 1,\n+\t\t.offloads = 0,\n \t};\n \n \tinfo->vmdq_queue_num = 0;\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex 308d0a6..fe2a7a4 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -652,8 +652,7 @@ hns3_dev_rx_queue_start(struct hns3_adapter *hns, uint16_t idx)\n \t}\n \n \trxq->next_to_use = 0;\n-\trxq->next_to_clean = 0;\n-\trxq->nb_rx_hold = 0;\n+\trxq->rx_free_hold = 0;\n \thns3_init_rx_queue_hw(rxq);\n \n \treturn 0;\n@@ -667,8 +666,7 @@ hns3_fake_rx_queue_start(struct hns3_adapter *hns, uint16_t idx)\n \n \trxq = (struct hns3_rx_queue *)hw->fkq_data.rx_queues[idx];\n \trxq->next_to_use = 0;\n-\trxq->next_to_clean = 0;\n-\trxq->nb_rx_hold = 0;\n+\trxq->rx_free_hold = 0;\n \thns3_init_rx_queue_hw(rxq);\n }\n \n@@ -1303,10 +1301,8 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \n \trxq->hns = hns;\n \trxq->mb_pool = mp;\n-\tif (conf->rx_free_thresh <= 0)\n-\t\trxq->rx_free_thresh = DEFAULT_RX_FREE_THRESH;\n-\telse\n-\t\trxq->rx_free_thresh = conf->rx_free_thresh;\n+\trxq->rx_free_thresh = (conf->rx_free_thresh > 0) ?\n+\t\tconf->rx_free_thresh : HNS3_DEFAULT_RX_FREE_THRESH;\n \trxq->rx_deferred_start = conf->rx_deferred_start;\n \n \trx_entry_len = sizeof(struct hns3_entry) * rxq->nb_rx_desc;\n@@ -1319,8 +1315,7 @@ hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \t}\n \n \trxq->next_to_use = 0;\n-\trxq->next_to_clean = 0;\n-\trxq->nb_rx_hold = 0;\n+\trxq->rx_free_hold = 0;\n \trxq->pkt_first_seg = NULL;\n \trxq->pkt_last_seg = NULL;\n \trxq->port_id = dev->data->port_id;\n@@ -1656,11 +1651,11 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \tnb_rx_bd = 0;\n \trxq = rx_queue;\n \n-\trx_id = rxq->next_to_clean;\n+\trx_id = rxq->next_to_use;\n \trx_ring = rxq->rx_ring;\n+\tsw_ring = rxq->sw_ring;\n \tfirst_seg = rxq->pkt_first_seg;\n \tlast_seg = rxq->pkt_last_seg;\n-\tsw_ring = rxq->sw_ring;\n \n \twhile (nb_rx < nb_pkts) {\n \t\trxdp = &rx_ring[rx_id];\n@@ -1843,16 +1838,15 @@ hns3_recv_pkts(void *rx_queue, struct rte_mbuf **rx_pkts, uint16_t nb_pkts)\n \t\tfirst_seg = NULL;\n \t}\n \n-\trxq->next_to_clean = rx_id;\n+\trxq->next_to_use = rx_id;\n \trxq->pkt_first_seg = first_seg;\n \trxq->pkt_last_seg = last_seg;\n \n-\tnb_rx_bd = nb_rx_bd + rxq->nb_rx_hold;\n-\tif (nb_rx_bd > rxq->rx_free_thresh) {\n-\t\thns3_clean_rx_buffers(rxq, nb_rx_bd);\n-\t\tnb_rx_bd = 0;\n+\trxq->rx_free_hold += nb_rx_bd;\n+\tif (rxq->rx_free_hold > rxq->rx_free_thresh) {\n+\t\thns3_clean_rx_buffers(rxq, rxq->rx_free_hold);\n+\t\trxq->rx_free_hold = 0;\n \t}\n-\trxq->nb_rx_hold = nb_rx_bd;\n \n \treturn nb_rx;\n }\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 4b3269b..a2d6514 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -10,6 +10,7 @@\n #define HNS3_DEFAULT_RING_DESC  1024\n #define\tHNS3_ALIGN_RING_DESC\t32\n #define HNS3_RING_BASE_ALIGN\t128\n+#define HNS3_DEFAULT_RX_FREE_THRESH\t32\n \n #define HNS3_512_BD_BUF_SIZE\t512\n #define HNS3_1K_BD_BUF_SIZE\t1024\n@@ -243,12 +244,14 @@ struct hns3_rx_queue {\n \tuint16_t queue_id;\n \tuint16_t port_id;\n \tuint16_t nb_rx_desc;\n-\tuint16_t nb_rx_hold;\n-\tuint16_t rx_tail;\n-\tuint16_t next_to_clean;\n \tuint16_t next_to_use;\n \tuint16_t rx_buf_len;\n+\t/*\n+\t * threshold for the number of BDs waited to passed to hardware. If the\n+\t * number exceeds the threshold, driver will pass these BDs to hardware.\n+\t */\n \tuint16_t rx_free_thresh;\n+\tuint16_t rx_free_hold;   /* num of BDs waited to passed to hardware */\n \n \t/*\n \t * port based vlan configuration state.\n",
    "prefixes": [
        "1/8"
    ]
}