get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 5603,
    "url": "https://patches.dpdk.org/api/patches/5603/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1434730599-24339-3-git-send-email-olivier.matz@6wind.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": "<1434730599-24339-3-git-send-email-olivier.matz@6wind.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1434730599-24339-3-git-send-email-olivier.matz@6wind.com",
    "date": "2015-06-19T16:16:38",
    "name": "[dpdk-dev,v2,2/3] mempool: introduce objtlr structure for object trailers",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "439c5f3c3af232cefaf375d3565deaa7e9323002",
    "submitter": {
        "id": 8,
        "url": "https://patches.dpdk.org/api/people/8/?format=api",
        "name": "Olivier Matz",
        "email": "olivier.matz@6wind.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1434730599-24339-3-git-send-email-olivier.matz@6wind.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/5603/comments/",
    "check": "pending",
    "checks": "https://patches.dpdk.org/api/patches/5603/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 14F7FC526;\n\tFri, 19 Jun 2015 18:17:02 +0200 (CEST)",
            "from mail-wi0-f179.google.com (mail-wi0-f179.google.com\n\t[209.85.212.179]) by dpdk.org (Postfix) with ESMTP id 96300C46C\n\tfor <dev@dpdk.org>; Fri, 19 Jun 2015 18:16:54 +0200 (CEST)",
            "by wicnd19 with SMTP id nd19so23693812wic.1\n\tfor <dev@dpdk.org>; Fri, 19 Jun 2015 09:16:54 -0700 (PDT)",
            "from glumotte.dev.6wind.com (6wind.net2.nerim.net.\n\t[213.41.151.210]) by mx.google.com with ESMTPSA id\n\tef10sm17739604wjd.49.2015.06.19.09.16.53\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128);\n\tFri, 19 Jun 2015 09:16:54 -0700 (PDT)"
        ],
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20130820;\n\th=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to\n\t:references;\n\tbh=0eoVLvO3oq1snEXKkRuDlJ9hBThywBJlnEzGbLzOahw=;\n\tb=S5Ptisr3FItG1Cz26hWrKKrGuGCIkMR5GZnndSeC3N3E6jOpTQRPB59f6Kyl75Yj4t\n\tySeH/wCZFwjciF2PfIYkofvDEiIjxNLP9jjFL639hgunBiZ/Y9Bj6X/QQMrv2yuRlul2\n\tf4l2lpDpmfVXLz2O7Wc0zZ6PJ58c4CZJ7r924L1p8FFNDgg6JpyUibj71xQQT3OON1M9\n\t2pIQc30OAMXAs5xAtizWTdkCSSEamx4Jn6iWVVBjQtUkNeCWGnqAAOa+8hECwWAPzT8W\n\tWgm+aic+owGoN/4aYqeo09yigeFPviVzxg72RNE/3JyVH5kODS15kVLl+daIvIzJp2HM\n\tu3zw==",
        "X-Gm-Message-State": "ALoCoQk8vhtDuxppt8e3EnNPGYHAxIvdDyvCLbwea63IiHwe+H3UQot5jhKqlXcUS2r93DHjwgL5",
        "X-Received": "by 10.180.106.195 with SMTP id gw3mr8124972wib.25.1434730614514; \n\tFri, 19 Jun 2015 09:16:54 -0700 (PDT)",
        "From": "Olivier Matz <olivier.matz@6wind.com>",
        "To": "dev@dpdk.org",
        "Date": "Fri, 19 Jun 2015 18:16:38 +0200",
        "Message-Id": "<1434730599-24339-3-git-send-email-olivier.matz@6wind.com>",
        "X-Mailer": "git-send-email 2.1.4",
        "In-Reply-To": "<1434730599-24339-1-git-send-email-olivier.matz@6wind.com>",
        "References": "<1433150143-5842-1-git-send-email-olivier.matz@6wind.com>\n\t<1434730599-24339-1-git-send-email-olivier.matz@6wind.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/3] mempool: introduce objtlr structure for\n\tobject trailers",
        "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": "Each object stored in mempools are suffixed by a trailer, storing\na cookie in debug mode which help to detect memory corruptions.\n\nLike for headers, introduce a structure that materializes the content of\nthis trailer.\n\nSigned-off-by: Olivier Matz <olivier.matz@6wind.com>\n---\n lib/librte_mempool/rte_mempool.c |  4 +++-\n lib/librte_mempool/rte_mempool.h | 42 +++++++++++++++++++++-------------------\n 2 files changed, 25 insertions(+), 21 deletions(-)",
    "diff": "diff --git a/lib/librte_mempool/rte_mempool.c b/lib/librte_mempool/rte_mempool.c\nindex b2d8700..60369cf 100644\n--- a/lib/librte_mempool/rte_mempool.c\n+++ b/lib/librte_mempool/rte_mempool.c\n@@ -131,6 +131,7 @@ mempool_add_elem(struct rte_mempool *mp, void *obj, uint32_t obj_idx,\n \trte_mempool_obj_ctor_t *obj_init, void *obj_init_arg)\n {\n \tstruct rte_mempool_objhdr *hdr;\n+\tstruct rte_mempool_objtlr *tlr __rte_unused;\n \n \tobj = (char *)obj + mp->header_size;\n \n@@ -140,7 +141,8 @@ mempool_add_elem(struct rte_mempool *mp, void *obj, uint32_t obj_idx,\n \n #ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n \thdr->cookie = RTE_MEMPOOL_HEADER_COOKIE2;\n-\t__mempool_write_trailer_cookie(obj);\n+\ttlr = __mempool_get_trailer(obj);\n+\ttlr->cookie = RTE_MEMPOOL_TRAILER_COOKIE;\n #endif\n \t/* call the initializer */\n \tif (obj_init)\ndiff --git a/lib/librte_mempool/rte_mempool.h b/lib/librte_mempool/rte_mempool.h\nindex b047810..ec1bb2e 100644\n--- a/lib/librte_mempool/rte_mempool.h\n+++ b/lib/librte_mempool/rte_mempool.h\n@@ -155,6 +155,18 @@ struct rte_mempool_objhdr {\n };\n \n /**\n+ * Mempool object trailer structure\n+ *\n+ * In debug mode, each object stored in mempools are suffixed by this\n+ * trailer structure containing a cookie preventing memory corruptions.\n+ */\n+struct rte_mempool_objtlr {\n+#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n+\tuint64_t cookie;                 /**< Debug cookie. */\n+#endif\n+};\n+\n+/**\n  * The RTE mempool structure.\n  */\n struct rte_mempool {\n@@ -249,6 +261,13 @@ static inline struct rte_mempool_objhdr *__mempool_get_header(void *obj)\n \t\tsizeof(struct rte_mempool_objhdr));\n }\n \n+/* return the trailer of a mempool object (internal) */\n+static inline struct rte_mempool_objtlr *__mempool_get_trailer(void *obj)\n+{\n+\treturn (struct rte_mempool_objtlr *)((char *)obj -\n+\t\tsizeof(struct rte_mempool_objtlr));\n+}\n+\n /**\n  * Return a pointer to the mempool owning this object.\n  *\n@@ -264,25 +283,6 @@ static inline struct rte_mempool *rte_mempool_from_obj(void *obj)\n \treturn hdr->mp;\n }\n \n-#ifdef RTE_LIBRTE_MEMPOOL_DEBUG\n-/* get trailer cookie value */\n-static inline uint64_t __mempool_read_trailer_cookie(void *obj)\n-{\n-\tstruct rte_mempool *mp = rte_mempool_from_obj(obj);\n-\treturn *(uint64_t *)((char *)obj + mp->elt_size);\n-\n-}\n-\n-/* write trailer cookie value */\n-static inline void __mempool_write_trailer_cookie(void *obj)\n-{\n-\tuint64_t *cookie_p;\n-\tstruct rte_mempool *mp = rte_mempool_from_obj(obj);\n-\tcookie_p = (uint64_t *)((char *)obj + mp->elt_size);\n-\t*cookie_p = RTE_MEMPOOL_TRAILER_COOKIE;\n-}\n-#endif /* RTE_LIBRTE_MEMPOOL_DEBUG */\n-\n /**\n  * @internal Check and update cookies or panic.\n  *\n@@ -306,6 +306,7 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp,\n \t\t\t\t\t   unsigned n, int free)\n {\n \tstruct rte_mempool_objhdr *hdr;\n+\tstruct rte_mempool_objtlr *tlr;\n \tuint64_t cookie;\n \tvoid *tmp;\n \tvoid *obj;\n@@ -356,7 +357,8 @@ static inline void __mempool_check_cookies(const struct rte_mempool *mp,\n \t\t\t\trte_panic(\"MEMPOOL: bad header cookie (audit)\\n\");\n \t\t\t}\n \t\t}\n-\t\tcookie = __mempool_read_trailer_cookie(obj);\n+\t\ttlr = __mempool_get_trailer(obj);\n+\t\tcookie = tlr->cookie;\n \t\tif (cookie != RTE_MEMPOOL_TRAILER_COOKIE) {\n \t\t\trte_log_set_history(0);\n \t\t\tRTE_LOG(CRIT, MEMPOOL,\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/3"
    ]
}