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 4251742DFC; Fri, 7 Jul 2023 22:40:03 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 157F242D40; Fri, 7 Jul 2023 22:39:24 +0200 (CEST) Received: from mail-pg1-f178.google.com (mail-pg1-f178.google.com [209.85.215.178]) by mails.dpdk.org (Postfix) with ESMTP id E6A9742D13 for ; Fri, 7 Jul 2023 22:39:19 +0200 (CEST) Received: by mail-pg1-f178.google.com with SMTP id 41be03b00d2f7-55b66ca1c80so1310157a12.0 for ; Fri, 07 Jul 2023 13:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688762359; x=1691354359; 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=IOZCUTcwkWyLQNBLfIapRslWLVsaJ7g8a3zVTaWjDsLApcnHXFUusp9xzLuoKc6+Wb KDyodAPuZpsSPYKXEJnlVLc/EIf7WXKzSY+0fPYLtMBnwyv1Gm1QN07zVu3SnQdjmr3d 9BQM5fPYCdSXu1HVLRklbPgWaOwPLtloEIjpTtD8JrbQa8peWCBM+aeRIxfdOpC/EDLN B14FAfemNPRcZmP/C9AfSz7oKXTswS7On2Wby1l3itjk8W+ki/II02BppRjTRxVY1+uD BHgsRqI6oSttzpkr4mE7nxWuugRo4z27U447mzJpcJ1Gz6VXb1WOKpVKa36r1D+DclVU HPKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688762359; x=1691354359; 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=fpAyQ2M6WQklh6+zt97u5vy89Qqmzm4imMk3VRccMAVeBuRJVDzh3bXgYN/2OgwgrQ mOEnxaxec8vJawi7R1NGRqkcwV5ms8ILONVA2d/PbDrY5YeBbJ5tgTxQ2dUcTG0R9Kak gzFzvnMvoPYZd86rDfwl/ar6mWXPqrWSTRDw+v9qfs0sZ7XjBBTPoR0uLULZrZOS+p13 YD2eiT2nT9BpNVxZ09MnYL97s3fa6KwjrDIOTtV6g6/kZwsAao+8hlwLGpRfvIH4bg1Z P7gsCpj60xMtJthFjvd7rLeJN2xtmNMZRjXRQMAtvmBWCKS4kxHqIx9MC7pYwqN2jNnS WKzQ== X-Gm-Message-State: ABy/qLbyX4GoEbHEUr7MCmntyiu4JuXCFMCFMC3HelkI+OQ2V5CdU5tC PfDzVI66j8DtudFMexaH1SLz/A0mQtSG7xmMUTrC2h/F X-Google-Smtp-Source: APBJJlE1+nzrR5e6U61yWJNGLAc0/63KredgJ3QSF5JGHGXrDKOBMVuOPeOIXX85eCLkjQ6OxxNxUw== X-Received: by 2002:a05:6a21:3386:b0:12e:4f6b:d27d with SMTP id yy6-20020a056a21338600b0012e4f6bd27dmr5774330pzb.33.1688762358900; Fri, 07 Jul 2023 13:39:18 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id t15-20020a170902b20f00b001b83db0bcf2sm3640493plr.141.2023.07.07.13.39.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 07 Jul 2023 13:39:18 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Anoob Joseph Subject: [PATCH v4 08/11] cpt: use rte_pktmbuf_mtod_offset Date: Fri, 7 Jul 2023 13:39:05 -0700 Message-Id: <20230707203908.64371-9-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230707203908.64371-1-stephen@networkplumber.org> References: <20230505174813.133894-1-stephen@networkplumber.org> <20230707203908.64371-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