get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 87658,
    "url": "https://patches.dpdk.org/api/patches/87658/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1612338382-3253-13-git-send-email-oulijun@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": "<1612338382-3253-13-git-send-email-oulijun@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1612338382-3253-13-git-send-email-oulijun@huawei.com",
    "date": "2021-02-03T07:46:17",
    "name": "[12/17] net/hns3: fix stats flip overflow",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "55a4a638b32bb8c7e2d74aa4472174a31f68f257",
    "submitter": {
        "id": 1675,
        "url": "https://patches.dpdk.org/api/people/1675/?format=api",
        "name": "Lijun Ou",
        "email": "oulijun@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/1612338382-3253-13-git-send-email-oulijun@huawei.com/mbox/",
    "series": [
        {
            "id": 15115,
            "url": "https://patches.dpdk.org/api/series/15115/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=15115",
            "date": "2021-02-03T07:46:05",
            "name": "bugfixes and small functionality for hns3",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/15115/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/87658/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/87658/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 76F0CA0A0E;\n\tWed,  3 Feb 2021 08:47:54 +0100 (CET)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1BBB8240482;\n\tWed,  3 Feb 2021 08:47:02 +0100 (CET)",
            "from szxga06-in.huawei.com (szxga06-in.huawei.com [45.249.212.32])\n by mails.dpdk.org (Postfix) with ESMTP id 3DE9A240454\n for <dev@dpdk.org>; Wed,  3 Feb 2021 08:46:56 +0100 (CET)",
            "from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.59])\n by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DVtym0BDgzjHbL;\n Wed,  3 Feb 2021 15:45:52 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id\n 14.3.498.0; Wed, 3 Feb 2021 15:46:51 +0800"
        ],
        "From": "Lijun Ou <oulijun@huawei.com>",
        "To": "<ferruh.yigit@intel.com>",
        "CC": "<dev@dpdk.org>, <linuxarm@openeuler.org>",
        "Date": "Wed, 3 Feb 2021 15:46:17 +0800",
        "Message-ID": "<1612338382-3253-13-git-send-email-oulijun@huawei.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1612338382-3253-1-git-send-email-oulijun@huawei.com>",
        "References": "<1612338382-3253-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 12/17] 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 substracting 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 e58ebea..58cce35 100644\n--- a/drivers/net/hns3/hns3_stats.c\n+++ b/drivers/net/hns3/hns3_stats.c\n@@ -637,8 +637,14 @@ hns3_stats_get(struct rte_eth_dev *eth_dev, struct rte_eth_stats *rte_stats)\n #endif\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@@ -889,8 +895,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 \n \t\tfor (j = 0; j < HNS3_NUM_RXQ_BASIC_STATS; j++) {\n \t\t\tval = (char *)rxq_stats +\n",
    "prefixes": [
        "12/17"
    ]
}