get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129354,
    "url": "http://patchwork.dpdk.org/api/patches/129354/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230706175938.62721-5-stephen@networkplumber.org/",
    "project": {
        "id": 1,
        "url": "http://patchwork.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": "<20230706175938.62721-5-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230706175938.62721-5-stephen@networkplumber.org",
    "date": "2023-07-06T17:59:28",
    "name": "[v3,04/14] test: cryptodev use rte_pktmbuf_mtod_offset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c3601f981abf3172ec1059e6fb90a793cb6001e3",
    "submitter": {
        "id": 27,
        "url": "http://patchwork.dpdk.org/api/people/27/?format=api",
        "name": "Stephen Hemminger",
        "email": "stephen@networkplumber.org"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230706175938.62721-5-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 28867,
            "url": "http://patchwork.dpdk.org/api/series/28867/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28867",
            "date": "2023-07-06T17:59:24",
            "name": "Use rte_pktmbuf_mtod_offset() where possible",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/28867/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129354/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129354/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 A8DDD42DEC;\n\tThu,  6 Jul 2023 20:00:10 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4C57442FF2;\n\tThu,  6 Jul 2023 19:59:48 +0200 (CEST)",
            "from mail-oi1-f181.google.com (mail-oi1-f181.google.com\n [209.85.167.181])\n by mails.dpdk.org (Postfix) with ESMTP id 826BC42FF8\n for <dev@dpdk.org>; Thu,  6 Jul 2023 19:59:45 +0200 (CEST)",
            "by mail-oi1-f181.google.com with SMTP id\n 5614622812f47-3a36b309524so961572b6e.3\n for <dev@dpdk.org>; Thu, 06 Jul 2023 10:59:45 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n nh8-20020a17090b364800b00256bbfbabcfsm76464pjb.48.2023.07.06.10.59.43\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 06 Jul 2023 10:59:44 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688666384;\n x=1691258384;\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=rucvP5yxuNiVLQ0yHfEt7I2LvK/gRouxqlz9X3nrfj4=;\n b=LlBYPXOUxlIeKBIYD2jxBn6Ea0vfMDcjy1IVdHyfJkroGC/jojIBuPq1+WvnMnIcUc\n 4gFcbv+meZ0yoeqldeKfVQgr5z0ggh7wBSv962TVy2NoIaXCBv/ywPfSeOYQ4O6CCYsN\n bQt4jQL3irOjzwbgNHJknNyucJ/iiHx83kg5wjFTTehrXIFU/w7eJqjZWP+upiClQt87\n BYwYyAJ646rWSZD1vSP7CGKq3xAanQZbvPcXocuHprnLTwlQh8TuFwtzWK7dbUMsmM4W\n r7dNEO6/+8AjZ+C7pjV29FKWnZDaatuOJTUUDq1Td/svaTgAfIbHnHVhp9DPWJVeUmcx\n coJQ==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1688666384; x=1691258384;\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=rucvP5yxuNiVLQ0yHfEt7I2LvK/gRouxqlz9X3nrfj4=;\n b=jg5oBEv+APk+Ah+52ltf42eUV98NkBRFV+OxwLgQqC7KFfngOFpRsd6J9nwX+I2z9i\n ZiWnw6vCufS2iULW/09HR1lu2JBaN9Is/7u77HFPPtAUzFZhe67J248dqrDcYn9Dcbh+\n u1xZLcqUsJ/YfGWqczfJWr+rDCbGn7nHdB3rsIsIRGMLa4/VMPkDf7JnmY9bgZ7kZ9Ux\n yYDD5DYvXJYt5scxHwh8HVNUgtxXd91A3YLsQ+YsZyDxLgFRnHU2rHiBY60HU0G11rNQ\n crWMj4M0fiuonxjDV/hveEyP+iMgDA6DvhdY6cGigTwX9yypDhIlBO8YT86mK0c7Un9q\n 3hwA==",
        "X-Gm-Message-State": "ABy/qLahb4HBzPsRUY3bVExG8VSU4KcPAaRUSYJstkoEfT6UYlIpRcKL\n L0RA04iBKbBKj5tiicDMZpOGwvRrg3KxiGsa7J8=",
        "X-Google-Smtp-Source": "\n APBJJlE3NaePwSwQNQbaiexpADnDWKBF/eAkNmfjVc43YsP6QSkbUqGebs0Dyq9oZtjDp7tiiYe0Vg==",
        "X-Received": "by 2002:aca:916:0:b0:3a1:f0dc:def7 with SMTP id\n 22-20020aca0916000000b003a1f0dcdef7mr2374631oij.56.1688666384611;\n Thu, 06 Jul 2023 10:59:44 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>,\n Akhil Goyal <gakhil@marvell.com>, Fan Zhang <fanzhang.oss@gmail.com>",
        "Subject": "[PATCH v3 04/14] test: cryptodev use rte_pktmbuf_mtod_offset",
        "Date": "Thu,  6 Jul 2023 10:59:28 -0700",
        "Message-Id": "<20230706175938.62721-5-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230706175938.62721-1-stephen@networkplumber.org>",
        "References": "<20230505174813.133894-1-stephen@networkplumber.org>\n <20230706175938.62721-1-stephen@networkplumber.org>",
        "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": "Based off patch generated by cocci/mtod-offset.cocci.\nWith some cleanup to shorten lines by using conditional\nwith omitted operand.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test/test_cryptodev.c | 66 +++++++++++++++++++++------------------\n 1 file changed, 36 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex fb2af40b99ee..5072b3b6ece5 100644\n--- a/app/test/test_cryptodev.c\n+++ b/app/test/test_cryptodev.c\n@@ -3153,8 +3153,9 @@ test_snow3g_authentication(const struct snow3g_hash_test_data *tdata)\n \t\t\t\tut_params->op);\n \tut_params->obuf = ut_params->op->sym->m_src;\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n@@ -3247,8 +3248,9 @@ test_snow3g_authentication_verify(const struct snow3g_hash_test_data *tdata)\n \t\t\t\tut_params->op);\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n \tut_params->obuf = ut_params->op->sym->m_src;\n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tif (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS)\n@@ -3337,8 +3339,9 @@ test_kasumi_authentication(const struct kasumi_hash_test_data *tdata)\n \n \tut_params->obuf = ut_params->op->sym->m_src;\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n@@ -3425,8 +3428,9 @@ test_kasumi_authentication_verify(const struct kasumi_hash_test_data *tdata)\n \t\t\t\tut_params->op);\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n \tut_params->obuf = ut_params->op->sym->m_src;\n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tif (ut_params->op->status == RTE_CRYPTO_OP_STATUS_SUCCESS)\n@@ -4879,8 +4883,9 @@ test_zuc_cipher_auth(const struct wireless_test_data *tdata)\n \t\t\ttdata->validDataLenInBits.len,\n \t\t\t\"ZUC Ciphertext data not as expected\");\n \n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t    + plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n@@ -4994,8 +4999,9 @@ test_snow3g_cipher_auth(const struct snow3g_test_data *tdata)\n \t\t\ttdata->validDataLenInBits.len,\n \t\t\t\"SNOW 3G Ciphertext data not as expected\");\n \n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t    + plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \t/* Validate obuf */\n \tTEST_ASSERT_BUFFERS_ARE_EQUAL(\n@@ -5163,9 +5169,9 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,\n \t\tdebug_hexdump(stdout, \"ciphertext expected:\",\n \t\t\ttdata->ciphertext.data, tdata->ciphertext.len >> 3);\n \n-\t\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t+ (tdata->digest.offset_bytes == 0 ?\n-\t\tplaintext_pad_len : tdata->digest.offset_bytes);\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\tuint8_t *,\n+\t\t\t\t\ttdata->digest.offset_bytes ? : plaintext_pad_len);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -5577,10 +5583,9 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,\n \t\tdebug_hexdump(stdout, \"ciphertext expected:\",\n \t\t\ttdata->ciphertext.data, tdata->ciphertext.len >> 3);\n \n-\t\tut_params->digest = rte_pktmbuf_mtod(\n-\t\t\tut_params->obuf, uint8_t *) +\n-\t\t\t(tdata->digest.offset_bytes == 0 ?\n-\t\t\tplaintext_pad_len : tdata->digest.offset_bytes);\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\tuint8_t *,\n+\t\t\t\t\ttdata->digest.offset_bytes ? : plaintext_pad_len);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -5924,8 +5929,9 @@ test_kasumi_cipher_auth(const struct kasumi_test_data *tdata)\n \tciphertext = rte_pktmbuf_mtod_offset(ut_params->obuf, uint8_t *,\n \t\t\t\ttdata->validCipherOffsetInBits.len >> 3);\n \n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \tconst uint8_t *reference_ciphertext = tdata->ciphertext.data +\n \t\t\t\t(tdata->validCipherOffsetInBits.len >> 3);\n@@ -6344,8 +6350,9 @@ test_zuc_authentication(const struct wireless_test_data *tdata,\n \t\t\t\tut_params->op);\n \tTEST_ASSERT_NOT_NULL(ut_params->op, \"failed to retrieve obuf\");\n \tut_params->obuf = ut_params->op->sym->m_src;\n-\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t+ plaintext_pad_len;\n+\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *,\n+\t\t\t\t\t\t    plaintext_pad_len);\n \n \tif (auth_op != RTE_CRYPTO_AUTH_OP_VERIFY) {\n \t\t/* Validate obuf */\n@@ -6531,10 +6538,9 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,\n \t\tdebug_hexdump(stdout, \"ciphertext expected:\",\n \t\t\ttdata->ciphertext.data, tdata->ciphertext.len >> 3);\n \n-\t\tut_params->digest = rte_pktmbuf_mtod(\n-\t\t\tut_params->obuf, uint8_t *) +\n-\t\t\t(tdata->digest.offset_bytes == 0 ?\n-\t\t\tplaintext_pad_len : tdata->digest.offset_bytes);\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\tuint8_t *,\n+\t\t\t\t\ttdata->digest.offset_bytes ? : plaintext_pad_len);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -7959,9 +7965,9 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,\n \t\t\t\ttdata->ciphertext.data,\n \t\t\t\ttdata->ciphertext.len_bits >> 3);\n \n-\t\tut_params->digest = rte_pktmbuf_mtod(ut_params->obuf, uint8_t *)\n-\t\t\t\t+ (tdata->digest_enc.offset == 0 ?\n-\t\tplaintext_pad_len : tdata->digest_enc.offset);\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\tuint8_t *,\n+\t\t\t\t\ttdata->digest_enc.offset ? : plaintext_pad_len);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\t\ttdata->digest_enc.len);\n",
    "prefixes": [
        "v3",
        "04/14"
    ]
}