get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54307,
    "url": "http://patches.dpdk.org/api/patches/54307/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190604054248.68510-32-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": "<20190604054248.68510-32-leyi.rong@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190604054248.68510-32-leyi.rong@intel.com",
    "date": "2019-06-04T05:42:30",
    "name": "[31/49] net/ice/base: track HW stat registers past rollover",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "61a08b65fde22cb8e879881c691d2bdd9a0d4682",
    "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/20190604054248.68510-32-leyi.rong@intel.com/mbox/",
    "series": [
        {
            "id": 4879,
            "url": "http://patches.dpdk.org/api/series/4879/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4879",
            "date": "2019-06-04T05:41:59",
            "name": "shared code update",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/4879/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54307/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54307/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 B5E471BBF6;\n\tTue,  4 Jun 2019 07:45:13 +0200 (CEST)",
            "from mga04.intel.com (mga04.intel.com [192.55.52.120])\n\tby dpdk.org (Postfix) with ESMTP id 0C9321B9F4\n\tfor <dev@dpdk.org>; Tue,  4 Jun 2019 07:44:27 +0200 (CEST)",
            "from fmsmga008.fm.intel.com ([10.253.24.58])\n\tby fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t03 Jun 2019 22:44:27 -0700",
            "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby fmsmga008.fm.intel.com with ESMTP; 03 Jun 2019 22:44:26 -0700"
        ],
        "X-Amp-Result": "SKIPPED(no attachment in message)",
        "X-Amp-File-Uploaded": "False",
        "X-ExtLoop1": "1",
        "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": "Tue,  4 Jun 2019 13:42:30 +0800",
        "Message-Id": "<20190604054248.68510-32-leyi.rong@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190604054248.68510-1-leyi.rong@intel.com>",
        "References": "<20190604054248.68510-1-leyi.rong@intel.com>",
        "Subject": "[dpdk-dev] [PATCH 31/49] net/ice/base: track HW stat registers past\n\trollover",
        "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 | 10 +++---\n 2 files changed, 39 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex db3acc040..f9a5d43e6 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -4087,40 +4087,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@@ -4134,17 +4138,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 2ea4a6e8e..673943cb9 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@@ -200,8 +198,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@@ -211,5 +209,5 @@ ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool prev_stat_loaded,\n enum ice_status\n ice_sched_query_elem(struct ice_hw *hw, u32 node_teid,\n \t\t     struct ice_aqc_get_elem *buf);\n-bool ice_is_fw_in_rec_mode(struct ice_hw *hw);\n #endif /* _ICE_COMMON_H_ */\n+bool ice_is_fw_in_rec_mode(struct ice_hw *hw);\n",
    "prefixes": [
        "31/49"
    ]
}