get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 133726,
    "url": "http://patches.dpdk.org/api/patches/133726/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20231101124655.2043856-5-paul.szczepanek@arm.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": "<20231101124655.2043856-5-paul.szczepanek@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20231101124655.2043856-5-paul.szczepanek@arm.com",
    "date": "2023-11-01T12:46:55",
    "name": "[v4,4/4] test: add unit test for ptr compression",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "b475471a4c9acf6e7957ceb0ed8fe74ff0d34d53",
    "submitter": {
        "id": 3199,
        "url": "http://patches.dpdk.org/api/people/3199/?format=api",
        "name": "Paul Szczepanek",
        "email": "paul.szczepanek@arm.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/20231101124655.2043856-5-paul.szczepanek@arm.com/mbox/",
    "series": [
        {
            "id": 30095,
            "url": "http://patches.dpdk.org/api/series/30095/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=30095",
            "date": "2023-11-01T12:46:51",
            "name": "add pointer compression API",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/30095/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/133726/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/133726/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 955EA43260;\n\tWed,  1 Nov 2023 13:47:53 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4211940E78;\n\tWed,  1 Nov 2023 13:47:42 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id CD65F400EF\n for <dev@dpdk.org>; Wed,  1 Nov 2023 13:47:38 +0100 (CET)",
            "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id DFAA5150C;\n Wed,  1 Nov 2023 05:48:19 -0700 (PDT)",
            "from ampere-altra-2-2.usa.Arm.com (unknown [10.118.91.160])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 25FC43F738;\n Wed,  1 Nov 2023 05:47:38 -0700 (PDT)"
        ],
        "From": "Paul Szczepanek <paul.szczepanek@arm.com>",
        "To": "dev@dpdk.org",
        "Cc": "Paul Szczepanek <paul.szczepanek@arm.com>",
        "Subject": "[PATCH v4 4/4] test: add unit test for ptr compression",
        "Date": "Wed,  1 Nov 2023 12:46:55 +0000",
        "Message-Id": "<20231101124655.2043856-5-paul.szczepanek@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20231101124655.2043856-1-paul.szczepanek@arm.com>",
        "References": "<20230927150854.3670391-2-paul.szczepanek@arm.com>\n <20231101124655.2043856-1-paul.szczepanek@arm.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "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": "Test compresses and decompresses pointers with various combinations\nof memory regions and alignments and verifies the pointers are\nrecovered correctly.\n\nSigned-off-by: Paul Szczepanek <paul.szczepanek@arm.com>\n---\n app/test/meson.build             |   1 +\n app/test/test_eal_ptr_compress.c | 108 +++++++++++++++++++++++++++++++\n 2 files changed, 109 insertions(+)\n create mode 100644 app/test/test_eal_ptr_compress.c\n\n--\n2.25.1",
    "diff": "diff --git a/app/test/meson.build b/app/test/meson.build\nindex 05bae9216d..753de4bbd3 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -61,6 +61,7 @@ source_file_deps = {\n     'test_dmadev_api.c': ['dmadev'],\n     'test_eal_flags.c': [],\n     'test_eal_fs.c': [],\n+    'test_eal_ptr_compress.c': [],\n     'test_efd.c': ['efd', 'net'],\n     'test_efd_perf.c': ['efd', 'hash'],\n     'test_errno.c': [],\ndiff --git a/app/test/test_eal_ptr_compress.c b/app/test/test_eal_ptr_compress.c\nnew file mode 100644\nindex 0000000000..c1c9a98be7\n--- /dev/null\n+++ b/app/test/test_eal_ptr_compress.c\n@@ -0,0 +1,108 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2014 Intel Corporation\n+ */\n+\n+#include \"test.h\"\n+#include <stdint.h>\n+#include <string.h>\n+\n+#include <rte_ptr_compress.h>\n+\n+#define MAX_ALIGN_EXPONENT 3\n+#define PTRS_SIZE 16\n+#define NUM_BASES 2\n+#define NUM_REGIONS 4\n+#define MAX_32BIT_REGION ((uint64_t)UINT32_MAX + 1)\n+#define MAX_16BIT_REGION (UINT16_MAX + 1)\n+\n+static int\n+test_eal_ptr_compress_params(\n+\tvoid *base,\n+\tuint64_t mem_sz,\n+\tunsigned int align_exp,\n+\tunsigned int num_ptrs,\n+\tbool use_32_bit)\n+{\n+\tunsigned int i;\n+\tunsigned int align = 1 << align_exp;\n+\tvoid *ptrs[PTRS_SIZE] = {0};\n+\tvoid *ptrs_out[PTRS_SIZE] = {0};\n+\tuint32_t offsets32[PTRS_SIZE] = {0};\n+\tuint16_t offsets16[PTRS_SIZE] = {0};\n+\n+\tfor (i = 0; i < num_ptrs; i++) {\n+\t\t/* make pointers point at memory in steps of align */\n+\t\t/* alternate steps from the start and end of memory region */\n+\t\tif ((i & 1) == 1)\n+\t\t\tptrs[i] = (char *)base + mem_sz - i * align;\n+\t\telse\n+\t\t\tptrs[i] = (char *)base + i * align;\n+\t}\n+\n+\tif (use_32_bit) {\n+\t\trte_ptr_compress_32(base, ptrs, offsets32, num_ptrs, align_exp);\n+\t\trte_ptr_decompress_32(base, offsets32, ptrs_out, num_ptrs,\n+\t\t\t\talign_exp);\n+\t} else {\n+\t\trte_ptr_compress_16(base, ptrs, offsets16, num_ptrs, align_exp);\n+\t\trte_ptr_decompress_16(base, offsets16, ptrs_out, num_ptrs,\n+\t\t\t\talign_exp);\n+\t}\n+\n+\tTEST_ASSERT_BUFFERS_ARE_EQUAL(ptrs, ptrs_out, sizeof(void *) * num_ptrs,\n+\t\t\"Decompressed pointers corrupted\\nbase pointer: %p, \"\n+\t\t\"memory region size: %\" PRIu64 \", alignment exponent: %u, \"\n+\t\t\"num of pointers: %u, using %s offsets\",\n+\t\tbase, mem_sz, align_exp, num_ptrs,\n+\t\tuse_32_bit ? \"32-bit\" : \"16-bit\");\n+\n+\treturn 0;\n+}\n+\n+static int\n+test_eal_ptr_compress(void)\n+{\n+\tunsigned int j, k, n;\n+\tint ret = 0;\n+\tvoid * const bases[NUM_BASES] = { (void *)0, (void *)UINT16_MAX };\n+\t/* maximum size for pointers aligned by consecutive powers of 2 */\n+\tconst uint64_t region_sizes_16[NUM_REGIONS] = {\n+\t\tMAX_16BIT_REGION,\n+\t\tMAX_16BIT_REGION * 2,\n+\t\tMAX_16BIT_REGION * 4,\n+\t\tMAX_16BIT_REGION * 8,\n+\t};\n+\tconst uint64_t region_sizes_32[NUM_REGIONS] = {\n+\t\tMAX_32BIT_REGION,\n+\t\tMAX_32BIT_REGION * 2,\n+\t\tMAX_32BIT_REGION * 4,\n+\t\tMAX_32BIT_REGION * 8,\n+\t};\n+\n+\tfor (j = 0; j < NUM_REGIONS; j++) {\n+\t\tfor (k = 0; k < NUM_BASES; k++) {\n+\t\t\tfor (n = 1; n < PTRS_SIZE; n++) {\n+\t\t\t\tret |= test_eal_ptr_compress_params(\n+\t\t\t\t\tbases[k],\n+\t\t\t\t\tregion_sizes_16[j],\n+\t\t\t\t\tj /* exponent of alignment */,\n+\t\t\t\t\tn,\n+\t\t\t\t\tfalse\n+\t\t\t\t);\n+\t\t\t\tret |= test_eal_ptr_compress_params(\n+\t\t\t\t\tbases[k],\n+\t\t\t\t\tregion_sizes_32[j],\n+\t\t\t\t\tj /* exponent of alignment */,\n+\t\t\t\t\tn,\n+\t\t\t\t\ttrue\n+\t\t\t\t);\n+\t\t\t\tif (ret != 0)\n+\t\t\t\t\treturn ret;\n+\t\t\t}\n+\t\t}\n+\t}\n+\n+\treturn ret;\n+}\n+\n+REGISTER_FAST_TEST(eal_ptr_compress_autotest, true, true, test_eal_ptr_compress);\n",
    "prefixes": [
        "v4",
        "4/4"
    ]
}