get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87682,
    "url": "http://patchwork.dpdk.org/api/patches/87682/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1612355037-48768-7-git-send-email-oulijun@huawei.com/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<1612355037-48768-7-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612355037-48768-7-git-send-email-oulijun@huawei.com",
    "date": "2021-02-03T12:23:52",
    "name": "[06/11] net/hns3: fix stats flip overflow",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "3311644b14e19944ad6173fb93b25603e51d8355",
    "submitter": {
        "id": 1675,
        "url": "http://patchwork.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patchwork.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1612355037-48768-7-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15123,
            "url": "http://patchwork.dpdk.org/api/series/15123/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=15123",
            "date": "2021-02-03T12:23:47",
            "name": "critical bugfixes for hns3",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/15123/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/87682/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/87682/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 F0142A0A0E;\n\tWed,  3 Feb 2021 13:25:03 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 7024C24055F;\n\tWed,  3 Feb 2021 13:24:33 +0100 (CET)",
            "from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by mails.dpdk.org (Postfix) with ESMTP id CCB4424054B\n for <dev@dpdk.org>; Wed,  3 Feb 2021 13:24:29 +0100 (CET)",
            "from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60])\n by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DW1706Q5YzjHC7;\n Wed,  3 Feb 2021 20:23:24 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS401-HUB.china.huawei.com (10.3.19.201) with Microsoft SMTP Server id\n 14.3.498.0; Wed, 3 Feb 2021 20:24:23 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Wed, 3 Feb 2021 20:23:52 +0800",
        "Message-ID": "<1612355037-48768-7-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1612355037-48768-1-git-send-email-oulijun@huawei.com>",
        "References": "<1612355037-48768-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 06/11] net/hns3: fix stats flip overflow",
        "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: Chengchang Tang <tangchengchang@huawei.com>\n\nCurrently, statistics may overflow in some scenarios.\n\nFor example, if HW statistics are reset by stats reset operation,\nbut there are still a lot of residual packets exist in the HW\nqueues and these packets are error packets, flip may occurred\nbecause the ipacket is obtained by subtracting the number of\nsoftware error packets from the number of HW received packets.\n\nThis patch verifies the calculation and returns 0 when overflow\nmay occur.\n\nFixes: 8839c5e202f3 (\"net/hns3: support device stats\")\nCc: stable@dpdk.org\n\nSigned-off-by: Chengchang Tang <tangchengchang@huawei.com>\nSigned-off-by: Lijun Ou <oulijun@huawei.com>\n---\n drivers/net/hns3/hns3_stats.c | 21 +++++++++++++++++----\n 1 file changed, 17 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/drivers/net/hns3/hns3_stats.c b/drivers/net/hns3/hns3_stats.c\nindex 3ba09e2..e0e40ca 100644\n--- a/drivers/net/hns3/hns3_stats.c\n+++ b/drivers/net/hns3/hns3_stats.c\n@@ -554,8 +554,14 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats)\n \t}\n \n \trte_stats->oerrors = 0;\n-\trte_stats->ipackets  = stats->rcb_rx_ring_pktnum_rcd -\n-\t\trte_stats->ierrors;\n+\t/*\n+\t * If HW statistics are reset by stats_reset, but a lot of residual\n+\t * packets exist in the hardware queue and these packets are error\n+\t * packets, flip overflow may occurred. So return 0 in this case.\n+\t */\n+\trte_stats->ipackets =\n+\t\tstats->rcb_rx_ring_pktnum_rcd > rte_stats->ierrors ?\n+\t\tstats->rcb_rx_ring_pktnum_rcd - rte_stats->ierrors : 0;\n \trte_stats->opackets  = stats->rcb_tx_ring_pktnum_rcd -\n \t\trte_stats->oerrors;\n \trte_stats->rx_nombuf = eth_dev->data->rx_mbuf_alloc_failed;\n@@ -792,8 +798,15 @@ hns3_rxq_basic_stats_get(struct rte_eth_dev *dev, struct rte_eth_xstat *xstats,\n \t\trxq_stats = &rxq->basic_stats;\n \t\trxq_stats->errors = rxq->err_stats.l2_errors +\n \t\t\t\t\trxq->err_stats.pkt_len_errors;\n-\t\trxq_stats->packets = stats->rcb_rx_ring_pktnum[i] -\n-\t\t\trxq_stats->errors;\n+\t\t/*\n+\t\t * If HW statistics are reset by stats_reset, but a lot of\n+\t\t * residual packets exist in the hardware queue and these\n+\t\t * packets are error packets, flip overflow may occurred.\n+\t\t * So return 0 in this case.\n+\t\t */\n+\t\trxq_stats->packets =\n+\t\t\tstats->rcb_rx_ring_pktnum[i] > rxq_stats->errors ?\n+\t\t\tstats->rcb_rx_ring_pktnum[i] - rxq_stats->errors : 0;\n \t\trxq_stats->bytes = 0;\n \t\tfor (j = 0; j < HNS3_NUM_RXQ_BASIC_STATS; j++) {\n \t\t\tval = (char *)rxq_stats +\n",
    "prefixes": [
        "06/11"
    ]
}