get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 28515,
    "url": "https://patches.dpdk.org/api/patches/28515/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20170908145055.50280-2-xuemingl@mellanox.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": "<20170908145055.50280-2-xuemingl@mellanox.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20170908145055.50280-2-xuemingl@mellanox.com",
    "date": "2017-09-08T14:50:55",
    "name": "[dpdk-dev,v2,2/2] eal/malloc: fix RTE malloc element free",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "5be6684e35612f9130e0b368ba303e710eb2b16e",
    "submitter": {
        "id": 814,
        "url": "https://patches.dpdk.org/api/people/814/?format=api",
        "name": "Xueming Li",
        "email": "xuemingl@mellanox.com"
    },
    "delegate": null,
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20170908145055.50280-2-xuemingl@mellanox.com/mbox/",
    "series": [],
    "comments": "https://patches.dpdk.org/api/patches/28515/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/28515/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 D4E77199BE;\n\tFri,  8 Sep 2017 16:51:56 +0200 (CEST)",
            "from mellanox.co.il (mail-il-dmz.mellanox.com [193.47.165.129])\n\tby dpdk.org (Postfix) with ESMTP id D2889199AB\n\tfor <dev@dpdk.org>; Fri,  8 Sep 2017 16:51:55 +0200 (CEST)",
            "from Internal Mail-Server by MTLPINE1 (envelope-from\n\txuemingl@mellanox.com)\n\twith ESMTPS (AES256-SHA encrypted); 8 Sep 2017 17:51:54 +0300",
            "from dev-r630-06.mtbc.labs.mlnx (dev-r630-06.mtbc.labs.mlnx\n\t[10.12.205.180])\n\tby labmailer.mlnx (8.13.8/8.13.8) with ESMTP id v88Epr2r031704;\n\tFri, 8 Sep 2017 17:51:54 +0300",
            "from dev-r630-06.mtbc.labs.mlnx (localhost [127.0.0.1])\n\tby dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7) with ESMTP id\n\tv88Eprcl050350; Fri, 8 Sep 2017 22:51:53 +0800",
            "(from xuemingl@localhost)\n\tby dev-r630-06.mtbc.labs.mlnx (8.14.7/8.14.7/Submit) id\n\tv88Epr4V050349; Fri, 8 Sep 2017 22:51:53 +0800"
        ],
        "From": "Xueming Li <xuemingl@mellanox.com>",
        "To": "Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>",
        "Cc": "dev@dpdk.org, Xueming Li <xuemingl@mellanox.com>",
        "Date": "Fri,  8 Sep 2017 22:50:55 +0800",
        "Message-Id": "<20170908145055.50280-2-xuemingl@mellanox.com>",
        "X-Mailer": "git-send-email 2.13.3",
        "In-Reply-To": "<20170908145055.50280-1-xuemingl@mellanox.com>",
        "References": "<20170823022926.169272-1-xuemingl@mellanox.com>\n\t<20170908145055.50280-1-xuemingl@mellanox.com>",
        "Subject": "[dpdk-dev] [PATCH v2 2/2] eal/malloc: fix RTE malloc element free",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <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": "malloc_elem_free() is clearing(setting to 0) the trailer cookie when\nRTE_MALLOC_DEBUG is enabled. In case of joining free neighbor element,\npart of joined memory is not getting cleared due to missing the length\nof trailer cookie in the middle.\n\nThis patch fixes calculation of free memory length to be cleared in\nmalloc_elem_free() by including trailer cookie.\n\nFixes: af75078fece3 (\"first public release\")\n\nCc: Sergio Gonzalez Monroy <sergio.gonzalez.monroy@intel.com>\nSigned-off-by: Xueming Li <xuemingl@mellanox.com>\n---\n lib/librte_eal/common/malloc_elem.c | 8 ++++----\n 1 file changed, 4 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/lib/librte_eal/common/malloc_elem.c b/lib/librte_eal/common/malloc_elem.c\nindex 150769057..889dffd21 100644\n--- a/lib/librte_eal/common/malloc_elem.c\n+++ b/lib/librte_eal/common/malloc_elem.c\n@@ -275,14 +275,14 @@ malloc_elem_free(struct malloc_elem *elem)\n \t\treturn -1;\n \n \trte_spinlock_lock(&(elem->heap->lock));\n-\tsize_t sz = elem->size - sizeof(*elem);\n+\tsize_t sz = elem->size - sizeof(*elem) - MALLOC_ELEM_TRAILER_LEN;\n \tuint8_t *ptr = (uint8_t *)&elem[1];\n \tstruct malloc_elem *next = RTE_PTR_ADD(elem, elem->size);\n \tif (next->state == ELEM_FREE){\n \t\t/* remove from free list, join to this one */\n \t\telem_free_list_remove(next);\n \t\tjoin_elem(elem, next);\n-\t\tsz += sizeof(*elem);\n+\t\tsz += (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);\n \t}\n \n \t/* check if previous element is free, if so join with it and return,\n@@ -291,8 +291,8 @@ malloc_elem_free(struct malloc_elem *elem)\n \tif (elem->prev != NULL && elem->prev->state == ELEM_FREE) {\n \t\telem_free_list_remove(elem->prev);\n \t\tjoin_elem(elem->prev, elem);\n-\t\tsz += sizeof(*elem);\n-\t\tptr -= sizeof(*elem);\n+\t\tsz += (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);\n+\t\tptr -= (sizeof(*elem) + MALLOC_ELEM_TRAILER_LEN);\n \t\telem = elem->prev;\n \t}\n \tmalloc_elem_free_list_insert(elem);\n",
    "prefixes": [
        "dpdk-dev",
        "v2",
        "2/2"
    ]
}