get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54921,
    "url": "http://patches.dpdk.org/api/patches/54921/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20190618161636.23748-4-stephen@networkplumber.org/",
    "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": "<20190618161636.23748-4-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190618161636.23748-4-stephen@networkplumber.org",
    "date": "2019-06-18T16:16:31",
    "name": "[v3,3/8] kni: don't keep stats in kni_net",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "572d3357da1370fdc855e8ab2112a6837f4c29a2",
    "submitter": {
        "id": 27,
        "url": "http://patches.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": null,
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20190618161636.23748-4-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 5063,
            "url": "http://patches.dpdk.org/api/series/5063/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=5063",
            "date": "2019-06-18T16:16:28",
            "name": "kni: fixes and cleanups",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/5063/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/54921/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/54921/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "MIME-Version": "1.0",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "X-Google-Smtp-Source": "APXvYqza9qXI/z86zXGGAA9bGxvArJJ2EmR7lK7l/fqv1eaBI3ZeNJoUjwHbSIqOfPnwejsI6n2MpQ==",
        "References": "<20190610175155.21374-1-stephen@networkplumber.org>\n\t<20190618161636.23748-1-stephen@networkplumber.org>",
        "In-Reply-To": "<20190618161636.23748-1-stephen@networkplumber.org>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "X-Mailer": "git-send-email 2.20.1",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=networkplumber-org.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references\n\t:mime-version:content-transfer-encoding;\n\tbh=CZA5zLe4tbSwvOo2ZG+jag13FB9U46jQ6ezncJjNY/o=;\n\tb=hKHbbTVPOI7KfPe7DtgA7VXCB7sF9TYeIJZDjpGw+hmpINzeXvaRA+2D+gRqBnH6Ci\n\t7FkzOEH4ajKmpy3UJoBAYf2jR4cSXB8KtTqrfgjyM4Nqkp1sTB0NESWvXX+pmrf6Rh81\n\tg6ov2JzxkObC0octuH28aZZXPMl4MINk1NM/OLdlo4d5O1zMzKgqhCSiFd0CXvkU2s97\n\tRKA+Hl5Faj1U6LNHlbeHYhlQJnt5exrSx+TT8Zu5S88WYb4YV1UqX660dNXjeCrnDXtE\n\tg/echeOd0Fmo7oV+bG4C//1In+uRwbeUzEMhN0ht89y5qJCxYjelr9Gh0rScIOIR6198\n\tLWMw==",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id CE6021C22E;\n\tTue, 18 Jun 2019 18:16:54 +0200 (CEST)",
            "from mail-pf1-f195.google.com (mail-pf1-f195.google.com\n\t[209.85.210.195]) by dpdk.org (Postfix) with ESMTP id 060231C216\n\tfor <dev@dpdk.org>; Tue, 18 Jun 2019 18:16:49 +0200 (CEST)",
            "by mail-pf1-f195.google.com with SMTP id c85so7955559pfc.1\n\tfor <dev@dpdk.org>; Tue, 18 Jun 2019 09:16:48 -0700 (PDT)",
            "from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127])\n\tby smtp.gmail.com with ESMTPSA id\n\t3sm15485385pfp.114.2019.06.18.09.16.46\n\t(version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256);\n\tTue, 18 Jun 2019 09:16:47 -0700 (PDT)"
        ],
        "X-Original-To": "patchwork@dpdk.org",
        "X-Received": "by 2002:a62:754d:: with SMTP id\n\tq74mr95964610pfc.211.1560874607862; \n\tTue, 18 Jun 2019 09:16:47 -0700 (PDT)",
        "List-Post": "<mailto:dev@dpdk.org>",
        "X-Gm-Message-State": "APjAAAXMjyfjwCGkVfPzPr/ANeiC/ZtU8kbfMSw/d1x8KzZqcZKNU2hR\n\tnAa6rBiNOwTpN+mHNjzPjZI8itsQU7g=",
        "Content-Transfer-Encoding": "8bit",
        "X-BeenThere": "dev@dpdk.org",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "Errors-To": "dev-bounces@dpdk.org",
        "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:mime-version:content-transfer-encoding;\n\tbh=CZA5zLe4tbSwvOo2ZG+jag13FB9U46jQ6ezncJjNY/o=;\n\tb=TC73K/6l7ChHedUY0PtEii8f6iuHpXyXCr4MCGt79xB3Dvmpkyzsi+1NCP0CTS78MV\n\tn6oHLTbkJ12OSZ2NvuQzjpPk82NElARJJwADSvSoZhgFapl7smkP/JSeU67wXyshhztE\n\tFGaCOhGfD0u+sZVHZRQdedahz0Hzj9b1e1Kg/h3qGJag8ACoaBl0qNUizMwztZp/XvBi\n\tNle9y/UlnAChuce0eMMPR9WQfwN4hquieWXKrPAZpTZ1umZcsu89uygNghupopaZBsf7\n\tlph61fwGQAg/X7aCvM1syxq0OOFCpx7x0YTrwHpY6hFkbPQJPMgUc4Uxpmza+5zkqQEm\n\tZ+aw==",
        "Subject": "[dpdk-dev] [PATCH v3 3/8] kni: don't keep stats in kni_net",
        "Date": "Tue, 18 Jun 2019 09:16:31 -0700",
        "Message-Id": "<20190618161636.23748-4-stephen@networkplumber.org>",
        "Precedence": "list",
        "X-Mailman-Version": "2.1.15",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>"
    },
    "content": "Since kernel 2.6.28 the network subsystem has provided\ndev->stats for devices to use statistics handling and is the\ndefault if no ndo_get_stats is provided.\n\nThis allow allows for 64 bit (rather than just 32 bit)\nstatistics with KNI.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n kernel/linux/kni/kni_dev.h |  1 -\n kernel/linux/kni/kni_net.c | 43 +++++++++++++-------------------------\n 2 files changed, 15 insertions(+), 29 deletions(-)",
    "diff": "diff --git a/kernel/linux/kni/kni_dev.h b/kernel/linux/kni/kni_dev.h\nindex d57bce647e4a..21e4b0d92368 100644\n--- a/kernel/linux/kni/kni_dev.h\n+++ b/kernel/linux/kni/kni_dev.h\n@@ -39,7 +39,6 @@ struct kni_dev {\n \t/* kni list */\n \tstruct list_head list;\n \n-\tstruct net_device_stats stats;\n \tint status;\n \tuint16_t group_id;           /* Group ID of a group of KNI devices */\n \tuint32_t core_id;            /* Core ID to bind */\ndiff --git a/kernel/linux/kni/kni_net.c b/kernel/linux/kni/kni_net.c\nindex cce5e7eb991f..06310fec57bb 100644\n--- a/kernel/linux/kni/kni_net.c\n+++ b/kernel/linux/kni/kni_net.c\n@@ -291,15 +291,15 @@ kni_net_tx(struct sk_buff *skb, struct net_device *dev)\n \n \t/* Free skb and update statistics */\n \tdev_kfree_skb(skb);\n-\tkni->stats.tx_bytes += len;\n-\tkni->stats.tx_packets++;\n+\tdev->stats.tx_bytes += len;\n+\tdev->stats.tx_packets++;\n \n \treturn NETDEV_TX_OK;\n \n drop:\n \t/* Free skb and update statistics */\n \tdev_kfree_skb(skb);\n-\tkni->stats.tx_dropped++;\n+\tdev->stats.tx_dropped++;\n \n \treturn NETDEV_TX_OK;\n }\n@@ -343,7 +343,7 @@ kni_net_rx_normal(struct kni_dev *kni)\n \t\tskb = netdev_alloc_skb(dev, len);\n \t\tif (!skb) {\n \t\t\t/* Update statistics */\n-\t\t\tkni->stats.rx_dropped++;\n+\t\t\tdev->stats.rx_dropped++;\n \t\t\tcontinue;\n \t\t}\n \n@@ -372,8 +372,8 @@ kni_net_rx_normal(struct kni_dev *kni)\n \t\tnetif_rx_ni(skb);\n \n \t\t/* Update statistics */\n-\t\tkni->stats.rx_bytes += len;\n-\t\tkni->stats.rx_packets++;\n+\t\tdev->stats.rx_bytes += len;\n+\t\tdev->stats.rx_packets++;\n \t}\n \n \t/* Burst enqueue mbufs into free_q */\n@@ -396,6 +396,7 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)\n \tvoid *data_kva;\n \tstruct rte_kni_mbuf *alloc_kva;\n \tvoid *alloc_data_kva;\n+\tstruct net_device *dev = kni->net_dev;\n \n \t/* Get the number of entries in rx_q */\n \tnum_rq = kni_fifo_count(kni->rx_q);\n@@ -443,8 +444,8 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)\n \t\t\talloc_kva->pkt_len = len;\n \t\t\talloc_kva->data_len = len;\n \n-\t\t\tkni->stats.tx_bytes += len;\n-\t\t\tkni->stats.rx_bytes += len;\n+\t\t\tdev->stats.tx_bytes += len;\n+\t\t\tdev->stats.rx_bytes += len;\n \t\t}\n \n \t\t/* Burst enqueue mbufs into tx_q */\n@@ -464,8 +465,8 @@ kni_net_rx_lo_fifo(struct kni_dev *kni)\n \t * Update statistic, and enqueue/dequeue failure is impossible,\n \t * as all queues are checked at first.\n \t */\n-\tkni->stats.tx_packets += num;\n-\tkni->stats.rx_packets += num;\n+\tdev->stats.tx_packets += num;\n+\tdev->stats.rx_packets += num;\n }\n \n /*\n@@ -518,7 +519,7 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni)\n \t\t/* Simulate real usage, allocate/copy skb twice */\n \t\tskb = netdev_alloc_skb(dev, len);\n \t\tif (skb == NULL) {\n-\t\t\tkni->stats.rx_dropped++;\n+\t\t\tdev->stats.rx_dropped++;\n \t\t\tcontinue;\n \t\t}\n \n@@ -542,8 +543,8 @@ kni_net_rx_lo_fifo_skb(struct kni_dev *kni)\n \n \t\tskb->ip_summed = CHECKSUM_UNNECESSARY;\n \n-\t\tkni->stats.rx_bytes += len;\n-\t\tkni->stats.rx_packets++;\n+\t\tdev->stats.rx_bytes += len;\n+\t\tdev->stats.rx_packets++;\n \n \t\t/* call tx interface */\n \t\tkni_net_tx(skb, dev);\n@@ -573,12 +574,10 @@ kni_net_rx(struct kni_dev *kni)\n static void\n kni_net_tx_timeout(struct net_device *dev)\n {\n-\tstruct kni_dev *kni = netdev_priv(dev);\n-\n \tpr_debug(\"Transmit timeout at %ld, latency %ld\\n\", jiffies,\n \t\t\tjiffies - dev_trans_start(dev));\n \n-\tkni->stats.tx_errors++;\n+\tdev->stats.tx_errors++;\n \tnetif_wake_queue(dev);\n }\n \n@@ -627,17 +626,6 @@ kni_net_poll_resp(struct kni_dev *kni)\n \t\twake_up_interruptible(&kni->wq);\n }\n \n-/*\n- * Return statistics to the caller\n- */\n-static struct net_device_stats *\n-kni_net_stats(struct net_device *dev)\n-{\n-\tstruct kni_dev *kni = netdev_priv(dev);\n-\n-\treturn &kni->stats;\n-}\n-\n /*\n  *  Fill the eth header\n  */\n@@ -730,7 +718,6 @@ static const struct net_device_ops kni_net_netdev_ops = {\n \t.ndo_change_rx_flags = kni_net_set_promiscusity,\n \t.ndo_start_xmit = kni_net_tx,\n \t.ndo_change_mtu = kni_net_change_mtu,\n-\t.ndo_get_stats = kni_net_stats,\n \t.ndo_tx_timeout = kni_net_tx_timeout,\n \t.ndo_set_mac_address = kni_net_set_mac,\n #ifdef HAVE_CHANGE_CARRIER_CB\n",
    "prefixes": [
        "v3",
        "3/8"
    ]
}