get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54683,
    "url": "http://patches.dpdk.org/api/patches/54683/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190611155221.2703-25-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": "<20190611155221.2703-25-leyi.rong@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190611155221.2703-25-leyi.rong@intel.com",
    "date": "2019-06-11T15:51:39",
    "name": "[v2,24/66] net/ice/base: add support for reading REPC statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5d83f20f87d23dadf1f2a4d807d7f7acd07a7ef3",
    "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/20190611155221.2703-25-leyi.rong@intel.com/mbox/",
    "series": [
        {
            "id": 4981,
            "url": "http://patches.dpdk.org/api/series/4981/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4981",
            "date": "2019-06-11T15:51:15",
            "name": "shared code update",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/4981/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54683/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54683/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 AF6F41C515;\n\tTue, 11 Jun 2019 17:54:40 +0200 (CEST)",
            "from mga02.intel.com (mga02.intel.com [134.134.136.20])\n\tby dpdk.org (Postfix) with ESMTP id 3AA571C4A5\n\tfor <dev@dpdk.org>; Tue, 11 Jun 2019 17:54:08 +0200 (CEST)",
            "from orsmga001.jf.intel.com ([10.7.209.18])\n\tby orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384;\n\t11 Jun 2019 08:54:07 -0700",
            "from lrong-srv-03.sh.intel.com ([10.67.119.177])\n\tby orsmga001.jf.intel.com with ESMTP; 11 Jun 2019 08:54:06 -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, 11 Jun 2019 23:51:39 +0800",
        "Message-Id": "<20190611155221.2703-25-leyi.rong@intel.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190611155221.2703-1-leyi.rong@intel.com>",
        "References": "<20190604054248.68510-1-leyi.rong@intel.com>\n\t<20190611155221.2703-1-leyi.rong@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v2 24/66] net/ice/base: add support for reading\n\tREPC 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\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": "Add a new ice_stat_update_repc function which will read the register and\nincrement the appropriate statistics in the ice_eth_stats structure.\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 | 51 +++++++++++++++++++++++++++++++\n drivers/net/ice/base/ice_common.h |  3 ++\n drivers/net/ice/base/ice_type.h   |  2 ++\n 3 files changed, 56 insertions(+)",
    "diff": "diff --git a/drivers/net/ice/base/ice_common.c b/drivers/net/ice/base/ice_common.c\nindex da72434d3..b4a9172b9 100644\n--- a/drivers/net/ice/base/ice_common.c\n+++ b/drivers/net/ice/base/ice_common.c\n@@ -4138,6 +4138,57 @@ ice_stat_update32(struct ice_hw *hw, u32 reg, bool prev_stat_loaded,\n \t\t*cur_stat = (new_data + BIT_ULL(32)) - *prev_stat;\n }\n \n+/**\n+ * ice_stat_update_repc - read GLV_REPC stats from chip and update stat values\n+ * @hw: ptr to the hardware info\n+ * @vsi_handle: VSI handle\n+ * @prev_stat_loaded: bool to specify if the previous stat values are loaded\n+ * @cur_stats: ptr to current stats structure\n+ *\n+ * The GLV_REPC statistic register actually tracks two 16bit statistics, and\n+ * thus cannot be read using the normal ice_stat_update32 function.\n+ *\n+ * Read the GLV_REPC register associated with the given VSI, and update the\n+ * rx_no_desc and rx_error values in the ice_eth_stats structure.\n+ *\n+ * Because the statistics in GLV_REPC stick at 0xFFFF, the register must be\n+ * cleared each time it's read.\n+ *\n+ * Note that the GLV_RDPC register also counts the causes that would trigger\n+ * GLV_REPC. However, it does not give the finer grained detail about why the\n+ * packets are being dropped. The GLV_REPC values can be used to distinguish\n+ * whether Rx packets are dropped due to errors or due to no available\n+ * descriptors.\n+ */\n+void\n+ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool prev_stat_loaded,\n+\t\t     struct ice_eth_stats *cur_stats)\n+{\n+\tu16 vsi_num, no_desc, error_cnt;\n+\tu32 repc;\n+\n+\tif (!ice_is_vsi_valid(hw, vsi_handle))\n+\t\treturn;\n+\n+\tvsi_num = ice_get_hw_vsi_num(hw, vsi_handle);\n+\n+\t/* If we haven't loaded stats yet, just clear the current value */\n+\tif (!prev_stat_loaded) {\n+\t\twr32(hw, GLV_REPC(vsi_num), 0);\n+\t\treturn;\n+\t}\n+\n+\trepc = rd32(hw, GLV_REPC(vsi_num));\n+\tno_desc = (repc & GLV_REPC_NO_DESC_CNT_M) >> GLV_REPC_NO_DESC_CNT_S;\n+\terror_cnt = (repc & GLV_REPC_ERROR_CNT_M) >> GLV_REPC_ERROR_CNT_S;\n+\n+\t/* Clear the count by writing to the stats register */\n+\twr32(hw, GLV_REPC(vsi_num), 0);\n+\n+\tcur_stats->rx_no_desc += no_desc;\n+\tcur_stats->rx_errors += error_cnt;\n+}\n+\n \n /**\n  * ice_sched_query_elem - query element information from HW\ndiff --git a/drivers/net/ice/base/ice_common.h b/drivers/net/ice/base/ice_common.h\nindex 10131b473..2ea4a6e8e 100644\n--- a/drivers/net/ice/base/ice_common.h\n+++ b/drivers/net/ice/base/ice_common.h\n@@ -205,6 +205,9 @@ ice_stat_update40(struct ice_hw *hw, u32 hireg, u32 loreg,\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+void\n+ice_stat_update_repc(struct ice_hw *hw, u16 vsi_handle, bool prev_stat_loaded,\n+\t\t     struct ice_eth_stats *cur_stats);\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);\ndiff --git a/drivers/net/ice/base/ice_type.h b/drivers/net/ice/base/ice_type.h\nindex 3523b0c35..477f34595 100644\n--- a/drivers/net/ice/base/ice_type.h\n+++ b/drivers/net/ice/base/ice_type.h\n@@ -853,6 +853,8 @@ struct ice_eth_stats {\n \tu64 rx_broadcast;\t\t/* bprc */\n \tu64 rx_discards;\t\t/* rdpc */\n \tu64 rx_unknown_protocol;\t/* rupp */\n+\tu64 rx_no_desc;\t\t\t/* repc */\n+\tu64 rx_errors;\t\t\t/* repc */\n \tu64 tx_bytes;\t\t\t/* gotc */\n \tu64 tx_unicast;\t\t\t/* uptc */\n \tu64 tx_multicast;\t\t/* mptc */\n",
    "prefixes": [
        "v2",
        "24/66"
    ]
}