get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 74063,
    "url": "http://patchwork.dpdk.org/api/patches/74063/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20200715070307.36814-2-junyux.jiang@intel.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": "<20200715070307.36814-2-junyux.jiang@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200715070307.36814-2-junyux.jiang@intel.com",
    "date": "2020-07-15T07:03:06",
    "name": "[1/2] net/ice: fix incorrect Rx bytes statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "d3a08836af82910951fa6868220365b3ac020dc4",
    "submitter": {
        "id": 1408,
        "url": "http://patchwork.dpdk.org/api/people/1408/?format=api",
        "name": "Junyu Jiang",
        "email": "junyux.jiang@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patchwork.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20200715070307.36814-2-junyux.jiang@intel.com/mbox/",
    "series": [
        {
            "id": 11035,
            "url": "http://patchwork.dpdk.org/api/series/11035/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=11035",
            "date": "2020-07-15T07:03:05",
            "name": "fix incorrect statistics data",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/11035/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/74063/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/74063/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 CA72CA0540;\n\tWed, 15 Jul 2020 09:26:50 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id A52CC1BFB6;\n\tWed, 15 Jul 2020 09:26:50 +0200 (CEST)",
            "from mga06.intel.com (mga06.intel.com [134.134.136.31])\n by dpdk.org (Postfix) with ESMTP id 372B81BF80;\n Wed, 15 Jul 2020 09:26:49 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 15 Jul 2020 00:26:48 -0700",
            "from intel.sh.intel.com ([10.239.255.48])\n by orsmga002.jf.intel.com with ESMTP; 15 Jul 2020 00:26:46 -0700"
        ],
        "IronPort-SDR": [
            "\n OUa1P4VvXXXbnthqonw+DIr70jvDHx9JMwUwhEmyUs+38jju/WtrgtITlAnz9cZj2B5VSrqhiq\n UnM+f5VK2GVg==",
            "\n DgwhCZDbFaUaCvAnNyEPr9B0d+bmOEiG6Mm9FqETX3VQE7P9LnkCq6IfFg0DlxKE4PkPIfDwTp\n UWAXS6oY7wRQ=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6000,8403,9682\"; a=\"210643313\"",
            "E=Sophos;i=\"5.75,354,1589266800\"; d=\"scan'208\";a=\"210643313\"",
            "E=Sophos;i=\"5.75,354,1589266800\"; d=\"scan'208\";a=\"299798558\""
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "From": "Junyu Jiang <junyux.jiang@intel.com>",
        "To": "dev@dpdk.org",
        "Cc": "Qi Zhang <qi.z.zhang@intel.com>, Qiming Yang <qiming.yang@intel.com>,\n Junyu Jiang <junyux.jiang@intel.com>, stable@dpdk.org",
        "Date": "Wed, 15 Jul 2020 07:03:06 +0000",
        "Message-Id": "<20200715070307.36814-2-junyux.jiang@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200715070307.36814-1-junyux.jiang@intel.com>",
        "References": "<20200715070307.36814-1-junyux.jiang@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 1/2] net/ice: fix incorrect Rx bytes statistics",
        "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": "This patch fixed the issue that rx_bytes overflowed\non 40 bit limitation by enlarging the limitation.\n\nFixes: a37bde56314d (\"net/ice: support statistics\")\nCc: stable@dpdk.org\n\nSigned-off-by: Junyu Jiang <junyux.jiang@intel.com>\n---\n drivers/net/ice/ice_ethdev.c | 14 ++++++++++++++\n 1 file changed, 14 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/ice_ethdev.c b/drivers/net/ice/ice_ethdev.c\nindex 3534d18ca..d92b6ffa1 100644\n--- a/drivers/net/ice/ice_ethdev.c\n+++ b/drivers/net/ice/ice_ethdev.c\n@@ -4143,6 +4143,10 @@ ice_update_vsi_stats(struct ice_vsi *vsi)\n \tstruct ice_eth_stats *nes = &vsi->eth_stats;\n \tstruct ice_hw *hw = ICE_VSI_TO_HW(vsi);\n \tint idx = rte_le_to_cpu_16(vsi->vsi_id);\n+\tuint64_t old_rx_bytes = nes->rx_bytes;\n+\n+\told_rx_bytes += (nes->rx_unicast + nes->rx_multicast +\n+\t\t\t nes->rx_broadcast) * RTE_ETHER_CRC_LEN;\n \n \tice_stat_update_40(hw, GLV_GORCH(idx), GLV_GORCL(idx),\n \t\t\t   vsi->offset_loaded, &oes->rx_bytes,\n@@ -4156,6 +4160,9 @@ ice_update_vsi_stats(struct ice_vsi *vsi)\n \tice_stat_update_40(hw, GLV_BPRCH(idx), GLV_BPRCL(idx),\n \t\t\t   vsi->offset_loaded, &oes->rx_broadcast,\n \t\t\t   &nes->rx_broadcast);\n+\t/* enlarge the limitation when rx_bytes overflowed */\n+\tif (old_rx_bytes > nes->rx_bytes && vsi->offset_loaded)\n+\t\tnes->rx_bytes += (uint64_t)1 << ICE_40_BIT_WIDTH;\n \t/* exclude CRC bytes */\n \tnes->rx_bytes -= (nes->rx_unicast + nes->rx_multicast +\n \t\t\t  nes->rx_broadcast) * RTE_ETHER_CRC_LEN;\n@@ -4208,6 +4215,10 @@ ice_read_stats_registers(struct ice_pf *pf, struct ice_hw *hw)\n {\n \tstruct ice_hw_port_stats *ns = &pf->stats; /* new stats */\n \tstruct ice_hw_port_stats *os = &pf->stats_offset; /* old stats */\n+\tuint64_t old_rx_bytes = ns->eth.rx_bytes;\n+\n+\told_rx_bytes += (ns->eth.rx_unicast + ns->eth.rx_multicast +\n+\t\t\t ns->eth.rx_broadcast) * RTE_ETHER_CRC_LEN;\n \n \t/* Get statistics of struct ice_eth_stats */\n \tice_stat_update_40(hw, GLPRT_GORCH(hw->port_info->lport),\n@@ -4229,6 +4240,9 @@ ice_read_stats_registers(struct ice_pf *pf, struct ice_hw *hw)\n \tice_stat_update_32(hw, PRTRPB_RDPC,\n \t\t\t   pf->offset_loaded, &os->eth.rx_discards,\n \t\t\t   &ns->eth.rx_discards);\n+\t/* enlarge the limitation when rx_bytes overflowed */\n+\tif (old_rx_bytes > ns->eth.rx_bytes && pf->offset_loaded)\n+\t\tns->eth.rx_bytes += (uint64_t)1 << ICE_40_BIT_WIDTH;\n \n \t/* Workaround: CRC size should not be included in byte statistics,\n \t * so subtract RTE_ETHER_CRC_LEN from the byte counter for each rx\n",
    "prefixes": [
        "1/2"
    ]
}