get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 6082,
    "url": "https://patches.dpdk.org/api/patches/6082/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1436118000-132275-3-git-send-email-maryam.tahhan@intel.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": "<1436118000-132275-3-git-send-email-maryam.tahhan@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1436118000-132275-3-git-send-email-maryam.tahhan@intel.com",
    "date": "2015-07-05T17:39:54",
    "name": "[dpdk-dev,v4,2/8] ixgbe: add functions to get and reset xstats",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "390127c179c9ce7bf663b574363b2ef3e283d350",
    "submitter": {
        "id": 259,
        "url": "https://patches.dpdk.org/api/people/259/?format=api",
        "name": "Tahhan, Maryam",
        "email": "maryam.tahhan@intel.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1436118000-132275-3-git-send-email-maryam.tahhan@intel.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/6082/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/6082/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 [IPv6:::1])\n\tby dpdk.org (Postfix) with ESMTP id ED198C39A;\n\tSun,  5 Jul 2015 19:40:10 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n\tby dpdk.org (Postfix) with ESMTP id 46D05C38E\n\tfor <dev@dpdk.org>; Sun,  5 Jul 2015 19:40:08 +0200 (CEST)",
            "from orsmga002.jf.intel.com ([10.7.209.21])\n\tby orsmga102.jf.intel.com with ESMTP; 05 Jul 2015 10:40:08 -0700",
            "from sie-lab-212-170.ir.intel.com (HELO\n\tsilpixa00378251.ir.intel.com) ([10.237.212.170])\n\tby orsmga002.jf.intel.com with ESMTP; 05 Jul 2015 10:40:07 -0700"
        ],
        "X-ExtLoop1": "1",
        "X-IronPort-AV": "E=Sophos;i=\"5.15,410,1432623600\"; d=\"scan'208\";a=\"758773002\"",
        "From": "Maryam Tahhan <maryam.tahhan@intel.com>",
        "To": "dev@dpdk.org",
        "Date": "Sun,  5 Jul 2015 18:39:54 +0100",
        "Message-Id": "<1436118000-132275-3-git-send-email-maryam.tahhan@intel.com>",
        "X-Mailer": "git-send-email 1.9.3",
        "In-Reply-To": "<1436118000-132275-1-git-send-email-maryam.tahhan@intel.com>",
        "References": "<1436118000-132275-1-git-send-email-maryam.tahhan@intel.com>",
        "Subject": "[dpdk-dev] [PATCH v4 2/8] ixgbe: add functions to get and reset\n\txstats",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "patches and discussions about DPDK <dev.dpdk.org>",
        "List-Unsubscribe": "<http://dpdk.org/ml/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://dpdk.org/ml/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<http://dpdk.org/ml/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Implement ixgbe_dev_xstats_reset and ixgbe_dev_xstats_get.\n\nSigned-off-by: Maryam Tahhan <maryam.tahhan@intel.com>\n---\n drivers/net/ixgbe/ixgbe_ethdev.c | 87 ++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 87 insertions(+)",
    "diff": "diff --git a/drivers/net/ixgbe/ixgbe_ethdev.c b/drivers/net/ixgbe/ixgbe_ethdev.c\nindex 927021f..7feb03c 100644\n--- a/drivers/net/ixgbe/ixgbe_ethdev.c\n+++ b/drivers/net/ixgbe/ixgbe_ethdev.c\n@@ -131,7 +131,10 @@ static int ixgbe_dev_link_update(struct rte_eth_dev *dev,\n \t\t\t\tint wait_to_complete);\n static void ixgbe_dev_stats_get(struct rte_eth_dev *dev,\n \t\t\t\tstruct rte_eth_stats *stats);\n+static int ixgbe_dev_xstats_get(struct rte_eth_dev *dev,\n+\t\t\t\tstruct rte_eth_xstats *xstats, unsigned n);\n static void ixgbe_dev_stats_reset(struct rte_eth_dev *dev);\n+static void ixgbe_dev_xstats_reset(struct rte_eth_dev *dev);\n static int ixgbe_dev_queue_stats_mapping_set(struct rte_eth_dev *eth_dev,\n \t\t\t\t\t     uint16_t queue_id,\n \t\t\t\t\t     uint8_t stat_idx,\n@@ -334,7 +337,9 @@ static const struct eth_dev_ops ixgbe_eth_dev_ops = {\n \t.allmulticast_disable = ixgbe_dev_allmulticast_disable,\n \t.link_update          = ixgbe_dev_link_update,\n \t.stats_get            = ixgbe_dev_stats_get,\n+\t.xstats_get           = ixgbe_dev_xstats_get,\n \t.stats_reset          = ixgbe_dev_stats_reset,\n+\t.xstats_reset         = ixgbe_dev_xstats_reset,\n \t.queue_stats_mapping_set = ixgbe_dev_queue_stats_mapping_set,\n \t.dev_infos_get        = ixgbe_dev_info_get,\n \t.mtu_set              = ixgbe_dev_mtu_set,\n@@ -414,6 +419,33 @@ static const struct eth_dev_ops ixgbevf_eth_dev_ops = {\n \t.set_mc_addr_list     = ixgbe_dev_set_mc_addr_list,\n };\n \n+/* store statistics names and its offset in stats structure  */ struct\n+rte_ixgbe_xstats_name_off {\n+\tchar name[RTE_ETH_XSTATS_NAME_SIZE];\n+\tunsigned offset;\n+};\n+\n+static const struct rte_ixgbe_xstats_name_off rte_ixgbe_stats_strings[] = {\n+\t{\"rx_illegal_byte_err\", offsetof(struct ixgbe_hw_stats, errbc)},\n+\t{\"rx_len_err\", offsetof(struct ixgbe_hw_stats, rlec)},\n+\t{\"rx_undersize_count\", offsetof(struct ixgbe_hw_stats, ruc)},\n+\t{\"rx_oversize_count\", offsetof(struct ixgbe_hw_stats, roc)},\n+\t{\"rx_fragment_count\", offsetof(struct ixgbe_hw_stats, rfc)},\n+\t{\"rx_jabber_count\", offsetof(struct ixgbe_hw_stats, rjc)},\n+\t{\"l3_l4_xsum_error\", offsetof(struct ixgbe_hw_stats, xec)},\n+\t{\"mac_local_fault\", offsetof(struct ixgbe_hw_stats, mlfc)},\n+\t{\"mac_remote_fault\", offsetof(struct ixgbe_hw_stats, mrfc)},\n+\t{\"mac_short_pkt_discard\", offsetof(struct ixgbe_hw_stats, mspdc)},\n+\t{\"fccrc_error\", offsetof(struct ixgbe_hw_stats, fccrc)},\n+\t{\"fcoe_drop\", offsetof(struct ixgbe_hw_stats, fcoerpdc)},\n+\t{\"fc_last_error\", offsetof(struct ixgbe_hw_stats, fclast)},\n+\t{\"rx_broadcast_packets\", offsetof(struct ixgbe_hw_stats, bprc)},\n+\t{\"mgmt_pkts_dropped\", offsetof(struct ixgbe_hw_stats, mngpdc)},\n+};\n+\n+#define IXGBE_NB_XSTATS (sizeof(rte_ixgbe_stats_strings) /\t\\\n+\t\tsizeof(rte_ixgbe_stats_strings[0]))\n+\n /**\n  * Atomically reads the link status information from global\n  * structure rte_eth_dev.\n@@ -1982,6 +2014,61 @@ ixgbe_dev_stats_reset(struct rte_eth_dev *dev)\n \tmemset(stats, 0, sizeof(*stats));\n }\n \n+static int\n+ixgbe_dev_xstats_get(struct rte_eth_dev *dev, struct rte_eth_xstats *xstats,\n+\t\t\t\t\t unsigned n)\n+{\n+\tstruct ixgbe_hw *hw =\n+\t\t\tIXGBE_DEV_PRIVATE_TO_HW(dev->data->dev_private);\n+\tstruct ixgbe_hw_stats *hw_stats =\n+\t\t\tIXGBE_DEV_PRIVATE_TO_STATS(dev->data->dev_private);\n+\tuint64_t total_missed_rx, total_qbrc, total_qprc, total_qprdc;\n+\tuint64_t rxnfgpc, txdgpc;\n+\tunsigned i, count = IXGBE_NB_XSTATS;\n+\n+\tif (n < count)\n+\t\treturn count;\n+\n+\ttotal_missed_rx = 0;\n+\ttotal_qbrc = 0;\n+\ttotal_qprc = 0;\n+\ttotal_qprdc = 0;\n+\trxnfgpc = 0;\n+\ttxdgpc = 0;\n+\n+\tixgbe_read_stats_registers(hw, hw_stats, &total_missed_rx, &total_qbrc,\n+\t\t\t\t\t\t\t   &total_qprc, &rxnfgpc, &txdgpc, &total_qprdc);\n+\n+\t/* If this is a reset xstats is NULL, and we have cleared the\n+\t * registers by reading them.\n+\t */\n+\tif (!xstats)\n+\t\treturn 0;\n+\n+\t/* Extended stats */\n+\tfor (i = 0; i < IXGBE_NB_XSTATS; i++) {\n+\t\tsnprintf(xstats[i].name, sizeof(xstats[i].name),\n+\t\t\t\t\"%s\", rte_ixgbe_stats_strings[i].name);\n+\t\txstats[i].value = *(uint64_t *)(((char *)hw_stats) +\n+\t\t\t\t\t\t\trte_ixgbe_stats_strings[i].offset);\n+\t}\n+\n+\treturn count;\n+}\n+\n+static void\n+ixgbe_dev_xstats_reset(struct rte_eth_dev *dev)\n+{\n+\tstruct ixgbe_hw_stats *stats =\n+\t\t\tIXGBE_DEV_PRIVATE_TO_STATS(dev->data->dev_private);\n+\n+\t/* HW registers are cleared on read */\n+\tixgbe_dev_xstats_get(dev, NULL, IXGBE_NB_XSTATS);\n+\n+\t/* Reset software totals */\n+\tmemset(stats, 0, sizeof(*stats));\n+}\n+\n static void\n ixgbevf_dev_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n {\n",
    "prefixes": [
        "dpdk-dev",
        "v4",
        "2/8"
    ]
}