get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 113791,
    "url": "http://patches.dpdk.org/api/patches/113791/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20220707183450.3203361-2-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-2-hofors@lysator.liu.se>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220707183450.3203361-2-hofors@lysator.liu.se",
    "date": "2022-07-07T18:34:50",
    "name": "[2/2] net: have checksum routines accept unaligned data",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "1c553646bce44dbd88417b3c172c67a4975f40a9",
    "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-2-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/113791/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/113791/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 45A5FA0543;\n\tThu,  7 Jul 2022 20:35:17 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 097DD42836;\n\tThu,  7 Jul 2022 20:35:12 +0200 (CEST)",
            "from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3])\n by mails.dpdk.org (Postfix) with ESMTP id AC21840A7B;\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 90CC4113BA;\n Thu,  7 Jul 2022 20:35:10 +0200 (CEST)",
            "by mail.lysator.liu.se (Postfix, from userid 1004)\n id 8F855112BF; 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 3C3F811345;\n Thu,  7 Jul 2022 20:35:09 +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 2/2] net: have checksum routines accept unaligned data",
        "Date": "Thu,  7 Jul 2022 20:34:50 +0200",
        "Message-Id": "<20220707183450.3203361-2-hofors@lysator.liu.se>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20220707183450.3203361-1-hofors@lysator.liu.se>",
        "References": "<98CBD80474FA8B44BF855DF32C47DC35D87189@smartserver.smartshare.dk>\n <20220707183450.3203361-1-hofors@lysator.liu.se>",
        "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\n__rte_raw_cksum() (used by rte_raw_cksum() among others) accessed its\ndata through an uint16_t pointer, which allowed the compiler to assume\nthe data was 16-bit aligned. This in turn would, with certain\narchitectures and compiler flag combinations, result in code with SIMD\nload or store instructions with restrictions on data alignment.\n\nThis patch keeps the old algorithm, but data is read using memcpy()\ninstead of direct pointer access, forcing the compiler to always\ngenerate code that handles unaligned input. The __may_alias__ GCC\nattribute is no longer needed.\n\nThe data on which the Internet checksum functions operates are almost\nalways 16-bit aligned, but there are exceptions. In particular, the\nPDCP protocol header may (literally) have an odd size.\n\nPerformance impact seems to range from none to a very slight\nregression.\n\nBugzilla ID: 1035\nCc: stable@dpdk.org\n\nSigned-off-by: Mattias Rönnblom <mattias.ronnblom@ericsson.com>\n---\n lib/net/rte_ip.h | 19 ++++++++++++-------\n 1 file changed, 12 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/lib/net/rte_ip.h b/lib/net/rte_ip.h\nindex b502481670..a9e6251f14 100644\n--- a/lib/net/rte_ip.h\n+++ b/lib/net/rte_ip.h\n@@ -160,18 +160,23 @@ rte_ipv4_hdr_len(const struct rte_ipv4_hdr *ipv4_hdr)\n static inline uint32_t\n __rte_raw_cksum(const void *buf, size_t len, uint32_t sum)\n {\n-\t/* extend strict-aliasing rules */\n-\ttypedef uint16_t __attribute__((__may_alias__)) u16_p;\n-\tconst u16_p *u16_buf = (const u16_p *)buf;\n-\tconst u16_p *end = u16_buf + len / sizeof(*u16_buf);\n+\tconst void *end;\n \n-\tfor (; u16_buf != end; ++u16_buf)\n-\t\tsum += *u16_buf;\n+\tfor (end = RTE_PTR_ADD(buf, (len/sizeof(uint16_t)) * sizeof(uint16_t));\n+\t     buf != end; buf = RTE_PTR_ADD(buf, sizeof(uint16_t))) {\n+\t\tuint16_t v;\n+\n+\t\tmemcpy(&v, buf, sizeof(uint16_t));\n+\t\tsum += v;\n+\t}\n \n \t/* if length is odd, keeping it byte order independent */\n \tif (unlikely(len % 2)) {\n+\t\tuint8_t last;\n \t\tuint16_t left = 0;\n-\t\t*(unsigned char *)&left = *(const unsigned char *)end;\n+\n+\t\tmemcpy(&last, end, 1);\n+\t\t*(unsigned char *)&left = last;\n \t\tsum += left;\n \t}\n \n",
    "prefixes": [
        "2/2"
    ]
}