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 66A7D42A7F; Sat, 6 May 2023 18:05:30 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C5E4842D69; Sat, 6 May 2023 18:04:20 +0200 (CEST) Received: from mail-pg1-f172.google.com (mail-pg1-f172.google.com [209.85.215.172]) by mails.dpdk.org (Postfix) with ESMTP id EBD3E42D52 for ; Sat, 6 May 2023 18:04:16 +0200 (CEST) Received: by mail-pg1-f172.google.com with SMTP id 41be03b00d2f7-51f6461af24so2014105a12.2 for ; Sat, 06 May 2023 09:04:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20221208.gappssmtp.com; s=20221208; t=1683389056; x=1685981056; 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=n+jOyAaVE2qfOPlWXkfQpeE8Ew2hZ6PdBpx4SBIzjMoUqnIEcyIC68DL8VXE561+9D MTE4Ilk2p7W0V7RmIphvkQVKnzks0yAtq09gKIUq7Vi6FBblSo3AbMDpP7AEKWPjJ60U LM6/fG/xohuvgHD9ftnKGwykWIQ0nIWXi2GezogxhF2VRIp+px2rgN35kS6OFSbwXybj vjY+KwzMEobIRhHRPmnmRzKfOvrEb1wbQuoQJX0dFNFTvMKXWVzFGFRCDkPFDmshWG3i ws7Y874Ej5sqrhnQGC42xIYPHREpFgURlC7yC+rb6ewV7oqXFv+SFgnh/rTyFyyosrSc gA0w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683389056; x=1685981056; 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=EWbH1ry1ZvLBYlc/D3pTGFX/F3F+7umMEVaisykIvq3Zwo1nArfbZMXk9EJR93Cjr7 GmfHggqgY23zm7RYdgOtYgY0iNwqKzpArWPQpxijUhCR6XhPBkiKuDRYCde5FWp1YUwW eis8NdzXFW67mODNZk/fqa31x6pi5qinz2C9SBqk0KxQ94u6Y1h6HCpxIPMqkZ1gxGUS 33uSkg2oLJ5VkCJjzvDCkHKZ8kgXKbBnhvBy2fd9n5ImatccUZFJpQC1NFtfd7vDJFY5 VORWLjrRAfcbspImBwYxIkSCqFWJfRvZH4oi3dr1ndGGvuHpuvDuuPe0efaT5e9W5sKs f26w== X-Gm-Message-State: AC+VfDzYY8WOvCh1jITPYiLdkZJs2cvV+yn6ESVQlAqxQMhGxVncajAJ BQaDEcq2INkqiCW/8EL+c7Hx6P+TIV8C58zfZqlT6Q== X-Google-Smtp-Source: ACHHUZ4Da4VkXvYkknudpiu/DWbKiCJBBbNhnAu0+WddE/vflFdl014JmmeYElwZ1DPufW07gl2bNQ== X-Received: by 2002:a05:6a20:7d9d:b0:ff:7e58:c232 with SMTP id v29-20020a056a207d9d00b000ff7e58c232mr2908550pzj.39.1683389055912; Sat, 06 May 2023 09:04:15 -0700 (PDT) Received: from hermes.local (204-195-120-218.wavecable.com. [204.195.120.218]) by smtp.gmail.com with ESMTPSA id e14-20020a62ee0e000000b006436ffa3dc4sm3369890pfi.24.2023.05.06.09.04.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 06 May 2023 09:04:15 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Ankur Dwivedi , Anoob Joseph , Tejasree Kondoj Subject: [PATCH v2 10/14] crypto/cnxk: use rte_ptkmbuf_mtod_offset Date: Sat, 6 May 2023 09:03:59 -0700 Message-Id: <20230506160404.7423-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230506160404.7423-1-stephen@networkplumber.org> References: <20230505174813.133894-1-stephen@networkplumber.org> <20230506160404.7423-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