get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 140029,
    "url": "https://patches.dpdk.org/api/patches/140029/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20240513111204.3120460-1-david.marchand@redhat.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": "<20240513111204.3120460-1-david.marchand@redhat.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240513111204.3120460-1-david.marchand@redhat.com",
    "date": "2024-05-13T11:12:04",
    "name": "[v2] eal/unix: support ZSTD compression for firmware",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "0eca664154332cf49fe2b30b310062995b52938d",
    "submitter": {
        "id": 1173,
        "url": "https://patches.dpdk.org/api/people/1173/?format=api",
        "name": "David Marchand",
        "email": "david.marchand@redhat.com"
    },
    "delegate": {
        "id": 24651,
        "url": "https://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20240513111204.3120460-1-david.marchand@redhat.com/mbox/",
    "series": [
        {
            "id": 31912,
            "url": "https://patches.dpdk.org/api/series/31912/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=31912",
            "date": "2024-05-13T11:12:04",
            "name": "[v2] eal/unix: support ZSTD compression for firmware",
            "version": 2,
            "mbox": "https://patches.dpdk.org/series/31912/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/140029/comments/",
    "check": "success",
    "checks": "https://patches.dpdk.org/api/patches/140029/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 3FB0E44019;\n\tMon, 13 May 2024 13:12:15 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2A84C4028A;\n\tMon, 13 May 2024 13:12:15 +0200 (CEST)",
            "from us-smtp-delivery-124.mimecast.com\n (us-smtp-delivery-124.mimecast.com [170.10.129.124])\n by mails.dpdk.org (Postfix) with ESMTP id 953714003C\n for <dev@dpdk.org>; Mon, 13 May 2024 13:12:13 +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.3, cipher=TLS_AES_256_GCM_SHA384) id\n us-mta-589-DE9vFbdOMZqKEW32K59M9w-1; Mon, 13 May 2024 07:12:10 -0400",
            "from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com\n [10.11.54.4])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest\n SHA256)\n (No client certificate requested)\n by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A5D7B800994;\n Mon, 13 May 2024 11:12:09 +0000 (UTC)",
            "from dmarchan.redhat.com (unknown [10.45.225.120])\n by smtp.corp.redhat.com (Postfix) with ESMTP id BDAC12026D68;\n Mon, 13 May 2024 11:12:08 +0000 (UTC)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;\n s=mimecast20190719; t=1715598733;\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=lgEDKO+FFy0H+jTJuP7ss9dHxaVK6lOn8E0Y25zR3Jc=;\n b=M7X+/TjKpCYQapjqC5YzZIR3DQ+r53VqPQh1xlHSxOBwKXYSahTkDdLF1AaNzk5zKpFcNU\n DMHWQ91lRmrWMHoYDti9GlDVRXbNwY6zMMCilUMQG1TRFkUTZYrrPQdclXjVvWnmDrh0Qm\n gAIP9HX++VpRl5EgRm/5V1ceua11BBE=",
        "X-MC-Unique": "DE9vFbdOMZqKEW32K59M9w-1",
        "From": "David Marchand <david.marchand@redhat.com>",
        "To": "dev@dpdk.org",
        "Cc": "Yu Jiang <yux.jiang@intel.com>,\n Bruce Richardson <bruce.richardson@intel.com>, stable@dpdk.org",
        "Subject": "[PATCH v2] eal/unix: support ZSTD compression for firmware",
        "Date": "Mon, 13 May 2024 13:12:04 +0200",
        "Message-ID": "<20240513111204.3120460-1-david.marchand@redhat.com>",
        "In-Reply-To": "<20240508095214.2541115-1-david.marchand@redhat.com>",
        "References": "<20240508095214.2541115-1-david.marchand@redhat.com>",
        "MIME-Version": "1.0",
        "X-Scanned-By": "MIMEDefang 3.4.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": "Ubuntu 24.04 started to compress firmware files with ZSTD compression.\n\nBugzilla ID: 1437\nCc: stable@dpdk.org\n\nSigned-off-by: David Marchand <david.marchand@redhat.com>\n---\nChances since v1:\n- fixed link issue when libarchive is not available,\n- Cc'd stable@dpdk.org,\n\n---\n lib/eal/unix/eal_firmware.c | 24 ++++++++++++++++++------\n 1 file changed, 18 insertions(+), 6 deletions(-)",
    "diff": "diff --git a/lib/eal/unix/eal_firmware.c b/lib/eal/unix/eal_firmware.c\nindex 1d47e879c8..31de027598 100644\n--- a/lib/eal/unix/eal_firmware.c\n+++ b/lib/eal/unix/eal_firmware.c\n@@ -16,6 +16,8 @@\n #include \"eal_firmware.h\"\n #include \"eal_private.h\"\n \n+static const char * const compression_algorithms[] = { \"xz\", \"zst\" };\n+\n #ifdef RTE_HAS_LIBARCHIVE\n \n struct firmware_read_ctx {\n@@ -37,7 +39,11 @@ firmware_open(struct firmware_read_ctx *ctx, const char *name, size_t blocksize)\n \n \terr = archive_read_support_filter_xz(ctx->a);\n \tif (err != ARCHIVE_OK && err != ARCHIVE_WARN)\n-\t\tgoto error;\n+\t\tEAL_LOG(DEBUG, \"could not initialise libarchive for xz compression\");\n+\n+\terr = archive_read_support_filter_zstd(ctx->a);\n+\tif (err != ARCHIVE_OK && err != ARCHIVE_WARN)\n+\t\tEAL_LOG(DEBUG, \"could not initialise libarchive for zstd compression\");\n \n \tif (archive_read_open_filename(ctx->a, name, blocksize) != ARCHIVE_OK)\n \t\tgoto error;\n@@ -148,16 +154,22 @@ rte_firmware_read(const char *name, void **buf, size_t *bufsz)\n \n \tret = firmware_read(name, buf, bufsz);\n \tif (ret < 0) {\n-\t\tsnprintf(path, sizeof(path), \"%s.xz\", name);\n-\t\tpath[PATH_MAX - 1] = '\\0';\n+\t\tunsigned int i;\n+\n+\t\tfor (i = 0; i < RTE_DIM(compression_algorithms); i++) {\n+\t\t\tsnprintf(path, sizeof(path), \"%s.%s\", name,\n+\t\t\t\tcompression_algorithms[i]);\n+\t\t\tpath[PATH_MAX - 1] = '\\0';\n+\t\t\tif (access(path, F_OK) != 0)\n+\t\t\t\tcontinue;\n #ifndef RTE_HAS_LIBARCHIVE\n-\t\tif (access(path, F_OK) == 0) {\n \t\t\tEAL_LOG(WARNING, \"libarchive not linked, %s cannot be decompressed\",\n \t\t\t\tpath);\n-\t\t}\n #else\n-\t\tret = firmware_read(path, buf, bufsz);\n+\t\t\tret = firmware_read(path, buf, bufsz);\n #endif\n+\t\t\tbreak;\n+\t\t}\n \t}\n \treturn ret;\n }\n",
    "prefixes": [
        "v2"
    ]
}