get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 124334,
    "url": "http://patches.dpdk.org/api/patches/124334/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230221193710.717280-1-qobilidop@gmail.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": "<20230221193710.717280-1-qobilidop@gmail.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230221193710.717280-1-qobilidop@gmail.com",
    "date": "2023-02-21T19:37:10",
    "name": "[v6] hash: add XOR32 hash function",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "d853df952cdaa988ff08af2210e8fa765d657d97",
    "submitter": {
        "id": 2970,
        "url": "http://patches.dpdk.org/api/people/2970/?format=api",
        "name": "Bili Dong",
        "email": "qobilidop@gmail.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/20230221193710.717280-1-qobilidop@gmail.com/mbox/",
    "series": [
        {
            "id": 27128,
            "url": "http://patches.dpdk.org/api/series/27128/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27128",
            "date": "2023-02-21T19:37:10",
            "name": "[v6] hash: add XOR32 hash function",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/27128/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/124334/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/124334/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 7659441D32;\n\tTue, 21 Feb 2023 20:37:17 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 56BE140691;\n\tTue, 21 Feb 2023 20:37:17 +0100 (CET)",
            "from mail-pf1-f181.google.com (mail-pf1-f181.google.com\n [209.85.210.181])\n by mails.dpdk.org (Postfix) with ESMTP id 3604B4067C\n for <dev@dpdk.org>; Tue, 21 Feb 2023 20:37:16 +0100 (CET)",
            "by mail-pf1-f181.google.com with SMTP id s15so1646022pfg.3\n for <dev@dpdk.org>; Tue, 21 Feb 2023 11:37:16 -0800 (PST)",
            "from e1f40fda85e4.corp.google.com\n (56.4.82.34.bc.googleusercontent.com. [34.82.4.56])\n by smtp.gmail.com with ESMTPSA id\n y1-20020aa78541000000b005810c4286d6sm1652160pfn.0.2023.02.21.11.37.14\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Tue, 21 Feb 2023 11:37:14 -0800 (PST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:from:to:cc:subject:date\n :message-id:reply-to;\n bh=TKAgkq43pap+28BygnNLXrATuaWO224IP1WPjD5kObs=;\n b=DeaBLBm+XJbP6KHLEubFfgKkFNSjOyaAHsdGIbsGHFCpnYXa4rJ0NjzazHHBFxA79r\n dZ385oSQKWwxO3UUN8KW6faJ+2XRrvsb4s/i4kXzYZKldJZ2oM9iERB7V7rmFOBzwmfM\n mnWn5QxA+e6htKgrYx4vcLXkjuot2YjZ/cgsxdmKMOMGKHMuUF3xivjqHbzJ5sSJeWEC\n wcub1R3fXo4TrI0ZtQar9WmWlcZI8zFQqEWUFzfbs+T/1yfPThG7E/nwjswUCsRWRwl+\n indMRHfyXpqLlCkSuPq5wPSkPSHszJepFtWNNcnIOlxX+mZFGoRYilRZIC+UeixH2qCy\n rfBA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20210112;\n h=content-transfer-encoding:mime-version:references:in-reply-to\n :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc\n :subject:date:message-id:reply-to;\n bh=TKAgkq43pap+28BygnNLXrATuaWO224IP1WPjD5kObs=;\n b=lo6epy6Mqg+so+lG/WaCQWdV8CILDaywoMuvqmu5efM5KdKfBlLHScWRDVAZ5V0waP\n wgTeOKhPcbV0hYLWyZoo6m/ngAV8ldwP0djVIgXqFm7qe3mqzEBLouBzTnsnu8rWMjB8\n 2ycZHU3+ZNr9mXA7tQDaARLjAK9beruSmecGLF7+gl0coAEAQ4HPEt6xdPucAxT0Mcub\n Pbc/4D/OzYLkoc7LHDNtoB9D2wBMpyTbw1MMZiMzM5xdRyXY0crmEoZ0ap/9DoUDR8Io\n +fIhM8ID1OsLMoDaof1o1ZWX7ndEooMaQQljSlp4jHKpa9PJkUqicQ22Xe3clYbDqOjv\n 9H0A==",
        "X-Gm-Message-State": "AO0yUKVx4oU+HUY+T+fj0+qHjej+XgbPWimrjalF6my3fjkI7rjgfRiy\n gQnF65RnWmMQBYqNDBywo8JkeaDnG5s=",
        "X-Google-Smtp-Source": "\n AK7set8iawfzotyJrDrBczfxLlFxjmqyw9eKhCCgyS4tX7yVF+4ptOylQyO7AQkLzfM09UvXvEP+/w==",
        "X-Received": "by 2002:a62:52d5:0:b0:5a8:ad9d:83f with SMTP id\n g204-20020a6252d5000000b005a8ad9d083fmr4548827pfb.24.1677008235277;\n Tue, 21 Feb 2023 11:37:15 -0800 (PST)",
        "From": "Bili Dong <qobilidop@gmail.com>",
        "To": "vladimir.medvedkin@intel.com",
        "Cc": "dev@dpdk.org, cristian.dumitrescu@intel.com,\n Bili Dong <qobilidop@gmail.com>",
        "Subject": "[PATCH v6] hash: add XOR32 hash function",
        "Date": "Tue, 21 Feb 2023 19:37:10 +0000",
        "Message-Id": "<20230221193710.717280-1-qobilidop@gmail.com>",
        "X-Mailer": "git-send-email 2.34.1",
        "In-Reply-To": "<20230221175529.644311-1-qobilidop@gmail.com>",
        "References": "<20230221175529.644311-1-qobilidop@gmail.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": "An XOR32 hash is needed in the Software Switch (SWX) Pipeline for its\nuse case in P4. We implement it in this patch so it could be easily\nregistered in the pipeline later.\n\nSigned-off-by: Bili Dong <qobilidop@gmail.com>\n---\n .mailmap                       |  1 +\n app/test/test_hash_functions.c | 33 +++++++++++--\n lib/hash/rte_hash_xor.h        | 87 ++++++++++++++++++++++++++++++++++\n 3 files changed, 118 insertions(+), 3 deletions(-)\n create mode 100644 lib/hash/rte_hash_xor.h",
    "diff": "diff --git a/.mailmap b/.mailmap\nindex a9f4f28fba..3e9bec29d5 100644\n--- a/.mailmap\n+++ b/.mailmap\n@@ -159,6 +159,7 @@ Bernard Iremonger <bernard.iremonger@intel.com>\n Bert van Leeuwen <bert.vanleeuwen@netronome.com>\n Bhagyada Modali <bhagyada.modali@amd.com>\n Bharat Mota <bmota@vmware.com>\n+Bili Dong <qobilidop@gmail.com>\n Bill Hong <bhong@brocade.com>\n Billy McFall <bmcfall@redhat.com>\n Billy O'Mahony <billy.o.mahony@intel.com>\ndiff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c\nindex 76d51b6e71..53e296fec4 100644\n--- a/app/test/test_hash_functions.c\n+++ b/app/test/test_hash_functions.c\n@@ -15,6 +15,7 @@\n #include <rte_hash.h>\n #include <rte_jhash.h>\n #include <rte_hash_crc.h>\n+#include <rte_hash_xor.h>\n \n #include \"test.h\"\n \n@@ -22,8 +23,8 @@\n  * Hash values calculated for key sizes from array \"hashtest_key_lens\"\n  * and for initial values from array \"hashtest_initvals.\n  * Each key will be formed by increasing each byte by 1:\n- * e.g.: key size = 4, key = 0x03020100\n- *       key size = 8, key = 0x0706050403020100\n+ * e.g.: key size = 4, key = 0x00010203\n+ *       key size = 8, key = 0x0001020304050607\n  */\n static uint32_t hash_values_jhash[2][12] = {{\n \t0x8ba9414b, 0xdf0d39c9,\n@@ -51,6 +52,19 @@ static uint32_t hash_values_crc[2][12] = {{\n \t0x789c104f, 0x53028d3e\n }\n };\n+static uint32_t hash_values_xor32[2][12] = {{\n+\t0x00000000, 0x00010000,\n+\t0x00010203, 0x04040404, 0x00000000, 0x00000000,\n+\t0x00000000, 0x00000000, 0x0c040404, 0x000d0e0f,\n+\t0x04212223, 0x04040404\n+},\n+{\n+\t0xdeadbeef, 0xdeacbeef,\n+\t0xdeacbcec, 0xdaa9baeb, 0xdeadbeef, 0xdeadbeef,\n+\t0xdeadbeef, 0xdeadbeef, 0xd2a9baeb, 0xdea0b0e0,\n+\t0xda8c9ccc, 0xdaa9baeb\n+}\n+};\n \n /*******************************************************************************\n  * Hash function performance test configuration section. Each performance test\n@@ -61,7 +75,7 @@ static uint32_t hash_values_crc[2][12] = {{\n  */\n #define HASHTEST_ITERATIONS 1000000\n #define MAX_KEYSIZE 64\n-static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc};\n+static rte_hash_function hashtest_funcs[] = {rte_jhash, rte_hash_crc, rte_hash_xor32};\n static uint32_t hashtest_initvals[] = {0, 0xdeadbeef};\n static uint32_t hashtest_key_lens[] = {\n \t1, 2,                 /* Unusual key sizes */\n@@ -85,6 +99,9 @@ get_hash_name(rte_hash_function f)\n \tif (f == rte_hash_crc)\n \t\treturn \"rte_hash_crc\";\n \n+\tif (f == rte_hash_xor32)\n+\t\treturn \"rte_hash_xor32\";\n+\n \treturn \"UnknownHash\";\n }\n \n@@ -173,6 +190,16 @@ verify_precalculated_hash_func_tests(void)\n \t\t\t\t       hash_values_crc[j][i], hash);\n \t\t\t\treturn -1;\n \t\t\t}\n+\n+\t\t\thash = rte_hash_xor32(key, hashtest_key_lens[i],\n+\t\t\t\t\thashtest_initvals[j]);\n+\t\t\tif (hash != hash_values_xor32[j][i]) {\n+\t\t\t\tprintf(\"XOR32 for %u bytes with initial value 0x%x.\"\n+\t\t\t\t       \" Expected 0x%x, but got 0x%x\\n\",\n+\t\t\t\t       hashtest_key_lens[i], hashtest_initvals[j],\n+\t\t\t\t       hash_values_xor32[j][i], hash);\n+\t\t\t\treturn -1;\n+\t\t\t}\n \t\t}\n \t}\n \ndiff --git a/lib/hash/rte_hash_xor.h b/lib/hash/rte_hash_xor.h\nnew file mode 100644\nindex 0000000000..366adbe64c\n--- /dev/null\n+++ b/lib/hash/rte_hash_xor.h\n@@ -0,0 +1,87 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2023 Intel Corporation\n+ */\n+\n+#ifndef _RTE_HASH_XOR_H_\n+#define _RTE_HASH_XOR_H_\n+\n+/**\n+ * @file\n+ *\n+ * RTE XOR Hash\n+ */\n+\n+#ifdef __cplusplus\n+extern \"C\" {\n+#endif\n+\n+#include <stdint.h>\n+\n+#include <rte_byteorder.h>\n+\n+/**\n+ * Calculate XOR32 hash on user-supplied byte array.\n+ *\n+ * @param data\n+ *   Data to perform hash on.\n+ * @param data_len\n+ *   How many bytes to use to calculate hash value.\n+ * @param init_val\n+ *   Value to initialise hash generator.\n+ * @return\n+ *   32bit calculated hash value.\n+ */\n+static inline uint32_t\n+rte_hash_xor32(const void *data, uint32_t data_len, uint32_t init_val)\n+{\n+\tuint32_t hash32;\n+\tconst uint8_t *data8 = data;\n+\n+\t/* Minimize byte order conversions depending on data length. */\n+\tif (data_len >= 8) {\n+\t\t/* For longer arrays, operate in big endian. */\n+\t\tuint64_t hash64 = rte_cpu_to_be_32(init_val);\n+\n+\t\tuint32_t i;\n+\t\tfor (i = 0; i < data_len / 8; i++) {\n+\t\t\thash64 ^= *(const uint64_t *)data8;\n+\t\t\tdata8 += 8;\n+\t\t}\n+\n+\t\tif (data_len & 0x4) {\n+\t\t\thash64 ^= *(const uint32_t *)data8;\n+\t\t\tdata8 += 4;\n+\t\t}\n+\n+\t\thash32 = rte_be_to_cpu_32(hash64 ^ (hash64 >> 32));\n+\t} else {\n+\t\t/* For shorter arrays, operate in host endian. */\n+\t\thash32 = init_val;\n+\n+\t\tif (data_len & 0x4) {\n+\t\t\thash32 ^= rte_be_to_cpu_32(*(const uint32_t *)data8);\n+\t\t\tdata8 += 4;\n+\t\t}\n+\t}\n+\n+\t/* Deal with remaining (< 4) bytes. */\n+\n+\tuint8_t bit_offset = 0;\n+\n+\tif (data_len & 0x2) {\n+\t\thash32 ^= (uint32_t)rte_be_to_cpu_16(*(const uint16_t *)data8) << 16;\n+\t\tdata8 += 2;\n+\t\tbit_offset += 16;\n+\t}\n+\n+\tif (data_len & 0x1)\n+\t\thash32 ^= (uint32_t)(*(const uint8_t *)data8) << (24 - bit_offset);\n+\n+\treturn hash32;\n+}\n+\n+#ifdef __cplusplus\n+}\n+#endif\n+\n+#endif /* _RTE_HASH_XOR_H_ */\n",
    "prefixes": [
        "v6"
    ]
}