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 4515E42A49; Fri, 5 May 2023 19:49:25 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 970E542D6C; Fri, 5 May 2023 19:48:30 +0200 (CEST) Received: from mail-pf1-f175.google.com (mail-pf1-f175.google.com [209.85.210.175]) by mails.dpdk.org (Postfix) with ESMTP id 95B4442D50 for ; Fri, 5 May 2023 19:48:28 +0200 (CEST) Received: by mail-pf1-f175.google.com with SMTP id d2e1a72fcca58-6434e263962so1632023b3a.2 for ; Fri, 05 May 2023 10:48:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683308908; x=1685900908; 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=3JNbmOj/kxR6KK8Mmve538lK6RzM1/W7f2cVClHKagI=; b=JvXhW5pyax5Vle/weAVnubeLfywciAgX4EA5hAUEwnW6178ekgO1qcBPLzR/7IZKBb 42ij7mdlkfQq/2qFaM5A2v9SirFpCV60Ew182Zb2PqDf7Dx8WhABNnMbEZI1SeSoRBtc fQd6jU6xOLeQ98DT19/vQbnUQJLRJnXECa/o3Dr7lh0HlXTv1WO1zlTbPeddEJm53oWB FQ7+scfKksG8kFEPc6etWhjlpfRT90q+zDn0Buw4kCTxaf1abiNpEevhcmcZUtS5zKBU fkulhnVG9LCF1wg8LnTa8nMX9fe4aUG4MW0qQZ7PkQGrDtbgX7BfpsWR75vKeWvZHx9h EvVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683308908; x=1685900908; 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=3JNbmOj/kxR6KK8Mmve538lK6RzM1/W7f2cVClHKagI=; b=gYF2NGFrkVeZRyM3tlRVSYF6uschiMqsgPly0HwPGfl5qjCgcXTFHrNkxF4LmeETnt kMvTIdfZSqrOzfl0W6nhpaY3vxpKckt1mHlNO3/8/WPOOm70eiQbOpcpJ3hjXlPJh0X2 n/CjR6bsoROZOujb4FlOv+LJ2a2/IgUSFfB3on9+yLScA3mUb0lD+iyZmhZxEJpUvGp3 9F7YEG4A6mk37CcKYvDG66rkdLnnmi3v9NokBqNH1CBrP3UimuY3rESeBPZkj+luHNE0 /R3iexc9kAlztTs0dIS+XLBNwJPyVMn5frVDTT2A5NL2JsI5NPGuZ2utPGwZ91mpB04L uxEw== X-Gm-Message-State: AC+VfDxntuDDdoYvMnKHxFTk6uT70auXsEOOC2rjnMYi9IIZqRIAxsi9 q/mzNy4mdS2BNTlQxQWWdhutb3jZJxsEdPT/xj3qAA== X-Google-Smtp-Source: ACHHUZ6q7Gl2QE0eXKb9J+lpMY4oJ5fr1hLBJSrUCQCFqmVF89hgKgssK3w8DXz8XFvMkHR3iZo0RQ== X-Received: by 2002:a05:6a00:803:b0:63d:3ae1:e3ba with SMTP id m3-20020a056a00080300b0063d3ae1e3bamr3411447pfk.6.1683308907918; Fri, 05 May 2023 10:48:27 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id a15-20020aa780cf000000b0063799398eb9sm1895707pfn.58.2023.05.05.10.48.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 05 May 2023 10:48:27 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj Subject: [PATCH 10/14] crypto/cnxk: use rte_ptkmbuf_mtod_offset Date: Fri, 5 May 2023 10:48:09 -0700 Message-Id: <20230505174813.133894-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230505174813.133894-1-stephen@networkplumber.org> References: <20230505174813.133894-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 69cd343eea1b..d493e1b1880c 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -2275,7 +2275,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; @@ -2310,8 +2310,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