Show a patch.

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

{
    "id": 44108,
    "url": "http://patches.dpdk.org/api/patches/44108/",
    "web_url": "http://patches.dpdk.org/patch/44108/",
    "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-12-git-send-email-amo@semihalf.com>",
    "date": "2018-08-31T12:26:07",
    "name": "[v2,7/8] net/mvneta: add support for basic stats",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b2da7db3e236eb1912cba9cf98ac443318c17734",
    "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/44108/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/44108/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/44108/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 718675F3B;\n\tFri, 31 Aug 2018 14:26:35 +0200 (CEST)",
            "from mail-lj1-f195.google.com (mail-lj1-f195.google.com\n\t[209.85.208.195]) by dpdk.org (Postfix) with ESMTP id 35E485B1C\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 14:26:24 +0200 (CEST)",
            "by mail-lj1-f195.google.com with SMTP id q127-v6so9921009ljq.11\n\tfor <dev@dpdk.org>; Fri, 31 Aug 2018 05:26:24 -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.22\n\t(version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 31 Aug 2018 05:26:22 -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": "ANB0VdYx50olwTxQ/aOtJShfbZRSpwBTB6VaTEFEJo7y264zutKBcqKDTAYcxklomHsC0MseYgBRXQ==",
        "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=641bOQyXnPBd0PuBrqeZd6wbOylyz8T4ffQk7FQhgds=;\n\tb=JDtctyPbUxlwNmZ+nlNSILNxZ9Hvmq5Pc/tCagR6hIWTny5RGVZmNtrStE3jGm04gB\n\tnI+htUWtMLJAa/5W8FFWTH/JQd5K+js8Gsv5NuIFdgXv/Xg/8ooZ5Y21KWf3vgmROQMZ\n\tCE08X+gecUaVtbtfe+7ciknLcYy1uoz/I+PGv0L1NJ7SUgNUA3yZorWKRmD7mA+xnGn/\n\ttuwuhYk+FW2mwYKbyv7W0ZsgyU4HsDU0hCG4mEZed1/fDSjY3lmeNHLXcE4ssbYpVYmT\n\tgNF9zZ4fQEEouBELLXVdSzb3CnRs5KufgEMP/w40ALIc5LiEJXbTnAzvsR4IVE6wOtNm\n\tWhYw==",
        "X-BeenThere": "dev@dpdk.org",
        "X-Received": "by 2002:a2e:8103:: with SMTP id\n\td3-v6mr1802766ljg.3.1535718383678; \n\tFri, 31 Aug 2018 05:26:23 -0700 (PDT)",
        "Message-Id": "<1535718368-15803-12-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=641bOQyXnPBd0PuBrqeZd6wbOylyz8T4ffQk7FQhgds=;\n\tb=g/n6pY5YVAt8NfvKs7owlJg8yKs7/sSBIbQ9H0GwPC9y1azqMgNTjVLd/VWL+Ju1pU\n\tAIC8oLghLg4XcchDifeStAU67VQhPWx+27z8o3C0Zk5evUMeBjr4SRPFmiigBEne3PoI\n\t5UEknDQYQcAD7lll3lrFFzWeTk+zzOyqtNHXqx8QwrZ3/PhA5zHAPwWFr0Yh+iY9q/5g\n\tsjFxGIC/9hwR+x458eGhUZdSK+0XGWBUImR3rBcrCeBbx0ugaRI3QNP2bm89CGmtIotp\n\tDyE/mSUcP+VYDOkuQVMdhG/Uk6uNqI6duUNdFKdbp+jFzKjFBkIRZtqRj1fsPvYZIiVS\n\tstEQ==",
        "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:07 +0200",
        "X-Gm-Message-State": "APzg51CT0lUz4RM1PMDisIIYNMkfGLgTMs0b/D7cBkQSmu08do/CExVk\n\tqtgV+wRkZt4LZD6K/X6A7agEOYMMGgc=",
        "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 7/8] net/mvneta: add support for basic stats"
    },
    "content": "From: Zyta Szpak <zr@semihalf.com>\n\nAdd support for getting of basic statistics for the driver.\n\nSigned-off-by: Yelena Krivosheev <yelena@marvell.com>\nSigned-off-by: Natalie Samsonov <nsamsono@marvell.com>\nSigned-off-by: Zyta Szpak <zr@semihalf.com>\n---\n drivers/net/mvneta/mvneta_ethdev.c | 47 ++++++++++++++++++++++++++++++++++++++\n 1 file changed, 47 insertions(+)",
    "diff": "diff --git a/drivers/net/mvneta/mvneta_ethdev.c b/drivers/net/mvneta/mvneta_ethdev.c\nindex 975375e..2bf2e2e 100644\n--- a/drivers/net/mvneta/mvneta_ethdev.c\n+++ b/drivers/net/mvneta/mvneta_ethdev.c\n@@ -1671,6 +1671,52 @@ mvneta_mac_addr_set(struct rte_eth_dev *dev, struct ether_addr *mac_addr)\n \treturn 0;\n }\n \n+/**\n+ * DPDK callback to get device statistics.\n+ *\n+ * @param dev\n+ *   Pointer to Ethernet device structure.\n+ * @param stats\n+ *   Stats structure output buffer.\n+ *\n+ * @return\n+ *   0 on success, negative error value otherwise.\n+ */\n+static int\n+mvneta_stats_get(struct rte_eth_dev *dev, struct rte_eth_stats *stats)\n+{\n+\tstruct mvneta_priv *priv = dev->data->dev_private;\n+\tstruct neta_ppio_statistics ppio_stats;\n+\tunsigned int ret;\n+\n+\tif (!priv->ppio)\n+\t\treturn -EPERM;\n+\n+\tret = neta_ppio_get_statistics(priv->ppio, &ppio_stats);\n+\tif (unlikely(ret)) {\n+\t\tMVNETA_LOG(ERR, \"Failed to update port statistics\");\n+\t\treturn ret;\n+\t}\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+\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+\tstats->imissed += ppio_stats.rx_discard +\n+\t\t\t  ppio_stats.rx_overrun;\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+\n+\treturn 0;\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@@ -1685,6 +1731,7 @@ static const struct eth_dev_ops mvneta_ops = {\n \t.mac_addr_add = mvneta_mac_addr_add,\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.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,\n",
    "prefixes": [
        "v2",
        "7/8"
    ]
}