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 B0B8642DEC; Thu, 6 Jul 2023 20:00:55 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 05BFA43030; Thu, 6 Jul 2023 19:59:56 +0200 (CEST) Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) by mails.dpdk.org (Postfix) with ESMTP id E2FCD42FFA for ; Thu, 6 Jul 2023 19:59:51 +0200 (CEST) Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-55bac17b442so789799a12.3 for ; Thu, 06 Jul 2023 10:59:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1688666391; x=1691258391; 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=MBCfTzrQCaLhh1CsP3RNdM8gjnCX83G/7DXyKdl+zeA=; b=IVSdVn33kXt6oICLjc8vneD4HgysHz9OW+Rpo3PbmBdDoq/CuMfW9m1hekmswtJU7U jR5CGNWCL6Iw9YrBZCxPA6KGLn6pYcnjkY04DNeux6zm8/DkP9m4DUfTYt/1gXqaIkD0 xDysA62t+M0fIccFjEIiiyZXQf2kuSJRPHHCSVvvYWRGdbzJO8eLEizQir1jL3PIEIpb WpYGPRZIYssJls+V/o7iXRE7usDpGvYCQNPP7iQHvG5jf0OC3RsqD+za2DwS4HTNhjix Hfq32BOGoPVV360viELWoWwlTG5cxvCxb5LECMibbyv8lEBiCeJmiyjIjLnN8GZUN5EZ bqbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688666391; x=1691258391; 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=MBCfTzrQCaLhh1CsP3RNdM8gjnCX83G/7DXyKdl+zeA=; b=PXBNoBTmTyT39AG7VqcMLGQzpJcn/QliyammRj6Ek8FAWutz4e3IVkN33UJQBB6yHM wz3PfYgf3aufy5rqOvWvY7+TKQtpXsQH9AZFplYKpZFluuwEKdcbAPMgziwagfuTiywt /p8S48oPIjGACvmtbSFE3kde6jabpPfZ2CtI3MdnfHJz3E8pWKoaMHjH0wmS5JPwauVR 8+LQOCCg3OaGbRFeU+BDPZF7gKVPmFF2WqS+nr3hmt3WGQJttiaXoMO6dQMrXArACpXh PCDAscfVaLMwZ08pn0blJnoQxPC1XT/Uy/uDnKIk/2Cwfmj7oFz+UoKAkcf3qiEWZgLn Na9Q== X-Gm-Message-State: ABy/qLanYg7Uz2Nt1/D33m6rbi4R/EufIZeFs3cEJIb8i9ZLL8fmWZNN XkUFyyI9fspQhp+8PoUuljCRsGiRbytYJxhYcGE= X-Google-Smtp-Source: APBJJlGqlggAScpIIKe4Fe9QptVtCzbMS781o1Ekox73Zc3I8aAwAFk9aRCRkwTBgJhLdIVERMPGeQ== X-Received: by 2002:a17:90b:390d:b0:262:f99b:a530 with SMTP id ob13-20020a17090b390d00b00262f99ba530mr2460735pjb.34.1688666390934; Thu, 06 Jul 2023 10:59:50 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id nh8-20020a17090b364800b00256bbfbabcfsm76464pjb.48.2023.07.06.10.59.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jul 2023 10:59:50 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj Subject: [PATCH v3 10/14] crypto/cnxk: use rte_ptkmbuf_mtod_offset Date: Thu, 6 Jul 2023 10:59:34 -0700 Message-Id: <20230706175938.62721-11-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> <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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Autogenerated with cocci/mtod-offset.cocci Signed-off-by: Stephen Hemminger --- drivers/crypto/cnxk/cn9k_cryptodev_ops.c | 2 +- drivers/crypto/cnxk/cnxk_se.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c index 34d40b07d4c6..8b91d11b79cc 100644 --- a/drivers/crypto/cnxk/cn9k_cryptodev_ops.c +++ b/drivers/crypto/cnxk/cn9k_cryptodev_ops.c @@ -520,7 +520,7 @@ cn9k_cpt_sec_post_process(struct rte_crypto_op *cop, if (infl_req->op_flags & CPT_OP_FLAGS_IPSEC_DIR_INBOUND) { - hdr = (struct roc_ie_on_inb_hdr *)rte_pktmbuf_mtod(m, char *); + hdr = rte_pktmbuf_mtod(m, struct roc_ie_on_inb_hdr *); if (likely(m->next == NULL)) { ip = PLT_PTR_ADD(hdr, ROC_IE_ON_INB_RPTR_HDR); diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 75c1dce231bf..1392af5833d1 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -2724,7 +2724,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, m = cpt_m_dst_get(cpt_op, m_src, m_dst); /* Digest immediately following data is best case */ - if (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + mc_hash_off != + if (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != (uint8_t *)sym_op->aead.digest.data)) { flags |= ROC_SE_VALID_MAC_BUF; fc_params.mac_buf.size = sess->mac_len; @@ -2759,8 +2759,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, /* hmac immediately following data is best case */ if (!(op_minor & ROC_SE_FC_MINOR_OP_HMAC_FIRST) && - (unlikely(rte_pktmbuf_mtod(m, uint8_t *) + - mc_hash_off != + (unlikely(rte_pktmbuf_mtod_offset(m, uint8_t *, mc_hash_off) != (uint8_t *)sym_op->auth.digest.data))) { flags |= ROC_SE_VALID_MAC_BUF; fc_params.mac_buf.size = sess->mac_len; -- 2.39.2