get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 129389,
    "url": "http://patchwork.dpdk.org/api/patches/129389/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230708015718.75565-4-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": "<20230708015718.75565-4-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230708015718.75565-4-stephen@networkplumber.org",
    "date": "2023-07-08T01:57:10",
    "name": "[v5,03/11] test/crypto_dev: use rte_pktmbuf_mtod_offset",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "7ae25cc9d624f328393896940feb02225c99a87b",
    "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/20230708015718.75565-4-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 28878,
            "url": "http://patchwork.dpdk.org/api/series/28878/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28878",
            "date": "2023-07-08T01:57:07",
            "name": "use rte_pktmbuf_mto_offset",
            "version": 5,
            "mbox": "http://patchwork.dpdk.org/series/28878/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/129389/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/129389/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 04EFF42DFC;\n\tSat,  8 Jul 2023 03:57:39 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4CF8442BFE;\n\tSat,  8 Jul 2023 03:57:27 +0200 (CEST)",
            "from mail-oa1-f47.google.com (mail-oa1-f47.google.com\n [209.85.160.47]) by mails.dpdk.org (Postfix) with ESMTP id 9C4164111C\n for <dev@dpdk.org>; Sat,  8 Jul 2023 03:57:24 +0200 (CEST)",
            "by mail-oa1-f47.google.com with SMTP id\n 586e51a60fabf-1b3ff2460ecso2415672fac.0\n for <dev@dpdk.org>; Fri, 07 Jul 2023 18:57:24 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n 24-20020a17090a035800b00263f5ac814esm2260269pjf.38.2023.07.07.18.57.22\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Fri, 07 Jul 2023 18:57:23 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688781443;\n x=1691373443;\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=pVMuYYiXPDWiOv2Z+Jz+R2cT4LitVH5X/rhmxyaEYlY=;\n b=yg93lInOtp1UxZt3JcpLufzyi8JWatlNnw07rxGbb6DVTUg+5qveqUgakELOhLbSNL\n KEe26FJAAxKc0H0uqlnEoIo0QilviNKh+1sEyAspZ0WU2g63WfpRmmES2fET6QT3/mco\n Uvlie9jD/7mg0mTBU8QP8f2qYb1NuhVvLg7eBJ5peqxlvwm2hZLGLcKBh7pef0Rr46Y9\n MhfP9LiZ+c1mVgmrbWBAZPbVgsFhQKhaqrafnEDmExL0iw42pQacQAYO51SWrdK8+8PL\n bBlou6Nw7JdZxv670uv5mN1d3EaOr8oDDf7CmA/CGCFuwYDoiutwEo+fpL3AfQZw23lH\n GacA==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1688781443; x=1691373443;\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=pVMuYYiXPDWiOv2Z+Jz+R2cT4LitVH5X/rhmxyaEYlY=;\n b=Xy1hO/YKmdNxGjKT2ine/oZpkmfE/X1TIiR/OgyIrJ8SUsKBLCSVoM3yhAtAFSJyjT\n hIPTZzcz4JpTkUfILM6S9zEpa+NDlna6axO0HqYTBbg6gZQZlfThsBM4uCeQ0HtrfZhP\n lNLLPM+gB4nBU0iA4vp7n3Vsq5rqbD8lWRypvRtz5JocOOY08oVxOhUIpfOeTd2jh4x6\n KiL5OQAR58M4JrSiLG8NIYKsNk6MvLlkmdvA1E0+HdHqVCTY94sQ25ivRjBJwrwuGYfm\n KQPyvOLa58K6/Bv6FPtS/7BgelxD603Ue0Z0C1f+MWtPQSbipOqe2SO15UQlDSgOOtDi\n rVtQ==",
        "X-Gm-Message-State": "ABy/qLZzGZiw/s6by6idJghOng+ZBLorKg91ElaN5qkI0YV2s4Gg2aPc\n CtcCooKkilykfcmo/LXYrMPeGzkmu+wN6D80EHoQRkJJ",
        "X-Google-Smtp-Source": "\n APBJJlF5SYQ6RsDbDV3xcUHjog1jhgCCLr7xQ6gwYyQzbKLu3OuDZh+u6viZp5o9Ttv6/ALGvULKvg==",
        "X-Received": "by 2002:a05:6870:e410:b0:1b4:624a:105b with SMTP id\n n16-20020a056870e41000b001b4624a105bmr2843735oag.10.1688781443697;\n Fri, 07 Jul 2023 18:57:23 -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 v5 03/11] test/crypto_dev: use rte_pktmbuf_mtod_offset",
        "Date": "Fri,  7 Jul 2023 18:57:10 -0700",
        "Message-Id": "<20230708015718.75565-4-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230708015718.75565-1-stephen@networkplumber.org>",
        "References": "<20230505174813.133894-1-stephen@networkplumber.org>\n <20230708015718.75565-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": "Replace explicit packet offset computations with rte_pktmbuf_mtod_offset().\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n app/test/test_cryptodev.c | 83 +++++++++++++++++++++++++--------------\n 1 file changed, 53 insertions(+), 30 deletions(-)",
    "diff": "diff --git a/app/test/test_cryptodev.c b/app/test/test_cryptodev.c\nindex fb2af40b99ee..549afe252d54 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@@ -5020,6 +5026,7 @@ test_snow3g_auth_cipher(const struct snow3g_test_data *tdata,\n \tunsigned int plaintext_len;\n \tunsigned int ciphertext_pad_len;\n \tunsigned int ciphertext_len;\n+\tunsigned int digest_offset;\n \n \tstruct rte_cryptodev_info dev_info;\n \n@@ -5163,9 +5170,12 @@ 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\tif (tdata->digest.offset_bytes == 0)\n+\t\t\tdigest_offset = plaintext_pad_len;\n+\t\telse\n+\t\t\tdigest_offset = tdata->digest.offset_bytes;\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *, digest_offset);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -5432,6 +5442,7 @@ test_kasumi_auth_cipher(const struct kasumi_test_data *tdata,\n \tunsigned int plaintext_len;\n \tunsigned int ciphertext_pad_len;\n \tunsigned int ciphertext_len;\n+\tunsigned int digest_offset;\n \n \tstruct rte_cryptodev_info dev_info;\n \n@@ -5577,10 +5588,12 @@ 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\tif (tdata->digest.offset_bytes == 0)\n+\t\t\tdigest_offset = plaintext_pad_len;\n+\t\telse\n+\t\t\tdigest_offset = tdata->digest.offset_bytes;\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t\t    uint8_t *, digest_offset);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -5924,8 +5937,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 +6358,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@@ -6380,6 +6395,7 @@ test_zuc_auth_cipher(const struct wireless_test_data *tdata,\n \tunsigned int plaintext_len;\n \tunsigned int ciphertext_pad_len;\n \tunsigned int ciphertext_len;\n+\tunsigned int digest_offset;\n \n \tstruct rte_cryptodev_info dev_info;\n \n@@ -6531,10 +6547,12 @@ 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\tif (tdata->digest.offset_bytes == 0)\n+\t\t\tdigest_offset = plaintext_pad_len;\n+\t\telse\n+\t\t\tdigest_offset =  tdata->digest.offset_bytes;\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t    uint8_t *, digest_offset);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\ttdata->digest.len);\n@@ -7819,6 +7837,7 @@ test_mixed_auth_cipher(const struct mixed_cipher_auth_test_data *tdata,\n \tunsigned int plaintext_len;\n \tunsigned int ciphertext_pad_len;\n \tunsigned int ciphertext_len;\n+\tunsigned int digest_offset;\n \n \tstruct rte_cryptodev_info dev_info;\n \tstruct rte_crypto_op *op;\n@@ -7959,9 +7978,13 @@ 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\tif (tdata->digest_enc.offset == 0)\n+\t\t\tdigest_offset = plaintext_pad_len;\n+\t\telse\n+\t\t\tdigest_offset = tdata->digest_enc.offset;\n+\n+\t\tut_params->digest = rte_pktmbuf_mtod_offset(ut_params->obuf,\n+\t\t\t\t\t    uint8_t *, digest_offset);\n \n \t\tdebug_hexdump(stdout, \"digest:\", ut_params->digest,\n \t\t\t\ttdata->digest_enc.len);\n",
    "prefixes": [
        "v5",
        "03/11"
    ]
}