From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 2454342DFC; Sat, 8 Jul 2023 03:58:12 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C7E7D42D43; Sat, 8 Jul 2023 03:57:33 +0200 (CEST) Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) by mails.dpdk.org (Postfix) with ESMTP id 43CAC42D10 for ; Sat, 8 Jul 2023 03:57:30 +0200 (CEST) Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1b8ad8383faso17235475ad.0 for ; Fri, 07 Jul 2023 18:57:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688781449; x=1691373449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Tr60IFz06evUwuSm5/a873eV74kheh+Fl+sWvdw5isU=; b=av+HRK6SUvgYXf/6g6WFpUnqbuXKKS7fSQq1VhcU9SMPXVqKj7MxA+gAIOXyZC/5Aj ziYqADwys7hbyWlxrWiZOWmhPyJNZU/gu+jY41p6jbp7A6PzLo6PR5yqnA6VEsWMfwwC SYUPx/HVEI/UojkwlJjQ4H3mxvvEwWrNKOQh8NlHXLl5t6/n/DzUw7B64xvbBtMWJrA3 S4OAwu2bWpuykfhJ3p5upsoyrqE/j84Y0LpTSetQehoNxHswvxE1JvtbAOAYOFDHSVzK HDHFyTKwKVYkBBrodkh6ha8jr/KihHDQLz88vkgz3JVqNxA2JNqW/kc8CIgzu63CaNw+ TOLg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688781449; x=1691373449; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Tr60IFz06evUwuSm5/a873eV74kheh+Fl+sWvdw5isU=; b=GUkwEY7QjiVIeIw0wAvewe+7IVEr3kY5kxDC0ftxD/PFUnMeFUOXXlNbJ9O1vAkjRL l0ouwzXmLxw4IleZIIKhVmFTwAr0EwpK0e36js9+ACTNw4KLY3kCXbRt8c8X54FnEInE QE+dBAW3gHN30SQEPI7nDY8f74+YTJXfzwdBq82Jq798T7KqKC57oPtLOJx5Dw62PNcg wRVn5FUC6bMwFpTiNDDE+v6KeTfPn7GTxc5X2XCQQWqvAQcU8xf0kcP+eJ1rLLkco+qE GxBIYBXnRFphawTs+KARtOjejtKOIKFv8GI9tNU62kFyUvB9l/Q7rt2wQLeuG6BG7Ddn NlhQ== X-Gm-Message-State: ABy/qLY79tdW3Dtr0T/eN/PIyW4o9mEUdKoOygzonh0A30lXxpJ66C6E 4kjf8Me307l14UX2MUQhcujKBWZDf6xF8MIPQ3/VqH5j X-Google-Smtp-Source: APBJJlGLHw9FpELQQ0wO9vwFXfM0cZ4ss737AnG1ZmESNE4rMhiGN6Lw99d+qlE7pDjqg9zYbWlE2A== X-Received: by 2002:a17:902:b20b:b0:1b1:9233:bbf5 with SMTP id t11-20020a170902b20b00b001b19233bbf5mr6162075plr.57.1688781449193; Fri, 07 Jul 2023 18:57:29 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id 24-20020a17090a035800b00263f5ac814esm2260269pjf.38.2023.07.07.18.57.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 18:57:28 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Anoob Joseph Subject: [PATCH v5 08/11] cpt: use rte_pktmbuf_mtod_offset Date: Fri, 7 Jul 2023 18:57:15 -0700 Message-Id: <20230708015718.75565-9-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> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace explicit packet offset computations with rte_pktmbuf_mtod_offset(). Signed-off-by: Stephen Hemminger --- drivers/common/cpt/cpt_ucode.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/common/cpt/cpt_ucode.h b/drivers/common/cpt/cpt_ucode.h index b393be4cf661..87a3ac80b9da 100644 --- a/drivers/common/cpt/cpt_ucode.h +++ b/drivers/common/cpt/cpt_ucode.h @@ -3167,9 +3167,8 @@ fill_fc_params(struct rte_crypto_op *cop, m = m_src; /* hmac immediately following data is best case */ - if (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + - mc_hash_off != - (uint8_t *)sym_op->aead.digest.data)) { + if (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != + (uint8_t *)sym_op->aead.digest.data)) { flags |= VALID_MAC_BUF; fc_params.mac_buf.size = sess_misc->mac_len; fc_params.mac_buf.vaddr = @@ -3211,9 +3210,8 @@ fill_fc_params(struct rte_crypto_op *cop, /* hmac immediately following data is best case */ if (!ctx->dec_auth && !ctx->auth_enc && - (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + - mc_hash_off != - (uint8_t *)sym_op->auth.digest.data))) { + (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != + (uint8_t *)sym_op->auth.digest.data))) { flags |= VALID_MAC_BUF; fc_params.mac_buf.size = sess_misc->mac_len; -- 2.39.2