get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 126737,
    "url": "http://patchwork.dpdk.org/api/patches/126737/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230506160404.7423-9-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": "<20230506160404.7423-9-stephen@networkplumber.org>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230506160404.7423-9-stephen@networkplumber.org",
    "date": "2023-05-06T16:03:57",
    "name": "[v2,08/14] crypto/ipsec_mb: use rte_pktmbuf_mtod_offset",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c64745ada8a1caec09a72b285fbc72fe987c466e",
    "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/20230506160404.7423-9-stephen@networkplumber.org/mbox/",
    "series": [
        {
            "id": 27946,
            "url": "http://patchwork.dpdk.org/api/series/27946/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=27946",
            "date": "2023-05-06T16:03:49",
            "name": "rte_pktmbuf_mtod_offset usage",
            "version": 2,
            "mbox": "http://patchwork.dpdk.org/series/27946/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/126737/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/126737/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 6FA9642A7F;\n\tSat,  6 May 2023 18:05:12 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 118E242D3A;\n\tSat,  6 May 2023 18:04:18 +0200 (CEST)",
            "from mail-pf1-f174.google.com (mail-pf1-f174.google.com\n [209.85.210.174])\n by mails.dpdk.org (Postfix) with ESMTP id 2E0C242D49\n for <dev@dpdk.org>; Sat,  6 May 2023 18:04:15 +0200 (CEST)",
            "by mail-pf1-f174.google.com with SMTP id\n d2e1a72fcca58-644d9bf05b7so72317b3a.3\n for <dev@dpdk.org>; Sat, 06 May 2023 09:04:15 -0700 (PDT)",
            "from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218])\n by smtp.gmail.com with ESMTPSA id\n e14-20020a62ee0e000000b006436ffa3dc4sm3369890pfi.24.2023.05.06.09.04.13\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Sat, 06 May 2023 09:04:13 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683389054;\n x=1685981054;\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=QvRhXk3rillMcSGpDtB3lskZp5ZIwq//FgzWohZ426M=;\n b=hUMwvzgE+TKxPCddFleXjj94e4NhFc7LfO+H8Gq9Y+MNB95VTTNOdrDOozv/MBMBu1\n ZOdD+WJgWlR5hN8BhdQTR5+GFsZskwGONWox0Hzda0oEgsbk7ftYRRNwRB1z0tFjvE0I\n Q6k2mWvx7Nv3lyVfhF4vebg8ei4rEAsKbCg3ONGHep/9O7PqcKcDMtZS+kUEXLTYTTmn\n r2jJ3dHJt5GA3lc+NDZwXPldYReUpMbXwl4zrBgQTBU07gjwOga7yxnLaFb67pajt1eG\n p4SmPIn9fwQS2wXl44DVGsinXE0W4DQuTsSlSErquB2RED2KnbC0kyOfgDkFCIYNwDxy\n zJXg==",
        "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1683389054; x=1685981054;\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=QvRhXk3rillMcSGpDtB3lskZp5ZIwq//FgzWohZ426M=;\n b=RytdY8zPQJ254L9e7wWU0aE67CWzs1br6Fp4ArW2R/EqfAsxDKC/WmRpzTWDwLFMZe\n VBl2EJ26edWtw1cB4Cqsqtq0Fu36EXVSqckjE8G3i9MMPdmmi3ek6OcbrGAbZp9ELBKX\n VjF4Pgqv6/iDUH+ua0q0oCORLjIPBVKIQlepSVuvBXS6KRO82Muh7icwtcD19wl71BND\n c03VulFgSv39MHc/KQ7GECXP1UGfD7Mbl2/KbQ+jESS6vaLjbocIvOGPZ4rETg2quy1i\n ndrfjeSOxHJbjqZo6651Vif6csXpV0sogiSuU1Xf49NjXq5bboyUVaAcVn54GPZBYsEn\n ALAA==",
        "X-Gm-Message-State": "AC+VfDz1CovbAxjwXafa71llib3rGTAtM39ie/tyKIPWWFDppkjsz8rr\n oE9KiL0IqpGWQTbu6fGUFLlBqPzPc/QQFXAz/SlXkA==",
        "X-Google-Smtp-Source": "\n ACHHUZ6CqmF3OWJzj1N0nucr4dhTtWMaabsEI8IKmhthEztmXjz2h4LJNBe97woGya2pK3LoWA21gQ==",
        "X-Received": "by 2002:aa7:88c4:0:b0:643:958e:f75 with SMTP id\n k4-20020aa788c4000000b00643958e0f75mr6887212pff.31.1683389054096;\n Sat, 06 May 2023 09:04:14 -0700 (PDT)",
        "From": "Stephen Hemminger <stephen@networkplumber.org>",
        "To": "dev@dpdk.org",
        "Cc": "Stephen Hemminger <stephen@networkplumber.org>, Kai Ji <kai.ji@intel.com>,\n Pablo de Lara <pablo.de.lara.guarch@intel.com>",
        "Subject": "[PATCH v2 08/14] crypto/ipsec_mb: use rte_pktmbuf_mtod_offset",
        "Date": "Sat,  6 May 2023 09:03:57 -0700",
        "Message-Id": "<20230506160404.7423-9-stephen@networkplumber.org>",
        "X-Mailer": "git-send-email 2.39.2",
        "In-Reply-To": "<20230506160404.7423-1-stephen@networkplumber.org>",
        "References": "<20230505174813.133894-1-stephen@networkplumber.org>\n <20230506160404.7423-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": "Initial patch generated with cocci/mtod-offset.\nAdditional manual cleanups to indentation and remove unnecessary\nparenthesis.\n\nSigned-off-by: Stephen Hemminger <stephen@networkplumber.org>\n---\n drivers/crypto/ipsec_mb/pmd_kasumi.c | 16 ++++++-------\n drivers/crypto/ipsec_mb/pmd_snow3g.c | 35 +++++++++++-----------------\n drivers/crypto/ipsec_mb/pmd_zuc.c    | 16 ++++++-------\n 3 files changed, 30 insertions(+), 37 deletions(-)",
    "diff": "diff --git a/drivers/crypto/ipsec_mb/pmd_kasumi.c b/drivers/crypto/ipsec_mb/pmd_kasumi.c\nindex 5db9c523cd9a..5b1694276468 100644\n--- a/drivers/crypto/ipsec_mb/pmd_kasumi.c\n+++ b/drivers/crypto/ipsec_mb/pmd_kasumi.c\n@@ -83,13 +83,13 @@ process_kasumi_cipher_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \tuint32_t num_bytes[num_ops];\n \n \tfor (i = 0; i < num_ops; i++) {\n-\t\tsrc[i] = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *)\n-\t\t\t + (ops[i]->sym->cipher.data.offset >> 3);\n+\t\tsrc[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\tops[i]->sym->cipher.data.offset >> 3);\n \t\tdst[i] = ops[i]->sym->m_dst\n-\t\t\t     ? rte_pktmbuf_mtod(ops[i]->sym->m_dst, uint8_t *)\n-\t\t\t\t   + (ops[i]->sym->cipher.data.offset >> 3)\n-\t\t\t     : rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *)\n-\t\t\t\t   + (ops[i]->sym->cipher.data.offset >> 3);\n+\t\t\t     ? rte_pktmbuf_mtod_offset(ops[i]->sym->m_dst, uint8_t *,\n+\t\t\t\t\t\t       ops[i]->sym->cipher.data.offset >> 3)\n+\t\t\t     : rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t\t       ops[i]->sym->cipher.data.offset >> 3);\n \t\tiv_ptr = rte_crypto_op_ctod_offset(ops[i], uint8_t *,\n \t\t\t\t\t\t    session->cipher_iv_offset);\n \t\tiv[i] = *((uint64_t *)(iv_ptr));\n@@ -155,8 +155,8 @@ process_kasumi_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \n \t\tlength_in_bits = ops[i]->sym->auth.data.length;\n \n-\t\tsrc = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *)\n-\t\t      + (ops[i]->sym->auth.data.offset >> 3);\n+\t\tsrc = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t      ops[i]->sym->auth.data.offset >> 3);\n \t\t/* Direction from next bit after end of message */\n \t\tnum_bytes = length_in_bits >> 3;\n \ndiff --git a/drivers/crypto/ipsec_mb/pmd_snow3g.c b/drivers/crypto/ipsec_mb/pmd_snow3g.c\nindex 8ed069f42860..f6e51916e1fd 100644\n--- a/drivers/crypto/ipsec_mb/pmd_snow3g.c\n+++ b/drivers/crypto/ipsec_mb/pmd_snow3g.c\n@@ -111,14 +111,12 @@ process_snow3g_cipher_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \n \t\tcipher_off = ops[i]->sym->cipher.data.offset >> 3;\n \t\tcipher_len = ops[i]->sym->cipher.data.length >> 3;\n-\t\tsrc[i] = rte_pktmbuf_mtod_offset(\n-\t\t\tops[i]->sym->m_src,\tuint8_t *, cipher_off);\n+\t\tsrc[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *, cipher_off);\n \n \t\t/* If out-of-place operation */\n \t\tif (ops[i]->sym->m_dst &&\n \t\t\tops[i]->sym->m_src != ops[i]->sym->m_dst) {\n-\t\t\tdst[i] = rte_pktmbuf_mtod_offset(\n-\t\t\t\tops[i]->sym->m_dst, uint8_t *, cipher_off);\n+\t\t\tdst[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_dst, uint8_t *, cipher_off);\n \n \t\t\t/* In case of out-of-place, auth-cipher operation\n \t\t\t * with partial encryption of the digest, copy\n@@ -133,16 +131,14 @@ process_snow3g_cipher_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \t\t\t\t\tcipher_off - cipher_len;\n \t\t\tif (unencrypted_bytes > 0)\n \t\t\t\trte_memcpy(\n-\t\t\t\t\trte_pktmbuf_mtod_offset(\n-\t\t\t\t\t\tops[i]->sym->m_dst, uint8_t *,\n+\t\t\t\t\trte_pktmbuf_mtod_offset(ops[i]->sym->m_dst, uint8_t *,\n \t\t\t\t\t\tcipher_off + cipher_len),\n-\t\t\t\t\trte_pktmbuf_mtod_offset(\n-\t\t\t\t\t\tops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\trte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n \t\t\t\t\t\tcipher_off + cipher_len),\n \t\t\t\t\tunencrypted_bytes);\n \t\t} else\n-\t\t\tdst[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src,\n-\t\t\t\t\t\tuint8_t *, cipher_off);\n+\t\t\tdst[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t\tcipher_off);\n \n \t\tiv[i] = rte_crypto_op_ctod_offset(ops[i], uint8_t *,\n \t\t\t\tsession->cipher_iv_offset);\n@@ -205,13 +201,11 @@ process_snow3g_cipher_op_bit(struct ipsec_mb_qp *qp,\n \t\t\t(length_in_bits >> 3);\n \tif (unencrypted_bytes > 0)\n \t\trte_memcpy(\n-\t\t\trte_pktmbuf_mtod_offset(\n-\t\t\t\top->sym->m_dst, uint8_t *,\n-\t\t\t\t(length_in_bits >> 3)),\n-\t\t\trte_pktmbuf_mtod_offset(\n-\t\t\t\top->sym->m_src, uint8_t *,\n-\t\t\t\t(length_in_bits >> 3)),\n-\t\t\t\tunencrypted_bytes);\n+\t\t\trte_pktmbuf_mtod_offset(op->sym->m_dst, uint8_t *,\n+\t\t\t\tlength_in_bits >> 3),\n+\t\t\trte_pktmbuf_mtod_offset(op->sym->m_src, uint8_t *,\n+\t\t\t\tlength_in_bits >> 3),\n+\t\t\tunencrypted_bytes);\n \n \tiv = rte_crypto_op_ctod_offset(op, uint8_t *,\n \t\t\t\tsession->cipher_iv_offset);\n@@ -248,8 +242,8 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \n \t\tlength_in_bits = ops[i]->sym->auth.data.length;\n \n-\t\tsrc = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +\n-\t\t\t\t(ops[i]->sym->auth.data.offset >> 3);\n+\t\tsrc = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t      ops[i]->sym->auth.data.offset >> 3);\n \t\tiv = rte_crypto_op_ctod_offset(ops[i], uint8_t *,\n \t\t\t\tsession->auth_iv_offset);\n \n@@ -261,8 +255,7 @@ process_snow3g_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \t\t\t\tsession->op ==\n \t\t\t\tIPSEC_MB_OP_DECRYPT_THEN_HASH_VERIFY) &&\n \t\t\t\tops[i]->sym->m_dst != NULL)\n-\t\t\t\tsrc = rte_pktmbuf_mtod_offset(\n-\t\t\t\t\tops[i]->sym->m_dst, uint8_t *,\n+\t\t\t\tsrc = rte_pktmbuf_mtod_offset(ops[i]->sym->m_dst, uint8_t *,\n \t\t\t\t\tops[i]->sym->auth.data.offset >> 3);\n \n \t\t\tIMB_SNOW3G_F9_1_BUFFER(qp->mb_mgr,\ndiff --git a/drivers/crypto/ipsec_mb/pmd_zuc.c b/drivers/crypto/ipsec_mb/pmd_zuc.c\nindex 92fd9d180894..65b00e80390e 100644\n--- a/drivers/crypto/ipsec_mb/pmd_zuc.c\n+++ b/drivers/crypto/ipsec_mb/pmd_zuc.c\n@@ -107,13 +107,13 @@ process_zuc_cipher_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \t\t}\n #endif\n \n-\t\tsrc[i] = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +\n-\t\t\t\t(ops[i]->sym->cipher.data.offset >> 3);\n+\t\tsrc[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t\t ops[i]->sym->cipher.data.offset >> 3);\n \t\tdst[i] = ops[i]->sym->m_dst ?\n-\t\t\trte_pktmbuf_mtod(ops[i]->sym->m_dst, uint8_t *) +\n-\t\t\t\t(ops[i]->sym->cipher.data.offset >> 3) :\n-\t\t\trte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +\n-\t\t\t\t(ops[i]->sym->cipher.data.offset >> 3);\n+\t\t\trte_pktmbuf_mtod_offset(ops[i]->sym->m_dst, uint8_t *,\n+\t\t\t\t\t\tops[i]->sym->cipher.data.offset >> 3) :\n+\t\t\trte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t\tops[i]->sym->cipher.data.offset >> 3);\n \t\tiv[i] = rte_crypto_op_ctod_offset(ops[i], uint8_t *,\n \t\t\t\tsess->cipher_iv_offset);\n \t\tnum_bytes[i] = ops[i]->sym->cipher.data.length >> 3;\n@@ -159,8 +159,8 @@ process_zuc_hash_op(struct ipsec_mb_qp *qp, struct rte_crypto_op **ops,\n \n \t\tlength_in_bits[i] = ops[i]->sym->auth.data.length;\n \n-\t\tsrc[i] = rte_pktmbuf_mtod(ops[i]->sym->m_src, uint8_t *) +\n-\t\t\t\t(ops[i]->sym->auth.data.offset >> 3);\n+\t\tsrc[i] = rte_pktmbuf_mtod_offset(ops[i]->sym->m_src, uint8_t *,\n+\t\t\t\t\t\t ops[i]->sym->auth.data.offset >> 3);\n \t\tiv[i] = rte_crypto_op_ctod_offset(ops[i], uint8_t *,\n \t\t\t\tsess->auth_iv_offset);\n \n",
    "prefixes": [
        "v2",
        "08/14"
    ]
}