Show a patch.

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

{
    "id": 44109,
    "url": "http://patches.dpdk.org/api/patches/44109/",
    "web_url": "http://patches.dpdk.org/patch/44109/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/",
        "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"
    },
    "msgid": "<1535718368-15803-13-git-send-email-amo@semihalf.com>",
    "date": "2018-08-31T12:26:08",
    "name": "[v2,8/8] net/mvneta: add reset statistics callback",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b4fe51d3d11dde69dbe8da1f595a492ae63539ee",
    "submitter": {
        "id": 1112,
        "url": "http://patches.dpdk.org/api/people/1112/",
        "name": "Andrzej Ostruszka",
        "email": "amo@semihalf.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/patch/44109/mbox/",
    "series": [
        {
            "id": 1131,
            "url": "http://patches.dpdk.org/api/series/1131/",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=1131",
            "date": "2018-08-31T12:25:56",
            "name": "Add Marvell NETA PMD",
            "version": 2,
            "mbox": "http://patches.dpdk.org/series/1131/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/44109/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44109/checks/",
    "tags": {},
    "headers": {
        "X-Mailman-Version": "2.1.15",
        "In-Reply-To": "<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "Errors-To": "dev-bounces@dpdk.org",
        "X-Mailer": "git-send-email 2.7.4",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CEC185F4A;\n\tFri, 31 Aug 2018 14:26:36 +0200 (CEST)",
            "from mail-lj1-f169.google.com (mail-lj1-f169.google.com\n\t[209.85.208.169]) by dpdk.org (Postfix) with ESMTP id 5703D5323\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 14:26:25 +0200 (CEST)",
            "by mail-lj1-f169.google.com with SMTP id 203-v6so9889451ljj.13\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 05:26:25 -0700 (PDT)",
            "from amok.semihalf.local (31-172-191-173.noc.fibertech.net.pl.\n\t[31.172.191.173]) by smtp.googlemail.com with ESMTPSA id\n\tt4-v6sm1825422lfd.13.2018.08.31.05.26.23\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 31 Aug 2018 05:26:24 -0700 (PDT)"
        ],
        "References": "<1535469030-18647-1-git-send-email-amo@semihalf.com>\n\t<1535718368-15803-1-git-send-email-amo@semihalf.com>",
        "X-Google-Smtp-Source": "ANB0Vdb/uFDcyu9c3zUTUG6RfNxGg8zmwmKJiYCx78dXc4SCa54yG//4v4Kufp/nZPrsdFW+R8850g==",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=semihalf-com.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=HPCe8+dphDyJouj+9BBARh0KCivb/kPpAsWuO9/6rZs=;\n\tb=fCg0NiatpvFPmM0Lzk+N+GUegsqMUJhFNSPiXeIEdVTBm9x0mdvQVNQwOxI3lB6RWq\n\tknBfnlMJgm/3817un3dR10DZfFUTDcIxeZqmbUNB6hvNs2lPi60DDcblEZcZYj++ZvZD\n\tUNzgKubAs5a1gsxMb26IXOwj565WdZqZ7zo70czZXsiLSY2mk6FiEWnrZwPKa0PGG81q\n\tIibOTBYjDQ41AZKDRwPpuOAVqGfCqFqys0Z5fRQCksm5ukX6TQu9+usv3ztSwoEdjPTc\n\tCSZLHZCEtF7+JiSdZA9uRT2vNFOadQIDhrq1qcIxX1AEXj7vDNnGwYY7bGmaDB0oqbt3\n\tMtXQ==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:a2e:9b59:: with SMTP id\n\to25-v6mr9820341ljj.132.1535718384821; \n\tFri, 31 Aug 2018 05:26:24 -0700 (PDT)",
        "Message-Id": "<1535718368-15803-13-git-send-email-amo@semihalf.com>",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=HPCe8+dphDyJouj+9BBARh0KCivb/kPpAsWuO9/6rZs=;\n\tb=W8I/+N23vn5sG6m99+VOPJvaBwVGXRbEyOjZxDgrLtzLlfRIwAHRNpJQf7pPDyCmnF\n\t3sA/qYWtLLyLKbrlq644S3q3I5W2MIuMhow9bB9SHUv4UJ9OlekXfuEeIVPE4oxB5Gp4\n\ta7KImlByB4wpWVlz3BLhVhf3si4gxi8vZk7pozry45TLXOdFlk0fnckPAhdfZTjXjWKY\n\tSZhtra20W8h1HuW4DASxfu8d+jRFN27IbM3ENvfVas5B3WkBSnqcGR/W64rDjobOp4Dz\n\tWjba/dPVunAeiz7EdWj/AYiwqB2gOVrZpLU445EuwCmfHbVg9JYY+cIrz9lcFaBYrqqH\n\tdtpw==",
        "Delivered-To": "patchwork@dpdk.org",
        "Precedence": "list",
        "From": "Andrzej Ostruszka <amo@semihalf.com>",
        "X-Original-To": "patchwork@dpdk.org",
        "List-Post": "<mailto:dev@dpdk.org>",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "Sender": "\"dev\" <dev-bounces@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>",
        "To": "dev@dpdk.org",
        "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>",
        "Date": "Fri, 31 Aug 2018 14:26:08 +0200",
        "X-Gm-Message-State": "APzg51C/ZnbYIqIDRsXR0VTyeJj/VB/djmvPhuVrGx1Ey0zYhAYcTQyk\n\tSZIL/fe8eUdCkZnJRm8GgiWfwGmkYZU=",
        "Cc": "mw@semihalf.com, zr@semihalf.com, tdu@semihalf.com, nsamsono@marvell.com",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "Subject": "[dpdk-dev] [PATCH v2 8/8] net/mvneta: add reset statistics callback"
    },
    "content": "From: Natalie Samsonov <nsamsono@marvell.com>\n\nAdd support for resetting of driver statistics.\n\nSigned-off-by: Natalie Samsonov <nsamsono@marvell.com>\n---\n drivers/net/mvneta/mvneta_ethdev.c | 40 +++++++++++++++++++++++++++++++-------\n drivers/net/mvneta/mvneta_ethdev.h |  1 +\n 2 files changed, 34 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 2bf2e2e..1bcfc68 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -1700,23 +1700,48 @@ mvneta_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n \n \tstats->ipackets += ppio_stats.rx_packets +\n \t\t\tppio_stats.rx_broadcast_packets +\n-\t\t\tppio_stats.rx_multicast_packets;\n+\t\t\tppio_stats.rx_multicast_packets -\n+\t\t\tpriv->prev_stats.ipackets;\n \tstats->opackets += ppio_stats.tx_packets +\n \t\t\tppio_stats.tx_broadcast_packets +\n-\t\t\tppio_stats.tx_multicast_packets;\n-\tstats->ibytes += ppio_stats.rx_bytes;\n-\tstats->obytes += ppio_stats.tx_bytes;\n+\t\t\tppio_stats.tx_multicast_packets -\n+\t\t\tpriv->prev_stats.opackets;\n+\tstats->ibytes += ppio_stats.rx_bytes - priv->prev_stats.ibytes;\n+\tstats->obytes += ppio_stats.tx_bytes - priv->prev_stats.obytes;\n \tstats->imissed += ppio_stats.rx_discard +\n-\t\t\t  ppio_stats.rx_overrun;\n+\t\t\t  ppio_stats.rx_overrun -\n+\t\t\t  priv->prev_stats.imissed;\n \n \tstats->ierrors = ppio_stats.rx_packets_err +\n \t\t\tppio_stats.rx_errors +\n-\t\t\tppio_stats.rx_crc_error;\n-\tstats->oerrors = ppio_stats.tx_errors;\n+\t\t\tppio_stats.rx_crc_error -\n+\t\t\tpriv->prev_stats.ierrors;\n+\tstats->oerrors = ppio_stats.tx_errors - priv->prev_stats.oerrors;\n \n \treturn 0;\n }\n \n+/**\n+ * DPDK callback to clear device statistics.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ */\n+static void\n+mvneta_stats_reset(struct rte_eth_dev *dev)\n+{\n+\tstruct mvneta_priv *priv = dev->data->dev_private;\n+\tunsigned int ret;\n+\n+\tif (!priv->ppio)\n+\t\treturn;\n+\n+\tret = mvneta_stats_get(dev, &priv->prev_stats);\n+\tif (unlikely(ret))\n+\t\tRTE_LOG(ERR, PMD, \"Failed to reset port statistics\");\n+}\n+\n+\n static const struct eth_dev_ops mvneta_ops = {\n \t.dev_configure = mvneta_dev_configure,\n \t.dev_start = mvneta_dev_start,\n@@ -1732,6 +1757,7 @@ static const struct eth_dev_ops mvneta_ops = {\n \t.mac_addr_set = mvneta_mac_addr_set,\n \t.mtu_set = mvneta_mtu_set,\n \t.stats_get = mvneta_stats_get,\n+\t.stats_reset = mvneta_stats_reset,\n \t.dev_infos_get = mvneta_dev_infos_get,\n \t.dev_supported_ptypes_get = mvneta_dev_supported_ptypes_get,\n \t.rxq_info_get = mvneta_rxq_info_get,\ndiff --git a/drivers/net/mvneta/mvneta_ethdev.h b/drivers/net/mvneta/mvneta_ethdev.h\nindex a05566d..6aed170 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.h\n+++ b/drivers/net/mvneta/mvneta_ethdev.h\n@@ -77,6 +77,7 @@ struct mvneta_priv {\n \tuint16_t nb_rx_queues;\n \n \tuint64_t rate_max;\n+\tstruct rte_eth_stats prev_stats;\n };\n \n /** Current log type. */\n",
    "prefixes": [
        "v2",
        "8/8"
    ]
}