get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 82759,
    "url": "http://patches.dpdk.org/api/patches/82759/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/1603975917-28576-2-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": "<1603975917-28576-2-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1603975917-28576-2-git-send-email-oulijun@huawei.com",
    "date": "2020-10-29T12:51:50",
    "name": "[v3,1/8] net/hns3: add queue count of Rx API support",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "e1b770d78ea10f096a5bf02e2e184e04185f1bfa",
    "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/1603975917-28576-2-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 13462,
            "url": "http://patches.dpdk.org/api/series/13462/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13462",
            "date": "2020-10-29T12:51:50",
            "name": "hns3 misc updates",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/13462/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/82759/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/82759/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 DD3BCA04B5;\n\tThu, 29 Oct 2020 13:52:00 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id EF364CB56;\n\tThu, 29 Oct 2020 13:51:32 +0100 (CET)",
            "from szxga05-in.huawei.com (szxga05-in.huawei.com [45.249.212.191])\n by dpdk.org (Postfix) with ESMTP id 5D347CB56\n for <dev@dpdk.org>; Thu, 29 Oct 2020 13:51:30 +0100 (CET)",
            "from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4CMQL84rWvzLrC0\n for <dev@dpdk.org>; Thu, 29 Oct 2020 20:51:28 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id\n 14.3.487.0; Thu, 29 Oct 2020 20:51:21 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@huawei.com>",
        "Date": "Thu, 29 Oct 2020 20:51:50 +0800",
        "Message-ID": "<1603975917-28576-2-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1603975917-28576-1-git-send-email-oulijun@huawei.com>",
        "References": "<1603975751-27955-1-git-send-email-oulijun@huawei.com>\n <1603975917-28576-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 v3 1/8] net/hns3: add queue count of Rx API\n\tsupport",
        "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": "Here is to implement the available and used rxd number\ncount function. In Kunpeng series, the NIC hardware\nsupport to read the bd numbers which wait processed from\nthe hardware FBD(Full Buffer Descriptor), and the driver\nmaintains the bd number to be wrriten back hardware.\ncompare the number of FBDs with the number of BDs\nto be written back to the hardware.\nthe number of used descriptors of a rx queue is computed\nas follows:\nThe fbd numbers of reading from FBD register plus the\nbd numbers to be wrriten back to hardware maintainer by\nthe driver.\n\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\nV1->V2:\n- fix the checkpatch warning\n---\n drivers/net/hns3/hns3_ethdev.c    |  1 +\n drivers/net/hns3/hns3_ethdev_vf.c |  1 +\n drivers/net/hns3/hns3_rxtx.c      | 25 +++++++++++++++++++++++++\n drivers/net/hns3/hns3_rxtx.h      |  1 +\n 4 files changed, 28 insertions(+)",
    "diff": "diff --git a/drivers/net/hns3/hns3_ethdev.c b/drivers/net/hns3/hns3_ethdev.c\nindex c34dbea..6342c70 100644\n--- a/drivers/net/hns3/hns3_ethdev.c\n+++ b/drivers/net/hns3/hns3_ethdev.c\n@@ -6096,6 +6096,7 @@ hns3_dev_init(struct rte_eth_dev *eth_dev)\n \n \thns3_set_rxtx_function(eth_dev);\n \teth_dev->dev_ops = &hns3_eth_dev_ops;\n+\teth_dev->rx_queue_count = hns3_rx_queue_count;\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n \t\tret = hns3_mp_init_secondary();\n \t\tif (ret) {\ndiff --git a/drivers/net/hns3/hns3_ethdev_vf.c b/drivers/net/hns3/hns3_ethdev_vf.c\nindex 7d3750d..9fb7941 100644\n--- a/drivers/net/hns3/hns3_ethdev_vf.c\n+++ b/drivers/net/hns3/hns3_ethdev_vf.c\n@@ -2743,6 +2743,7 @@ hns3vf_dev_init(struct rte_eth_dev *eth_dev)\n \n \thns3_set_rxtx_function(eth_dev);\n \teth_dev->dev_ops = &hns3vf_eth_dev_ops;\n+\teth_dev->rx_queue_count = hns3_rx_queue_count;\n \tif (rte_eal_process_type() != RTE_PROC_PRIMARY) {\n \t\tret = hns3_mp_init_secondary();\n \t\tif (ret) {\ndiff --git a/drivers/net/hns3/hns3_rxtx.c b/drivers/net/hns3/hns3_rxtx.c\nindex d511908..55bee17 100644\n--- a/drivers/net/hns3/hns3_rxtx.c\n+++ b/drivers/net/hns3/hns3_rxtx.c\n@@ -3823,3 +3823,28 @@ hns3_dev_tx_queue_stop(struct rte_eth_dev *dev, uint16_t tx_queue_id)\n \n \treturn 0;\n }\n+\n+uint32_t\n+hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id)\n+{\n+\t/*\n+\t * Number of BDs that have been processed by the driver\n+\t * but have not been notified to the hardware.\n+\t */\n+\tuint32_t driver_hold_bd_num;\n+\tstruct hns3_rx_queue *rxq;\n+\tuint32_t fbd_num;\n+\n+\trxq = dev->data->rx_queues[rx_queue_id];\n+\tfbd_num = hns3_read_dev(rxq, HNS3_RING_RX_FBDNUM_REG);\n+\tif (dev->rx_pkt_burst == hns3_recv_pkts_vec ||\n+\t    dev->rx_pkt_burst == hns3_recv_pkts_vec_sve)\n+\t\tdriver_hold_bd_num = rxq->rx_rearm_nb;\n+\telse\n+\t\tdriver_hold_bd_num = rxq->rx_free_hold;\n+\n+\tif (fbd_num <= driver_hold_bd_num)\n+\t\treturn 0;\n+\telse\n+\t\treturn fbd_num - driver_hold_bd_num;\n+}\ndiff --git a/drivers/net/hns3/hns3_rxtx.h b/drivers/net/hns3/hns3_rxtx.h\nindex 4be9c4a..ae09e94 100644\n--- a/drivers/net/hns3/hns3_rxtx.h\n+++ b/drivers/net/hns3/hns3_rxtx.h\n@@ -620,6 +620,7 @@ int hns3_rx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \t\t\tstruct rte_mempool *mp);\n int hns3_tx_queue_setup(struct rte_eth_dev *dev, uint16_t idx, uint16_t nb_desc,\n \t\t\tunsigned int socket, const struct rte_eth_txconf *conf);\n+uint32_t hns3_rx_queue_count(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int hns3_dev_rx_queue_start(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int hns3_dev_rx_queue_stop(struct rte_eth_dev *dev, uint16_t rx_queue_id);\n int hns3_dev_tx_queue_start(struct rte_eth_dev *dev, uint16_t tx_queue_id);\n",
    "prefixes": [
        "v3",
        "1/8"
    ]
}