get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 816704,
    "url": "http://patchwork.ozlabs.org/api/patches/816704/?format=api",
    "web_url": "http://patchwork.ozlabs.org/project/netdev/patch/20170921064338.1282-3-jiri@resnulli.us/",
    "project": {
        "id": 7,
        "url": "http://patchwork.ozlabs.org/api/projects/7/?format=api",
        "name": "Linux network development",
        "link_name": "netdev",
        "list_id": "netdev.vger.kernel.org",
        "list_email": "netdev@vger.kernel.org",
        "web_url": null,
        "scm_url": null,
        "webscm_url": null,
        "list_archive_url": "",
        "list_archive_url_format": "",
        "commit_url_format": ""
    },
    "msgid": "<20170921064338.1282-3-jiri@resnulli.us>",
    "list_archive_url": null,
    "date": "2017-09-21T06:43:28",
    "name": "[net-next,02/12] ipmr: Add reference count to MFC entries",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "cb5c102104f5128ed2ce9a690912cec033571eae",
    "submitter": {
        "id": 15321,
        "url": "http://patchwork.ozlabs.org/api/people/15321/?format=api",
        "name": "Jiri Pirko",
        "email": "jiri@resnulli.us"
    },
    "delegate": {
        "id": 34,
        "url": "http://patchwork.ozlabs.org/api/users/34/?format=api",
        "username": "davem",
        "first_name": "David",
        "last_name": "Miller",
        "email": "davem@davemloft.net"
    },
    "mbox": "http://patchwork.ozlabs.org/project/netdev/patch/20170921064338.1282-3-jiri@resnulli.us/mbox/",
    "series": [
        {
            "id": 4309,
            "url": "http://patchwork.ozlabs.org/api/series/4309/?format=api",
            "web_url": "http://patchwork.ozlabs.org/project/netdev/list/?series=4309",
            "date": "2017-09-21T06:43:26",
            "name": "mlxsw: Add support for offloading IPv4 multicast routes",
            "version": 1,
            "mbox": "http://patchwork.ozlabs.org/series/4309/mbox/"
        }
    ],
    "comments": "http://patchwork.ozlabs.org/api/patches/816704/comments/",
    "check": "pending",
    "checks": "http://patchwork.ozlabs.org/api/patches/816704/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<netdev-owner@vger.kernel.org>",
        "X-Original-To": "patchwork-incoming@ozlabs.org",
        "Delivered-To": "patchwork-incoming@ozlabs.org",
        "Authentication-Results": [
            "ozlabs.org;\n\tspf=none (mailfrom) smtp.mailfrom=vger.kernel.org\n\t(client-ip=209.132.180.67; helo=vger.kernel.org;\n\tenvelope-from=netdev-owner@vger.kernel.org;\n\treceiver=<UNKNOWN>)",
            "ozlabs.org; dkim=pass (2048-bit key;\n\tunprotected) header.d=resnulli-us.20150623.gappssmtp.com\n\theader.i=@resnulli-us.20150623.gappssmtp.com\n\theader.b=\"zpePKmDq\"; dkim-atps=neutral"
        ],
        "Received": [
            "from vger.kernel.org (vger.kernel.org [209.132.180.67])\n\tby ozlabs.org (Postfix) with ESMTP id 3xyRv26PC4z9s7g\n\tfor <patchwork-incoming@ozlabs.org>;\n\tThu, 21 Sep 2017 16:45:18 +1000 (AEST)",
            "(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1751786AbdIUGpR (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tThu, 21 Sep 2017 02:45:17 -0400",
            "from mail-wr0-f196.google.com ([209.85.128.196]:38522 \"EHLO\n\tmail-wr0-f196.google.com\" rhost-flags-OK-OK-OK-OK) by vger.kernel.org\n\twith ESMTP id S1751894AbdIUGnm (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Thu, 21 Sep 2017 02:43:42 -0400",
            "by mail-wr0-f196.google.com with SMTP id p37so2579914wrb.5\n\tfor <netdev@vger.kernel.org>; Wed, 20 Sep 2017 23:43:41 -0700 (PDT)",
            "from localhost (ip-89-177-125-82.net.upcbroadband.cz.\n\t[89.177.125.82]) by smtp.gmail.com with ESMTPSA id\n\ty99sm3939216wmh.1.2017.09.20.23.43.40\n\t(version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256);\n\tWed, 20 Sep 2017 23:43:40 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=resnulli-us.20150623.gappssmtp.com; s=20150623;\n\th=from:to:cc:subject:date:message-id:in-reply-to:references;\n\tbh=To5ZgKZlwDWuC7W1nx7VGsQoRLCJ8HLN3A56pVAdvfs=;\n\tb=zpePKmDqHtq8wpthNKDpzQQG2w0F9J2ftwqLCXac9lngzBi7OfHJWid/g3zF9ggpYe\n\tK5Dl/3Kn9pELyc+bJgd/ceaGQ5ZxUKpR0bcx3fvvTOOvoqsKAJ9fL9sZhdonX945ZbJf\n\tHkmOeeKd4zpsLjrseWCcb6hFjZ9ClWMNLGskmdKDPmp9crK621YxAYOG6q31t3y329rh\n\tApcQCOqZCa01Y4oJnePMCZGnHbGS1seCX5r7PXs+n1HQDLCdH8E2Kt7OmB5frLuPtBCB\n\t+NusihBYznc8XZs1hYZ/iCsYKtyGrhbnzjFhKOH9IQsbVvEmfEiwZjUoOaaOWPhP51xz\n\tbseQ==",
        "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=To5ZgKZlwDWuC7W1nx7VGsQoRLCJ8HLN3A56pVAdvfs=;\n\tb=O69IBS/G2nnF9pQR9gQVF+T1sg1Nt+rDYffz4qfrGT3oQb/EO3DPRFndfPQVN9841H\n\tEDHwH2GayNcs3S1pMkpxsRMyPckdwieXTjXWlTMn8a2qivM42tJxJLJEKIltwmKsDXLx\n\tIQlx4gU1nPHUYNHDDisUNfG4keBA25rPBi6GwOc+VeL8nMy4zFM1sxQ8QqVcWwArDhPd\n\tXqp0v8mHBnSHI4ra2Q7yd5yJeXVXhecHPbDhlMB5UbsiJE4r/PVpSQSZPPOSsy4PPlxc\n\tY7us0oQigAUmTvSTPXgNnE1tHO0uRPnyuuWJCtfBbLMCU6X386jl0XjcQlAjEGezyjKN\n\tvfLQ==",
        "X-Gm-Message-State": "AHPjjUgpBrLG/irDQZ0Jaucngw3WThXwTATuJGHbjinn+Gx6oqWpElTY\n\taQrfArEs6DHGGIEnLHCxBt8gvsTm",
        "X-Google-Smtp-Source": "AOwi7QBdBUFyZTRS2jZcHg4VGQmki/QWn/wogXr7j1OI4XqQIE6KP7Kgj/qTJO2gVslvMO6bCFO1Pg==",
        "X-Received": "by 10.223.177.139 with SMTP id q11mr997522wra.269.1505976220626; \n\tWed, 20 Sep 2017 23:43:40 -0700 (PDT)",
        "From": "Jiri Pirko <jiri@resnulli.us>",
        "To": "netdev@vger.kernel.org",
        "Cc": "davem@davemloft.net, yotamg@mellanox.com, idosch@mellanox.com,\n\tmlxsw@mellanox.com",
        "Subject": "[patch net-next 02/12] ipmr: Add reference count to MFC entries",
        "Date": "Thu, 21 Sep 2017 08:43:28 +0200",
        "Message-Id": "<20170921064338.1282-3-jiri@resnulli.us>",
        "X-Mailer": "git-send-email 2.9.5",
        "In-Reply-To": "<20170921064338.1282-1-jiri@resnulli.us>",
        "References": "<20170921064338.1282-1-jiri@resnulli.us>",
        "Sender": "netdev-owner@vger.kernel.org",
        "Precedence": "bulk",
        "List-ID": "<netdev.vger.kernel.org>",
        "X-Mailing-List": "netdev@vger.kernel.org"
    },
    "content": "From: Yotam Gigi <yotamg@mellanox.com>\n\nNext commits will introduce MFC notifications through the atomic\nfib_notification chain, thus allowing modules to be aware of MFC entries.\n\nDue to the fact that modules may need to hold a reference to an MFC entry,\nadd reference count to MFC entries to prevent them from being freed while\nthese modules use them.\n\nThe reference counting is done only on resolved MFC entries currently.\n\nSigned-off-by: Yotam Gigi <yotamg@mellanox.com>\nReviewed-by: Ido Schimmel <idosch@mellanox.com>\nSigned-off-by: Jiri Pirko <jiri@mellanox.com>\n---\n include/linux/mroute.h | 20 ++++++++++++++++++++\n net/ipv4/ipmr.c        |  8 +++++---\n 2 files changed, 25 insertions(+), 3 deletions(-)",
    "diff": "diff --git a/include/linux/mroute.h b/include/linux/mroute.h\nindex d7f6333..2f88e3d 100644\n--- a/include/linux/mroute.h\n+++ b/include/linux/mroute.h\n@@ -138,6 +138,7 @@ struct mfc_cache {\n \t\t\tunsigned long wrong_if;\n \t\t\tunsigned long lastuse;\n \t\t\tunsigned char ttls[MAXVIFS];\n+\t\t\trefcount_t refcount;\n \t\t} res;\n \t} mfc_un;\n \tstruct list_head list;\n@@ -148,4 +149,23 @@ struct rtmsg;\n int ipmr_get_route(struct net *net, struct sk_buff *skb,\n \t\t   __be32 saddr, __be32 daddr,\n \t\t   struct rtmsg *rtm, u32 portid);\n+\n+#ifdef CONFIG_IP_MROUTE\n+void ipmr_cache_free(struct mfc_cache *mfc_cache);\n+#else\n+static inline void ipmr_cache_free(struct mfc_cache *mfc_cache)\n+{\n+}\n+#endif\n+\n+static inline void ipmr_cache_put(struct mfc_cache *c)\n+{\n+\tif (refcount_dec_and_test(&c->mfc_un.res.refcount))\n+\t\tipmr_cache_free(c);\n+}\n+static inline void ipmr_cache_hold(struct mfc_cache *c)\n+{\n+\trefcount_inc(&c->mfc_un.res.refcount);\n+}\n+\n #endif\ndiff --git a/net/ipv4/ipmr.c b/net/ipv4/ipmr.c\nindex c9b3e6e..86dc5f9 100644\n--- a/net/ipv4/ipmr.c\n+++ b/net/ipv4/ipmr.c\n@@ -652,10 +652,11 @@ static void ipmr_cache_free_rcu(struct rcu_head *head)\n \tkmem_cache_free(mrt_cachep, c);\n }\n \n-static inline void ipmr_cache_free(struct mfc_cache *c)\n+void ipmr_cache_free(struct mfc_cache *c)\n {\n \tcall_rcu(&c->rcu, ipmr_cache_free_rcu);\n }\n+EXPORT_SYMBOL(ipmr_cache_free);\n \n /* Destroy an unresolved cache entry, killing queued skbs\n  * and reporting error to netlink readers.\n@@ -949,6 +950,7 @@ static struct mfc_cache *ipmr_cache_alloc(void)\n \tif (c) {\n \t\tc->mfc_un.res.last_assert = jiffies - MFC_ASSERT_THRESH - 1;\n \t\tc->mfc_un.res.minvif = MAXVIFS;\n+\t\trefcount_set(&c->mfc_un.res.refcount, 1);\n \t}\n \treturn c;\n }\n@@ -1162,7 +1164,7 @@ static int ipmr_mfc_delete(struct mr_table *mrt, struct mfcctl *mfc, int parent)\n \trhltable_remove(&mrt->mfc_hash, &c->mnode, ipmr_rht_params);\n \tlist_del_rcu(&c->list);\n \tmroute_netlink_event(mrt, c, RTM_DELROUTE);\n-\tipmr_cache_free(c);\n+\tipmr_cache_put(c);\n \n \treturn 0;\n }\n@@ -1264,7 +1266,7 @@ static void mroute_clean_tables(struct mr_table *mrt, bool all)\n \t\trhltable_remove(&mrt->mfc_hash, &c->mnode, ipmr_rht_params);\n \t\tlist_del_rcu(&c->list);\n \t\tmroute_netlink_event(mrt, c, RTM_DELROUTE);\n-\t\tipmr_cache_free(c);\n+\t\tipmr_cache_put(c);\n \t}\n \n \tif (atomic_read(&mrt->cache_resolve_queue_len) != 0) {\n",
    "prefixes": [
        "net-next",
        "02/12"
    ]
}