get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 113790,
    "url": "http://patches.dpdk.org/api/patches/113790/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220707183450.3203361-1-hofors@lysator.liu.se/",
    "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": "<20220707183450.3203361-1-hofors@lysator.liu.se>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220707183450.3203361-1-hofors@lysator.liu.se",
    "date": "2022-07-07T18:34:49",
    "name": "[1/2] app/test: add cksum performance test",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "17fc8a891b9e2afdf727b88c9eb7219e409862b3",
    "submitter": {
        "id": 906,
        "url": "http://patches.dpdk.org/api/people/906/?format=api",
        "name": "Mattias Rönnblom",
        "email": "hofors@lysator.liu.se"
    },
    "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/20220707183450.3203361-1-hofors@lysator.liu.se/mbox/",
    "series": [
        {
            "id": 23930,
            "url": "http://patches.dpdk.org/api/series/23930/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=23930",
            "date": "2022-07-07T18:34:49",
            "name": "[1/2] app/test: add cksum performance test",
            "version": 1,
            "mbox": "http://patches.dpdk.org/series/23930/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/113790/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/113790/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 29D0DA0543;\n\tThu,  7 Jul 2022 20:35:11 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id F18ED40A7B;\n\tThu,  7 Jul 2022 20:35:10 +0200 (CEST)",
            "from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])\n by mails.dpdk.org (Postfix) with ESMTP id 84C704069D;\n Thu,  7 Jul 2022 20:35:10 +0200 (CEST)",
            "from mail.lysator.liu.se (localhost [127.0.0.1])\n by mail.lysator.liu.se (Postfix) with ESMTP id 4527E11442;\n Thu,  7 Jul 2022 20:35:10 +0200 (CEST)",
            "by mail.lysator.liu.se (Postfix, from userid 1004)\n id 43D45112BC; Thu,  7 Jul 2022 20:35:10 +0200 (CEST)",
            "from isengard.friendlyfire.se (unknown [62.63.215.114])\n (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)\n key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest\n SHA256) (No client certificate requested)\n by mail.lysator.liu.se (Postfix) with ESMTPSA id 7A38C10F6E;\n Thu,  7 Jul 2022 20:35:06 +0200 (CEST)"
        ],
        "X-Spam-Checker-Version": "SpamAssassin 3.4.6 (2021-04-09) on\n hermod.lysator.liu.se",
        "X-Spam-Level": "",
        "X-Spam-Status": "No, score=-1.8 required=5.0 tests=ALL_TRUSTED,AWL,\n T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.6",
        "X-Spam-Score": "-1.8",
        "From": "=?utf-8?q?Mattias_R=C3=B6nnblom?= <hofors@lysator.liu.se>",
        "To": "olivier.matz@6wind.com",
        "Cc": "Emil Berg <emil.berg@ericsson.com>, bruce.richardson@intel.com,\n stephen@networkplumber.org, stable@dpdk.org, bugzilla@dpdk.org, dev@dpdk.org,\n onar.olsen@ericsson.com,\n =?utf-8?q?Morten_Br=C3=B8rup?= <mb@smartsharesystems.com>, =?utf-8?q?Mattia?=\n\t=?utf-8?q?s_R=C3=B6nnblom?= <mattias.ronnblom@ericsson.com>",
        "Subject": "[PATCH 1/2] app/test: add cksum performance test",
        "Date": "Thu,  7 Jul 2022 20:34:49 +0200",
        "Message-Id": "<20220707183450.3203361-1-hofors@lysator.liu.se>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "\n <98CBD80474FA8B44BF855DF32C47DC35D87189@smartserver.smartshare.dk>",
        "References": "<98CBD80474FA8B44BF855DF32C47DC35D87189@smartserver.smartshare.dk>",
        "MIME-Version": "1.0",
        "Content-Type": "text/plain; charset=UTF-8",
        "Content-Transfer-Encoding": "8bit",
        "X-Virus-Scanned": "ClamAV using ClamSMTP",
        "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": "From: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n\nAdd performance test for the rte_raw_cksum() function, which delegates\nthe actual work to __rte_raw_cksum(), which in turn is used by other\nfunctions in need of Internet checksum calculation.\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n MAINTAINERS                |   1 +\n app/test/meson.build       |   1 +\n app/test/test_cksum_perf.c | 118 +++++++++++++++++++++++++++++++++++++\n 3 files changed, 120 insertions(+)\n create mode 100644 app/test/test_cksum_perf.c",
    "diff": "diff --git a/MAINTAINERS b/MAINTAINERS\nindex c923712946..2a4c99e05a 100644\n--- a/MAINTAINERS\n+++ b/MAINTAINERS\n@@ -1414,6 +1414,7 @@ Network headers\n M: Olivier Matz <olivier.matz@6wind.com>\n F: lib/net/\n F: app/test/test_cksum.c\n+F: app/test/test_cksum_perf.c\n \n Packet CRC\n M: Jasvinder Singh <jasvinder.singh@intel.com>\ndiff --git a/app/test/meson.build b/app/test/meson.build\nindex 431c5bd318..191db03d1d 100644\n--- a/app/test/meson.build\n+++ b/app/test/meson.build\n@@ -18,6 +18,7 @@ test_sources = files(\n         'test_bpf.c',\n         'test_byteorder.c',\n         'test_cksum.c',\n+        'test_cksum_perf.c',\n         'test_cmdline.c',\n         'test_cmdline_cirbuf.c',\n         'test_cmdline_etheraddr.c',\ndiff --git a/app/test/test_cksum_perf.c b/app/test/test_cksum_perf.c\nnew file mode 100644\nindex 0000000000..d27e7f893a\n--- /dev/null\n+++ b/app/test/test_cksum_perf.c\n@@ -0,0 +1,118 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2022 Ericsson AB\n+ */\n+\n+#include <stdio.h>\n+\n+#include <rte_common.h>\n+#include <rte_cycles.h>\n+#include <rte_ip.h>\n+#include <rte_malloc.h>\n+#include <rte_random.h>\n+\n+#include \"test.h\"\n+\n+#define NUM_BLOCKS (10)\n+#define ITERATIONS (1000000)\n+\n+static const size_t data_sizes[] = { 20, 21, 100, 101, 1500, 1501 };\n+\n+static __rte_noinline uint16_t\n+do_rte_raw_cksum(const void *buf, size_t len)\n+{\n+\treturn rte_raw_cksum(buf, len);\n+}\n+\n+static void\n+init_block(void *buf, size_t len)\n+{\n+\tsize_t i;\n+\n+\tfor (i = 0; i < len; i++)\n+\t\t((char *)buf)[i] = (uint8_t)rte_rand();\n+}\n+\n+static int\n+test_cksum_perf_size_alignment(size_t block_size, bool aligned)\n+{\n+\tchar *data[NUM_BLOCKS];\n+\tchar *blocks[NUM_BLOCKS];\n+\tunsigned int i;\n+\tuint64_t start;\n+\tuint64_t end;\n+\t/* Floating point to handle low (pseudo-)TSC frequencies */\n+\tdouble block_latency;\n+\tdouble byte_latency;\n+\tvolatile uint64_t sum = 0;\n+\n+\tfor (i = 0; i < NUM_BLOCKS; i++) {\n+\t\tdata[i] = rte_malloc(NULL, block_size + 1, 0);\n+\n+\t\tif (data[i] == NULL) {\n+\t\t\tprintf(\"Failed to allocate memory for block\\n\");\n+\t\t\treturn TEST_FAILED;\n+\t\t}\n+\n+\t\tinit_block(data[i], block_size + 1);\n+\n+\t\tblocks[i] = aligned ? data[i] : data[i] + 1;\n+\t}\n+\n+\tstart = rte_rdtsc();\n+\n+\tfor (i = 0; i < ITERATIONS; i++) {\n+\t\tunsigned int j;\n+\t\tfor (j = 0; j < NUM_BLOCKS; j++)\n+\t\t\tsum += do_rte_raw_cksum(blocks[j], block_size);\n+\t}\n+\n+\tend = rte_rdtsc();\n+\n+\tblock_latency = (end - start) / (double)(ITERATIONS * NUM_BLOCKS);\n+\tbyte_latency = block_latency / block_size;\n+\n+\tprintf(\"%-9s %10zd %19.1f %16.2f\\n\", aligned ? \"Aligned\" : \"Unaligned\",\n+\t       block_size, block_latency, byte_latency);\n+\n+\tfor (i = 0; i < NUM_BLOCKS; i++)\n+\t\trte_free(data[i]);\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+static int\n+test_cksum_perf_size(size_t block_size)\n+{\n+\tint rc;\n+\n+\trc = test_cksum_perf_size_alignment(block_size, true);\n+\tif (rc != TEST_SUCCESS)\n+\t\treturn rc;\n+\n+\trc = test_cksum_perf_size_alignment(block_size, false);\n+\n+\treturn rc;\n+}\n+\n+static int\n+test_cksum_perf(void)\n+{\n+\tuint16_t i;\n+\n+\tprintf(\"### rte_raw_cksum() performance ###\\n\");\n+\tprintf(\"Alignment  Block size    TSC cycles/block  TSC cycles/byte\\n\");\n+\n+\tfor (i = 0; i < RTE_DIM(data_sizes); i++) {\n+\t\tint rc;\n+\n+\t\trc = test_cksum_perf_size(data_sizes[i]);\n+\t\tif (rc != TEST_SUCCESS)\n+\t\t\treturn rc;\n+\t}\n+\n+\treturn TEST_SUCCESS;\n+}\n+\n+\n+REGISTER_TEST_COMMAND(cksum_perf_autotest, test_cksum_perf);\n+\n",
    "prefixes": [
        "1/2"
    ]
}