get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 52689,
    "url": "http://patches.dpdk.org/api/patches/52689/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-6-g.singh@nxp.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": "<20190412105105.24351-6-g.singh@nxp.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190412105105.24351-6-g.singh@nxp.com",
    "date": "2019-04-12T11:01:29",
    "name": "[v3,05/13] net/enetc: add basic statistics",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "00a4e40435399065f0966a64ed8934d3f4d33df7",
    "submitter": {
        "id": 1068,
        "url": "http://patches.dpdk.org/api/people/1068/?format=api",
        "name": "Gagandeep Singh",
        "email": "g.singh@nxp.com"
    },
    "delegate": {
        "id": 319,
        "url": "http://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@intel.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190412105105.24351-6-g.singh@nxp.com/mbox/",
    "series": [
        {
            "id": 4280,
            "url": "http://patches.dpdk.org/api/series/4280/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=4280",
            "date": "2019-04-12T11:01:11",
            "name": "ENETC PMD basic features and bug fixes",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/4280/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/52689/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/52689/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "X-BeenThere": "dev@dpdk.org",
        "Return-Path": "<dev-bounces@dpdk.org>",
        "MIME-Version": "1.0",
        "X-MS-TNEF-Correlator": "",
        "Subject": "[dpdk-dev] [PATCH v3 05/13] net/enetc: add basic statistics",
        "Message-ID": "<20190412105105.24351-6-g.singh@nxp.com>",
        "Accept-Language": "en-US",
        "received-spf": "None (protection.outlook.com: nxp.com does not designate\n\tpermitted sender hosts)",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "References": "<1555075598-4988-1-git-send-email-g.singh@nxp.com>\n\t<20190412105105.24351-1-g.singh@nxp.com>",
        "In-Reply-To": "<20190412105105.24351-1-g.singh@nxp.com>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "X-MS-Exchange-Transport-CrossTenantHeadersStamped": "VE1PR04MB6462",
        "X-MS-Exchange-CrossTenant-id": "686ea1d3-bc2b-4c6f-a92c-d99c5c301635",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "CC": "Gagandeep Singh <G.Singh@nxp.com>",
        "X-MS-Exchange-CrossTenant-fromentityheader": "Hosted",
        "Content-Type": "text/plain; charset=\"utf-8\"",
        "x-forefront-antispam-report": "SFV:NSPM;\n\tSFS:(10009020)(136003)(376002)(366004)(396003)(346002)(39860400002)(189003)(199004)(14444005)(2501003)(186003)(97736004)(7736002)(3846002)(110136005)(99286004)(6116002)(102836004)(86362001)(316002)(2616005)(11346002)(476003)(6506007)(446003)(76176011)(305945005)(26005)(1076003)(106356001)(66066001)(486006)(4326008)(105586002)(386003)(478600001)(52116002)(72206003)(50226002)(5660300002)(6436002)(81156014)(6512007)(71200400001)(8936002)(71190400001)(6486002)(68736007)(53936002)(256004)(25786009)(8676002)(81166006)(36756003)(14454004)(2906002);\n\tDIR:OUT; SFP:1101; SCL:1; SRVR:VE1PR04MB6462;\n\tH:VE1PR04MB6365.eurprd04.prod.outlook.com; FPR:; SPF:None; LANG:en;\n\tPTR:InfoNoRecords; MX:1; A:1; ",
        "Content-Transfer-Encoding": "base64",
        "Thread-Index": "AQHU8R8UdCBaM8zXskSUUPAGt2Qf7w==",
        "X-OriginatorOrg": "nxp.com",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "X-MS-Exchange-CrossTenant-Network-Message-Id": "f98d64b4-59f1-41ce-3082-08d6bf363723",
        "Date": "Fri, 12 Apr 2019 11:01:29 +0000",
        "From": "Gagandeep Singh <G.Singh@nxp.com>",
        "x-ms-exchange-messagesentrepresentingtype": "1",
        "X-MS-Exchange-CrossTenant-originalarrivaltime": "12 Apr 2019 11:01:29.8479\n\t(UTC)",
        "X-Mailman-Version": "2.1.15",
        "List-Post": "<mailto:dev@dpdk.org>",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1;\n\th=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;\n\tbh=9rGb+RUnXyk2sWepr6xgGJoTfW1WEvOV2gwNxnYRsT4=;\n\tb=vn0NCbjBvDkU0ka6CjRx8Qw804bbQ+1A/bo7P/capgi82eTkGagzw79typxnXPIAKrB4zJCRehIrhL6KkYPrkpkrK0odJTmGH5Zro6+B8MRxkhmzaCi/Ek6DnSGGkuNMyeGQuTi4Bmc0zWSDWCTOYyFlnv4xceZG+hDfoSacD0s=",
        "x-ms-exchange-senderadcheck": "1",
        "To": "\"dev@dpdk.org\" <dev@dpdk.org>, \"ferruh.yigit@intel.com\"\n\t<ferruh.yigit@intel.com>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 72F931B0F8;\n\tFri, 12 Apr 2019 13:01:37 +0200 (CEST)",
            "from EUR01-VE1-obe.outbound.protection.outlook.com\n\t(mail-eopbgr140049.outbound.protection.outlook.com [40.107.14.49])\n\tby dpdk.org (Postfix) with ESMTP id 3B35169D4\n\tfor <dev@dpdk.org>; Fri, 12 Apr 2019 13:01:31 +0200 (CEST)",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com (10.255.118.78) by\n\tVE1PR04MB6462.eurprd04.prod.outlook.com (20.179.233.19) with\n\tMicrosoft SMTP Server (version=TLS1_2,\n\tcipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n\t15.20.1771.21; Fri, 12 Apr 2019 11:01:30 +0000",
            "from VE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0]) by\n\tVE1PR04MB6365.eurprd04.prod.outlook.com\n\t([fe80::f5ad:f178:4c55:13e0%3]) with mapi id 15.20.1792.016;\n\tFri, 12 Apr 2019 11:01:30 +0000"
        ],
        "X-MS-Has-Attach": "",
        "x-microsoft-antispam-message-info": "z0fLkbAifzhx4nGP+mmvwH65t9Rq9G2EsV/BGtDMSfcDqiBJpKBsZq/8PhKW+rwnbFek/ElIQkbFdCoKgz7v233SSEnwINPxctMM0eMJIEhcvRhF2NWW+B1g2iPhgRiNQ//hDBp+e892LXtEst4BKnRIYbQZc13/DZoOdHRNAT6UiJdl/qEyHaoat8ERoE3k+dcRQ+a70PkC53nbYMIiOrPhu7rqUNFnSZ91EyTHtk3GBoScTjSnk5XYmO6d9UkaGid1MS8+eqNZOuC4d/hnVLmLUl2se3xuCLT48c1TMhmHCQTxAzPZVOn4QNnyNncvjSGUt8Nu9DVYNmmhj8THmU8JYYEl3izjTx0w1oQG3d3dOCpKipUWVxE/W8gOTmOXpxbb5VYmbpE0IE5MkBJCBGqXC3vKbju/MOxImXK+j0A=",
        "x-microsoft-antispam": "BCL:0; PCL:0;\n\tRULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600139)(711020)(4605104)(4618075)(2017052603328)(7193020);\n\tSRVR:VE1PR04MB6462; ",
        "Errors-To": "dev-bounces@dpdk.org",
        "x-clientproxiedby": "TYAPR01CA0204.jpnprd01.prod.outlook.com\n\t(2603:1096:404:29::24) To VE1PR04MB6365.eurprd04.prod.outlook.com\n\t(2603:10a6:803:12a::14)",
        "x-ms-traffictypediagnostic": "VE1PR04MB6462:",
        "x-originating-ip": "[92.120.1.68]",
        "Delivered-To": "patchwork@dpdk.org",
        "X-Original-To": "patchwork@dpdk.org",
        "x-forefront-prvs": "0005B05917",
        "x-ms-office365-filtering-ht": "Tenant",
        "x-ms-publictraffictype": "Email",
        "x-microsoft-antispam-prvs": "<VE1PR04MB6462C2BD8F080C28BA3ED740E1280@VE1PR04MB6462.eurprd04.prod.outlook.com>",
        "X-MS-Exchange-CrossTenant-mailboxtype": "HOSTED",
        "x-mailer": "git-send-email 2.17.1",
        "authentication-results": "spf=none (sender IP is )\n\tsmtp.mailfrom=G.Singh@nxp.com; ",
        "Thread-Topic": "[PATCH v3 05/13] net/enetc: add basic statistics",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "Content-Language": "en-US",
        "x-ms-office365-filtering-correlation-id": "f98d64b4-59f1-41ce-3082-08d6bf363723",
        "Precedence": "list"
    },
    "content": "Enable basic statistics APIs enetc_stats_get\nand enetc_stats_reset.\n\nSigned-off-by: Gagandeep Singh <g.singh@nxp.com>\n---\n doc/guides/nics/enetc.rst          |  1 +\n doc/guides/nics/features/enetc.ini |  1 +\n drivers/net/enetc/base/enetc_hw.h  | 27 ++++++++++++++++++++++++-\n drivers/net/enetc/enetc_ethdev.c   | 41 ++++++++++++++++++++++++++++++++++++++\n 4 files changed, 69 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/doc/guides/nics/enetc.rst b/doc/guides/nics/enetc.rst\r\nindex 8038bf2..9f575d2 100644\r\n--- a/doc/guides/nics/enetc.rst\r\n+++ b/doc/guides/nics/enetc.rst\r\n@@ -46,6 +46,7 @@ ENETC Features\r\n \r\n - Link Status\r\n - Packet type information\r\n+- Basic stats\r\n \r\n NIC Driver (PMD)\r\n ~~~~~~~~~~~~~~~~\r\ndiff --git a/doc/guides/nics/features/enetc.ini b/doc/guides/nics/features/enetc.ini\r\nindex 69476a2..d8bd567 100644\r\n--- a/doc/guides/nics/features/enetc.ini\r\n+++ b/doc/guides/nics/features/enetc.ini\r\n@@ -6,6 +6,7 @@\r\n [Features]\r\n Packet type parsing  = Y\r\n Link status          = Y\r\n+Basic stats          = Y\r\n Linux VFIO           = Y\r\n ARMv8                = Y\r\n Usage doc            = Y\r\ndiff --git a/drivers/net/enetc/base/enetc_hw.h b/drivers/net/enetc/base/enetc_hw.h\r\nindex e3738a6..3f0a2a9 100644\r\n--- a/drivers/net/enetc/base/enetc_hw.h\r\n+++ b/drivers/net/enetc/base/enetc_hw.h\r\n@@ -115,8 +115,33 @@\r\n #define ENETC_G_EIPBRR0\t\t\t0x00bf8\r\n #define ENETC_G_EIPBRR1\t\t\t0x00bfc\r\n \r\n-\r\n /* MAC Counters */\r\n+/* Config register to reset counters*/\r\n+#define ENETC_PM0_STAT_CONFIG\t\t0x080E0\r\n+/* Receive frames counter without error */\r\n+#define ENETC_PM0_RFRM\t\t\t0x08120\r\n+/* Receive packets counter, good + bad */\r\n+#define ENETC_PM0_RPKT\t\t\t0x08160\r\n+/* Received octets, good + bad */\r\n+#define ENETC_PM0_REOCT\t\t\t0x08120\r\n+/* Transmit octets, good + bad */\r\n+#define ENETC_PM0_TEOCT\t\t\t0x08200\r\n+/* Transmit frames counter without error */\r\n+#define ENETC_PM0_TFRM\t\t\t0x08220\r\n+/* Transmit packets counter, good + bad */\r\n+#define ENETC_PM0_TPKT\t\t\t0x08260\r\n+/* Dropped not Truncated packets counter */\r\n+#define ENETC_PM0_RDRNTP\t\t0x081C8\r\n+/* Dropped + trucated packets counter */\r\n+#define ENETC_PM0_RDRP\t\t\t0x08158\r\n+/* Receive packets error counter */\r\n+#define ENETC_PM0_RERR\t\t\t0x08138\r\n+/* Transmit packets error counter */\r\n+#define ENETC_PM0_TERR\t\t\t0x08238\r\n+\r\n+/* Stats Reset Bit*/\r\n+#define ENETC_CLEAR_STATS\t\tBIT(2)\r\n+\r\n #define ENETC_G_EPFBLPR(n)\t\t(0xd00 + 4 * (n))\r\n #define ENETC_G_EPFBLPR1_XGMII\t\t0x80000000\r\n \r\ndiff --git a/drivers/net/enetc/enetc_ethdev.c b/drivers/net/enetc/enetc_ethdev.c\r\nindex 91e9692..10b2b39 100644\r\n--- a/drivers/net/enetc/enetc_ethdev.c\r\n+++ b/drivers/net/enetc/enetc_ethdev.c\r\n@@ -29,6 +29,9 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,\r\n \t\tconst struct rte_eth_txconf *tx_conf);\r\n static void enetc_tx_queue_release(void *txq);\r\n static const uint32_t *enetc_supported_ptypes_get(struct rte_eth_dev *dev);\r\n+static int enetc_stats_get(struct rte_eth_dev *dev,\r\n+\t\tstruct rte_eth_stats *stats);\r\n+static void enetc_stats_reset(struct rte_eth_dev *dev);\r\n \r\n /*\r\n  * The set of PCI devices this driver supports\r\n@@ -46,6 +49,8 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,\r\n \t.dev_stop             = enetc_dev_stop,\r\n \t.dev_close            = enetc_dev_close,\r\n \t.link_update          = enetc_link_update,\r\n+\t.stats_get            = enetc_stats_get,\r\n+\t.stats_reset          = enetc_stats_reset,\r\n \t.dev_infos_get        = enetc_dev_infos_get,\r\n \t.rx_queue_setup       = enetc_rx_queue_setup,\r\n \t.rx_queue_release     = enetc_rx_queue_release,\r\n@@ -608,6 +613,42 @@ static int enetc_tx_queue_setup(struct rte_eth_dev *dev, uint16_t tx_queue_id,\r\n \trte_free(rx_ring);\r\n }\r\n \r\n+static\r\n+int enetc_stats_get(struct rte_eth_dev *dev,\r\n+\t\t    struct rte_eth_stats *stats)\r\n+{\r\n+\tstruct enetc_eth_hw *hw =\r\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n+\r\n+\t/* Total received packets, bad + good, if we want to get counters of\r\n+\t * only good received packets then use ENETC_PM0_RFRM,\r\n+\t * ENETC_PM0_TFRM registers.\r\n+\t */\r\n+\tstats->ipackets = enetc_port_rd(enetc_hw, ENETC_PM0_RPKT);\r\n+\tstats->opackets = enetc_port_rd(enetc_hw, ENETC_PM0_TPKT);\r\n+\tstats->ibytes =  enetc_port_rd(enetc_hw, ENETC_PM0_REOCT);\r\n+\tstats->obytes = enetc_port_rd(enetc_hw, ENETC_PM0_TEOCT);\r\n+\t/* Dropped + Truncated packets, use ENETC_PM0_RDRNTP for without\r\n+\t * truncated packets\r\n+\t */\r\n+\tstats->imissed = enetc_port_rd(enetc_hw, ENETC_PM0_RDRP);\r\n+\tstats->ierrors = enetc_port_rd(enetc_hw, ENETC_PM0_RERR);\r\n+\tstats->oerrors = enetc_port_rd(enetc_hw, ENETC_PM0_TERR);\r\n+\r\n+\treturn 0;\r\n+}\r\n+\r\n+static void\r\n+enetc_stats_reset(struct rte_eth_dev *dev)\r\n+{\r\n+\tstruct enetc_eth_hw *hw =\r\n+\t\tENETC_DEV_PRIVATE_TO_HW(dev->data->dev_private);\r\n+\tstruct enetc_hw *enetc_hw = &hw->hw;\r\n+\r\n+\tenetc_port_wr(enetc_hw, ENETC_PM0_STAT_CONFIG, ENETC_CLEAR_STATS);\r\n+}\r\n+\r\n static int\r\n enetc_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,\r\n \t\t\t   struct rte_pci_device *pci_dev)\r\n",
    "prefixes": [
        "v3",
        "05/13"
    ]
}