get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 1215,
    "url": "https://patches.dpdk.org/api/patches/1215/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1415381511-43364-3-git-send-email-jyu@vmware.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": "<1415381511-43364-3-git-send-email-jyu@vmware.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1415381511-43364-3-git-send-email-jyu@vmware.com",
    "date": "2014-11-07T17:31:51",
    "name": "[dpdk-dev,2/2] rte_ethdev: add return status for rte_eth_stats_get",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "9a50c2aa571af8d5fccece625dc797f8d4e0d633",
    "submitter": {
        "id": 111,
        "url": "https://patches.dpdk.org/api/people/111/?format=api",
        "name": "Jia Yu",
        "email": "jyu@vmware.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1415381511-43364-3-git-send-email-jyu@vmware.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/1215/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/1215/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 31A947F51;\n\tSat,  8 Nov 2014 02:31:00 +0100 (CET)",
            "from smtp-outbound-1.vmware.com (smtp-outbound-1.vmware.com\n\t[208.91.2.12]) by dpdk.org (Postfix) with ESMTP id 133E57F48\n\tfor <dev@dpdk.org>; Sat,  8 Nov 2014 02:30:53 +0100 (CET)",
            "from sc9-mailhost2.vmware.com (sc9-mailhost2.vmware.com\n\t[10.113.161.72])\n\tby smtp-outbound-1.vmware.com (Postfix) with ESMTP id CC332281E8\n\tfor <dev@dpdk.org>; Fri,  7 Nov 2014 17:40:26 -0800 (PST)",
            "from prmh-edge-ivybridge-13.eng.vmware.com\n\t(prmh-edge-ivybridge-13.eng.vmware.com [10.24.235.96])\n\tby sc9-mailhost2.vmware.com (Postfix) with ESMTP id C8388B15E8;\n\tFri,  7 Nov 2014 17:40:26 -0800 (PST)"
        ],
        "From": "Jia Yu <jyu@vmware.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri,  7 Nov 2014 09:31:51 -0800",
        "Message-Id": "<1415381511-43364-3-git-send-email-jyu@vmware.com>",
        "X-Mailer": "git-send-email 1.9.1",
        "In-Reply-To": "<1415381511-43364-1-git-send-email-jyu@vmware.com>",
        "References": "<1415381511-43364-1-git-send-email-jyu@vmware.com>",
        "Subject": "[dpdk-dev] [PATCH 2/2] rte_ethdev: add return status for\n\trte_eth_stats_get",
        "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": "rte_eth_stats_get is to get physical device statistics. Without\nreturn status, caller does not know whether function fails or not\n(i.e. invalid port_id, driver has no stats_get callback). Caller\ncannot differiente normal 0 stats or error case. This fix adds\na return status to the function.\n\nSigned-off-by: Jia Yu <jyu@vmware.com>\n---\n lib/librte_ether/rte_ethdev.c | 7 ++++---\n lib/librte_ether/rte_ethdev.h | 4 +++-\n 2 files changed, 7 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_ether/rte_ethdev.c b/lib/librte_ether/rte_ethdev.c\nindex 6c01b02..4ec9ca6 100644\n--- a/lib/librte_ether/rte_ethdev.c\n+++ b/lib/librte_ether/rte_ethdev.c\n@@ -1226,21 +1226,22 @@ rte_eth_link_get_nowait(uint8_t port_id, struct rte_eth_link *eth_link)\n \t}\n }\n \n-void\n+int\n rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats)\n {\n \tstruct rte_eth_dev *dev;\n \n \tif (port_id >= nb_ports) {\n \t\tPMD_DEBUG_TRACE(\"Invalid port_id=%d\\n\", port_id);\n-\t\treturn;\n+\t\treturn (-ENODEV);\n \t}\n \tdev = &rte_eth_devices[port_id];\n \tmemset(stats, 0, sizeof(*stats));\n \n-\tFUNC_PTR_OR_RET(*dev->dev_ops->stats_get);\n+\tFUNC_PTR_OR_ERR_RET(*dev->dev_ops->stats_get, -ENOTSUP);\n \t(*dev->dev_ops->stats_get)(dev, stats);\n \tstats->rx_nombuf = dev->data->rx_mbuf_alloc_failed;\n+        return 0;\n }\n \n void\ndiff --git a/lib/librte_ether/rte_ethdev.h b/lib/librte_ether/rte_ethdev.h\nindex 8bf274d..e29e9be 100644\n--- a/lib/librte_ether/rte_ethdev.h\n+++ b/lib/librte_ether/rte_ethdev.h\n@@ -2054,8 +2054,10 @@ extern void rte_eth_link_get_nowait(uint8_t port_id,\n  *   - *obytes*   with the total of successfully transmitted bytes.\n  *   - *ierrors*  with the total of erroneous received packets.\n  *   - *oerrors*  with the total of failed transmitted packets.\n+ * @return\n+ *   Zero if successful. Non-zero otherwise.\n  */\n-extern void rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);\n+extern int rte_eth_stats_get(uint8_t port_id, struct rte_eth_stats *stats);\n \n /**\n  * Reset the general I/O statistics of an Ethernet device.\n",
    "prefixes": [
        "dpdk-dev",
        "2/2"
    ]
}