Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/129358/?format=api
http://patchwork.dpdk.org/api/patches/129358/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230706175938.62721-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": "<20230706175938.62721-9-stephen@networkplumber.org>", "list_archive_url": "https://inbox.dpdk.org/dev/20230706175938.62721-9-stephen@networkplumber.org", "date": "2023-07-06T17:59:32", "name": "[v3,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/20230706175938.62721-9-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/129358/comments/", "check": "success", "checks": "http://patchwork.dpdk.org/api/patches/129358/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 5C58042DEC;\n\tThu, 6 Jul 2023 20:00:38 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 3394C43025;\n\tThu, 6 Jul 2023 19:59:53 +0200 (CEST)", "from mail-pj1-f44.google.com (mail-pj1-f44.google.com\n [209.85.216.44]) by mails.dpdk.org (Postfix) with ESMTP id A839943013\n for <dev@dpdk.org>; Thu, 6 Jul 2023 19:59:49 +0200 (CEST)", "by mail-pj1-f44.google.com with SMTP id\n 98e67ed59e1d1-2633fe9b6c0so1562399a91.1\n for <dev@dpdk.org>; Thu, 06 Jul 2023 10:59:49 -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.47\n (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n Thu, 06 Jul 2023 10:59:47 -0700 (PDT)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688666388;\n x=1691258388;\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=yFo23NqGGV1OFDtS9nAxYN+AigYTvhxy3IyacoRh6Xs=;\n b=SrMSMaRgjqeFIwS3xAJM/YMne13LILcc9Ms/7l361U1GSULnyRW4iUyc8rcGL0/nHa\n eT22nu+I4pKBC9RTyqHqZMh9IZco6sEHp63mIPikqGjBn6XtISaW8bFJath70+85xEr2\n FBABjGUIqdrAkuJFWGL2DoWcYTp+8BNlAZUs9qLFljTAxdrvl9Hjwcyb/lJmt7O0h61k\n mOiRtrtpARVkUWfhw2RyEDUPzp9IYe6+2Gg1oWhGp1UlJBr/Dmk9sJje+U0AbdSeblD0\n Hq1UahXHj3M0b//KtLXJpFlsGeelZzP44KB0ReJ/gsXmUcXNy9Jxm6ufU/IQKpkOl7zZ\n rQlg==", "X-Google-DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed;\n d=1e100.net; s=20221208; t=1688666388; x=1691258388;\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=yFo23NqGGV1OFDtS9nAxYN+AigYTvhxy3IyacoRh6Xs=;\n b=EvpbDUmLC+VwYi5XhjJVFqYX7CeAGzaUUaXT6HZf/xQiPdSIGmq0zRutFLpXp9n3RW\n 0FL1qyjkuJvjgfUPgBFiPDYmcxb2f8BYy2sMYrUaoD/g0Alf2bqujrFw3fKaDdpQeBRb\n wJoSshXDiI122la7yErWw3WRh13MjJE7vfDvj+EKyh1OSu/wJxT4BzInjOtnftE4YiKQ\n 99WD1Z4/KH6o7GUQDgRlSmgcj+yA8/kzlzGocQDYAhe7fau+e/LbE8BNatZ/vh7KNLcN\n izDUB/WhILX4FV5MWUZepHBcgA5oSfejGN+uXvUIZAYbkKcRq1nbQRJtaJLMa8KG6l8J\n YXEg==", "X-Gm-Message-State": "ABy/qLZ2pMjPCi/AXgkySWM1Ld3rxq4KNVuKQU2O3vFFOxAKaoDXWcg3\n kGUb0Dy5hMHwJ6JSswcl+lNZLTKiConJ67Z68Lg=", "X-Google-Smtp-Source": "\n APBJJlHtd2jGwG1z7uvoqqiUbRPAFvxtxg81/CpyFMl14i94SIAkPCGXEd9v/XwDNekOFYfGsyUGtw==", "X-Received": "by 2002:a17:90a:f40a:b0:263:f674:490e with SMTP id\n ch10-20020a17090af40a00b00263f674490emr7592288pjb.3.1688666388226;\n Thu, 06 Jul 2023 10:59:48 -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 v3 08/14] crypto/ipsec_mb: use rte_pktmbuf_mtod_offset", "Date": "Thu, 6 Jul 2023 10:59:32 -0700", "Message-Id": "<20230706175938.62721-9-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": "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 e64df1a462e3..90b8d80c2c56 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": [ "v3", "08/14" ] }{ "id": 129358, "url": "