get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 55026,
    "url": "http://patches.dpdk.org/api/patches/55026/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190619151846.113820-35-leyi.rong@intel.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": "<20190619151846.113820-35-leyi.rong@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190619151846.113820-35-leyi.rong@intel.com",
    "date": "2019-06-19T15:18:11",
    "name": "[v3,34/69] net/ice/base: track HW stat registers past rollover",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "198c17ee7a34db9ff1ea20dba057a6194279e153",
    "submitter": {
        "id": 1204,
        "url": "http://patches.dpdk.org/api/people/1204/?format=api",
        "name": "Leyi Rong",
        "email": "leyi.rong@intel.com"
    },
    "delegate": {
        "id": 1540,
        "url": "http://patches.dpdk.org/api/users/1540/?format=api",
        "username": "qzhan15",
        "first_name": "Qi",
        "last_name": "Zhang",
        "email": "qi.z.zhang@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190619151846.113820-35-leyi.rong@intel.com/mbox/",
    "series": [
        {
            "id": 5083,
            "url": "http://patches.dpdk.org/api/series/5083/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5083",
            "date": "2019-06-19T15:17:37",
            "name": "shared code update",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5083/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/55026/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/55026/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 22E2A1C572;\n\tWed, 19 Jun 2019 17:21:53 +0200 (CEST)",
            "from mga07.intel.com (mga07.intel.com [134.134.136.100])\n\tby dpdk.org (Postfix) with ESMTP id 4C0971C4F1\n\tfor <dev@dpdk.org>; Wed, 19 Jun 2019 17:20:56 +0200 (CEST)",
            "from orsmga006.jf.intel.com ([10.7.209.51])\n\tby orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t19 Jun 2019 08:20:56 -0700",
            "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby orsmga006.jf.intel.com with ESMTP; 19 Jun 2019 08:20:55 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.63,392,1557212400\"; d=\"scan'208\";a=\"165050402\"",
        "From": "Leyi Rong <leyi.rong@intel.com>",
        "To": "qi.z.zhang@intel.com",
        "Cc": "dev@dpdk.org, Leyi Rong <leyi.rong@intel.com>,\n\tJacob Keller <jacob.e.keller@intel.com>,\n\tPaul M Stillwell Jr <paul.m.stillwell.jr@intel.com>",
        "Date": "Wed, 19 Jun 2019 23:18:11 +0800",
        "Message-Id": "<20190619151846.113820-35-leyi.rong@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190619151846.113820-1-leyi.rong@intel.com>",
        "References": "<20190611155221.2703-1-leyi.rong@intel.com>\n\t<20190619151846.113820-1-leyi.rong@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v3 34/69] net/ice/base: track HW stat registers\n\tpast rollover",
        "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\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Modify ice_stat_update40 to use rd64 instead of two calls to rd32.\nAdditionally, drop the now unnecessary hireg function parameter.\n\nSigned-off-by: Jacob Keller <jacob.e.keller@intel.com>\nSigned-off-by: Paul M Stillwell Jr <paul.m.stillwell.jr@intel.com>\nSigned-off-by: Leyi Rong <leyi.rong@intel.com>\n---\n drivers/net/ice/base/ice_common.c | 57 +++++++++++++++++++------------\n drivers/net/ice/base/ice_common.h |  8 ++---\n 2 files changed, 38 insertions(+), 27 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex 1ed151050..199430e28 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -4004,40 +4004,44 @@ void ice_replay_post(struct ice_hw *hw)\n /**\n  * ice_stat_update40 - read 40 bit stat from the chip and update stat values\n  * @hw: ptr to the hardware info\n- * @hireg: high 32 bit HW register to read from\n- * @loreg: low 32 bit HW register to read from\n+ * @reg: offset of 64 bit HW register to read from\n  * @prev_stat_loaded: bool to specify if previous stats are loaded\n  * @prev_stat: ptr to previous loaded stat value\n  * @cur_stat: ptr to current stat value\n  */\n void\n-ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,\n-\t\t  bool prev_stat_loaded, u64 *prev_stat, u64 *cur_stat)\n+ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n+\t\t  u64 *prev_stat, u64 *cur_stat)\n {\n-\tu64 new_data;\n-\n-\tnew_data = rd32(hw, loreg);\n-\tnew_data |= ((u64)(rd32(hw, hireg) & 0xFFFF)) << 32;\n+\tu64 new_data = rd64(hw, reg) & (BIT_ULL(40) - 1);\n \n \t/* device stats are not reset at PFR, they likely will not be zeroed\n-\t * when the driver starts. So save the first values read and use them as\n-\t * offsets to be subtracted from the raw values in order to report stats\n-\t * that count from zero.\n+\t * when the driver starts. Thus, save the value from the first read\n+\t * without adding to the statistic value so that we report stats which\n+\t * count up from zero.\n \t */\n-\tif (!prev_stat_loaded)\n+\tif (!prev_stat_loaded) {\n \t\t*prev_stat = new_data;\n+\t\treturn;\n+\t}\n+\n+\t/* Calculate the difference between the new and old values, and then\n+\t * add it to the software stat value.\n+\t */\n \tif (new_data >= *prev_stat)\n-\t\t*cur_stat = new_data - *prev_stat;\n+\t\t*cur_stat += new_data - *prev_stat;\n \telse\n \t\t/* to manage the potential roll-over */\n-\t\t*cur_stat = (new_data + BIT_ULL(40)) - *prev_stat;\n-\t*cur_stat &= 0xFFFFFFFFFFULL;\n+\t\t*cur_stat += (new_data + BIT_ULL(40)) - *prev_stat;\n+\n+\t/* Update the previously stored value to prepare for next read */\n+\t*prev_stat = new_data;\n }\n \n /**\n  * ice_stat_update32 - read 32 bit stat from the chip and update stat values\n  * @hw: ptr to the hardware info\n- * @reg: HW register to read from\n+ * @reg: offset of HW register to read from\n  * @prev_stat_loaded: bool to specify if previous stats are loaded\n  * @prev_stat: ptr to previous loaded stat value\n  * @cur_stat: ptr to current stat value\n@@ -4051,17 +4055,26 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n \tnew_data = rd32(hw, reg);\n \n \t/* device stats are not reset at PFR, they likely will not be zeroed\n-\t * when the driver starts. So save the first values read and use them as\n-\t * offsets to be subtracted from the raw values in order to report stats\n-\t * that count from zero.\n+\t * when the driver starts. Thus, save the value from the first read\n+\t * without adding to the statistic value so that we report stats which\n+\t * count up from zero.\n \t */\n-\tif (!prev_stat_loaded)\n+\tif (!prev_stat_loaded) {\n \t\t*prev_stat = new_data;\n+\t\treturn;\n+\t}\n+\n+\t/* Calculate the difference between the new and old values, and then\n+\t * add it to the software stat value.\n+\t */\n \tif (new_data >= *prev_stat)\n-\t\t*cur_stat = new_data - *prev_stat;\n+\t\t*cur_stat += new_data - *prev_stat;\n \telse\n \t\t/* to manage the potential roll-over */\n-\t\t*cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;\n+\t\t*cur_stat += (new_data + BIT_ULL(32)) - *prev_stat;\n+\n+\t/* Update the previously stored value to prepare for next read */\n+\t*prev_stat = new_data;\n }\n \n \ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 4cd87fc1e..2063295ce 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -6,7 +6,6 @@\n #define _ICE_COMMON_H_\n \n #include \"ice_type.h\"\n-\n #include \"ice_flex_pipe.h\"\n #include \"ice_switch.h\"\n #include \"ice_fdir.h\"\n@@ -34,8 +33,7 @@ ice_clean_rq_elem(struct ice_hw *hw, struct ice_ctl_q_info *cq,\n \t\t  struct ice_rq_event_info *e, u16 *pending);\n enum ice_status\n ice_get_link_status(struct ice_port_info *pi, bool *link_up);\n-enum ice_status\n-ice_update_link_info(struct ice_port_info *pi);\n+enum ice_status ice_update_link_info(struct ice_port_info *pi);\n enum ice_status\n ice_acquire_res(struct ice_hw *hw, enum ice_aq_res_ids res,\n \t\tenum ice_aq_res_access_type access, u32 timeout);\n@@ -195,8 +193,8 @@ ice_cfg_tc_node_bw_alloc(struct ice_port_info *pi, u8 tc,\n enum ice_status ice_cfg_rl_burst_size(struct ice_hw *hw, u32 bytes);\n void ice_output_fw_log(struct ice_hw *hw, struct ice_aq_desc *desc, void *buf);\n void\n-ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,\n-\t\t  bool prev_stat_loaded, u64 *prev_stat, u64 *cur_stat);\n+ice_stat_update40(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n+\t\t  u64 *prev_stat, u64 *cur_stat);\n void\n ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n \t\t  u64 *prev_stat, u64 *cur_stat);\n",
    "prefixes": [
        "v3",
        "34/69"
    ]
}