get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125753,
    "url": "http://patches.dpdk.org/api/patches/125753/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230404124840.1898-2-david.marchand@redhat.com/",
    "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": "<20230404124840.1898-2-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230404124840.1898-2-david.marchand@redhat.com",
    "date": "2023-04-04T12:48:25",
    "name": "[v3,01/16] malloc: rework heap destroy",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "23f8d47d0989917952a948d155521c40aaf6c000",
    "submitter": {
        "id": 1173,
        "url": "http://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230404124840.1898-2-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 27617,
            "url": "http://patches.dpdk.org/api/series/27617/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27617",
            "date": "2023-04-04T12:48:24",
            "name": "Enable lock annotations on most libraries and drivers",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/27617/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125753/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/125753/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 5E459428CD;\n\tTue,  4 Apr 2023 14:49:01 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4FC7041153;\n\tTue,  4 Apr 2023 14:49:01 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.133.124])\n by mails.dpdk.org (Postfix) with ESMTP id F1E7740A7E\n for <dev@dpdk.org>; Tue,  4 Apr 2023 14:48:59 +0200 (CEST)",
            "from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com\n [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS\n (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id\n us-mta-550-Pnbpgy5PNruxm9GgEJhgzA-1; Tue, 04 Apr 2023 08:48:56 -0400",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com\n [10.11.54.4])\n (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CE268101A54F;\n Tue,  4 Apr 2023 12:48:55 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.225.38])\n by smtp.corp.redhat.com (Postfix) with ESMTP id 183722027061;\n Tue,  4 Apr 2023 12:48:54 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1680612539;\n h=from:from:reply-to:subject:subject:date:date:message-id:message-id:\n to:to:cc:cc:mime-version:mime-version:content-type:content-type:\n content-transfer-encoding:content-transfer-encoding:\n in-reply-to:in-reply-to:references:references;\n bh=EhaIhl6hmC2b4yZVgLXGE3K/rq2mYCRoyh2/amsVFZQ=;\n b=DGxj+jjM4Tv+my6BI2AsbUysNdJf+F8RnbSjSepG+JXh9UNL3AbX08kFl8Gfwy633+VAk0\n ik2RHhYs9559Rta9fbYEEeggsuy5r5hORdinBfR72zTp3FTAeDvwuMl0enYV+2+RhP9CAm\n BBODwxCWlsVOfQwPYov5pXVxxpCgMlw=",
        "X-MC-Unique": "Pnbpgy5PNruxm9GgEJhgzA-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "thomas@monjalon.net,\n\tAnatoly Burakov <anatoly.burakov@intel.com>",
        "Subject": "[PATCH v3 01/16] malloc: rework heap destroy",
        "Date": "Tue,  4 Apr 2023 14:48:25 +0200",
        "Message-Id": "<20230404124840.1898-2-david.marchand@redhat.com>",
        "In-Reply-To": "<20230404124840.1898-1-david.marchand@redhat.com>",
        "References": "<20230224081642.2566619-1-david.marchand@redhat.com>\n <20230404124840.1898-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.1 on 10.11.54.4",
        "X-Mimecast-Spam-Score": "0",
        "X-Mimecast-Originator": "redhat.com",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain; charset=\"US-ASCII\"; x-default=true",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org"
    },
    "content": "The destroy helper has been reworked to zero all the heap object but\nleave the lock untouched. The heap lock is then released through the\nstandard API.\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChanges since v2:\n- shrinked the change to the required part,\n\n---\n lib/eal/common/malloc_heap.c | 6 ++++--\n lib/eal/common/rte_malloc.c  | 5 +----\n 2 files changed, 5 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c\nindex d7c410b786..d3c474d79c 100644\n--- a/lib/eal/common/malloc_heap.c\n+++ b/lib/eal/common/malloc_heap.c\n@@ -1385,8 +1385,10 @@ malloc_heap_destroy(struct malloc_heap *heap)\n \tif (heap->total_size != 0)\n \t\tRTE_LOG(ERR, EAL, \"Total size not zero, heap is likely corrupt\\n\");\n \n-\t/* after this, the lock will be dropped */\n-\tmemset(heap, 0, sizeof(*heap));\n+\t/* Reset all of the heap but the (hold) lock so caller can release it. */\n+\tRTE_BUILD_BUG_ON(offsetof(struct malloc_heap, lock) != 0);\n+\tmemset(RTE_PTR_ADD(heap, sizeof(heap->lock)), 0,\n+\t\tsizeof(*heap) - sizeof(heap->lock));\n \n \treturn 0;\n }\ndiff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c\nindex d39870bf3c..ebafef3f6c 100644\n--- a/lib/eal/common/rte_malloc.c\n+++ b/lib/eal/common/rte_malloc.c\n@@ -657,10 +657,7 @@ rte_malloc_heap_destroy(const char *heap_name)\n \t/* sanity checks done, now we can destroy the heap */\n \trte_spinlock_lock(&heap->lock);\n \tret = malloc_heap_destroy(heap);\n-\n-\t/* if we failed, lock is still active */\n-\tif (ret < 0)\n-\t\trte_spinlock_unlock(&heap->lock);\n+\trte_spinlock_unlock(&heap->lock);\n unlock:\n \trte_mcfg_mem_write_unlock();\n \n",
    "prefixes": [
        "v3",
        "01/16"
    ]
}