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 BB41EA00C2; Tue, 9 Aug 2022 12:55:42 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 6BEA642C61; Tue, 9 Aug 2022 12:54:42 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by mails.dpdk.org (Postfix) with ESMTP id BD72B42C72 for ; Tue, 9 Aug 2022 12:54:40 +0200 (CEST) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2791G3aN015673 for ; Tue, 9 Aug 2022 03:54:40 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding : content-type; s=pfpt0220; bh=AH0Waz0PuA6mT91suK6N2P/S1TtgWI0nOXw3uEUg1ac=; b=SiDQO8P3njjc/7PnbF9Lv9A4rrUTuI3pNmcxt6Sa8Inn1xO1NGb9P79i2iADOEICOCgv IlE6u+EveGI4HZAxjvcQlpLTYVLr1R0IjM/z5C3KGjbomc6XDA3r5nlLkpNeFQisBQKx xf45SE+Fk/rXsGWBr6wsBd4yWph4Deo49LikPQr4o2wQ6vzNzCzUxpHzeMUNM6c373h4 4R12+vgyh/2XZ8NwLOcV6aJ2w0gYTCWdju2SdxHOWeFftwmD0aEpOQM6CX+tYK1n1oxU Q/uU0xiXDczLvA9vwZwDLDSmtJdwn2KHLIQCxPEaaEU9sEKhv4qsVdaKU+XbCTEN/QoK EA== Received: from dc5-exch02.marvell.com ([199.233.59.182]) by mx0a-0016f401.pphosted.com (PPS) with ESMTPS id 3huds2sq8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Tue, 09 Aug 2022 03:54:39 -0700 Received: from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18; Tue, 9 Aug 2022 03:54:38 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend Transport; Tue, 9 Aug 2022 03:54:38 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.193.69.70]) by maili.marvell.com (Postfix) with ESMTP id 74FD13F7065; Tue, 9 Aug 2022 03:54:36 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Archana Muniganti , Tejasree Kondoj , Subject: [PATCH v2 15/18] crypto/cnxk: remove unused ctx buf len Date: Tue, 9 Aug 2022 16:23:53 +0530 Message-ID: <20220809105356.561-16-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220809105356.561-1-anoobj@marvell.com> References: <20220808080606.220-1-anoobj@marvell.com> <20220809105356.561-1-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-ORIG-GUID: oMAqxr8VMngy4XENzcMXFp8KvA4glbsP X-Proofpoint-GUID: oMAqxr8VMngy4XENzcMXFp8KvA4glbsP X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-09_03,2022-08-09_02,2022-06-22_01 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 Ctx len buf field is unused. Remove it. Signed-off-by: Anoob Joseph --- drivers/common/cnxk/roc_se.h | 45 +++++++++++++++-------------------- drivers/crypto/cnxk/cnxk_se.h | 27 +++++++++++---------- 2 files changed, 33 insertions(+), 39 deletions(-) diff --git a/drivers/common/cnxk/roc_se.h b/drivers/common/cnxk/roc_se.h index 86bb3aa79d..d1a87a96da 100644 --- a/drivers/common/cnxk/roc_se.h +++ b/drivers/common/cnxk/roc_se.h @@ -287,32 +287,6 @@ struct roc_se_iov_ptr { struct roc_se_buf_ptr bufs[]; }; -struct roc_se_fc_params { - /* 0th cache line */ - union { - struct roc_se_buf_ptr bufs[1]; - struct { - struct roc_se_iov_ptr *src_iov; - struct roc_se_iov_ptr *dst_iov; - }; - }; - void *iv_buf; - void *auth_iv_buf; - struct roc_se_buf_ptr meta_buf; - struct roc_se_buf_ptr ctx_buf; - uint32_t rsvd2; - uint8_t rsvd3; - uint8_t iv_ovr; - uint8_t cipher_iv_len; - uint8_t auth_iv_len; - - /* 1st cache line */ - struct roc_se_buf_ptr aad_buf __plt_cache_aligned; - struct roc_se_buf_ptr mac_buf; -}; - -PLT_STATIC_ASSERT((offsetof(struct roc_se_fc_params, aad_buf) % 128) == 0); - #define ROC_SE_PDCP_ALG_TYPE_ZUC 0 #define ROC_SE_PDCP_ALG_TYPE_SNOW3G 1 #define ROC_SE_PDCP_ALG_TYPE_AES_CTR 2 @@ -349,6 +323,25 @@ struct roc_se_ctx { uint8_t *auth_key; }; +struct roc_se_fc_params { + union { + struct roc_se_buf_ptr bufs[1]; + struct { + struct roc_se_iov_ptr *src_iov; + struct roc_se_iov_ptr *dst_iov; + }; + }; + void *iv_buf; + void *auth_iv_buf; + struct roc_se_ctx *ctx; + struct roc_se_buf_ptr meta_buf; + uint8_t cipher_iv_len; + uint8_t auth_iv_len; + + struct roc_se_buf_ptr aad_buf; + struct roc_se_buf_ptr mac_buf; +}; + static inline void roc_se_zuc_bytes_swap(uint8_t *arr, int len) { diff --git a/drivers/crypto/cnxk/cnxk_se.h b/drivers/crypto/cnxk/cnxk_se.h index 99fb3b899e..33e65eb4e3 100644 --- a/drivers/crypto/cnxk/cnxk_se.h +++ b/drivers/crypto/cnxk/cnxk_se.h @@ -334,7 +334,7 @@ cpt_digest_gen_prep(uint32_t flags, uint64_t d_lens, uint32_t g_size_bytes, s_size_bytes; union cpt_inst_w4 cpt_inst_w4; - ctx = params->ctx_buf.vaddr; + ctx = params->ctx; hash_type = ctx->hash_type; mac_len = ctx->mac_len; @@ -478,7 +478,8 @@ cpt_enc_hmac_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, aad_len = fc_params->aad_buf.size; aad_buf = &fc_params->aad_buf; } - se_ctx = fc_params->ctx_buf.vaddr; + + se_ctx = fc_params->ctx; cipher_type = se_ctx->enc_cipher; hash_type = se_ctx->hash_type; mac_len = se_ctx->mac_len; @@ -777,7 +778,7 @@ cpt_dec_hmac_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, aad_buf = &fc_params->aad_buf; } - se_ctx = fc_params->ctx_buf.vaddr; + se_ctx = fc_params->ctx; hash_type = se_ctx->hash_type; mac_len = se_ctx->mac_len; op_minor = se_ctx->template_w4.s.opcode_minor; @@ -1087,7 +1088,7 @@ cpt_pdcp_chain_alg_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens, return -1; } - se_ctx = params->ctx_buf.vaddr; + se_ctx = params->ctx; mac_len = se_ctx->mac_len; pdcp_ci_alg = se_ctx->pdcp_ci_alg; pdcp_auth_alg = se_ctx->pdcp_auth_alg; @@ -1281,7 +1282,7 @@ cpt_pdcp_alg_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens, uint8_t pack_iv = 0; union cpt_inst_w4 cpt_inst_w4; - se_ctx = params->ctx_buf.vaddr; + se_ctx = params->ctx; flags = se_ctx->zsk_flags; mac_len = se_ctx->mac_len; @@ -1562,7 +1563,7 @@ cpt_kasumi_enc_prep(uint32_t req_flags, uint64_t d_offs, uint64_t d_lens, encr_data_len = ROC_SE_ENCR_DLEN(d_lens); auth_data_len = ROC_SE_AUTH_DLEN(d_lens); - se_ctx = params->ctx_buf.vaddr; + se_ctx = params->ctx; flags = se_ctx->zsk_flags; mac_len = se_ctx->mac_len; @@ -1751,7 +1752,7 @@ cpt_kasumi_dec_prep(uint64_t d_offs, uint64_t d_lens, encr_offset = ROC_SE_ENCR_OFFSET(d_offs) / 8; encr_data_len = ROC_SE_ENCR_DLEN(d_lens); - se_ctx = params->ctx_buf.vaddr; + se_ctx = params->ctx; flags = se_ctx->zsk_flags; cpt_inst_w4.u64 = 0; @@ -1863,7 +1864,7 @@ static __rte_always_inline int cpt_fc_enc_hmac_prep(uint32_t flags, uint64_t d_offs, uint64_t d_lens, struct roc_se_fc_params *fc_params, struct cpt_inst_s *inst) { - struct roc_se_ctx *ctx = fc_params->ctx_buf.vaddr; + struct roc_se_ctx *ctx = fc_params->ctx; uint8_t fc_type; int ret = -1; @@ -2410,7 +2411,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, flags |= ROC_SE_VALID_IV_BUF; fc_params.iv_buf = rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset); - if (sess->aes_ctr && unlikely(sess->iv_length != 16)) { + if (!is_aead && sess->aes_ctr && unlikely(sess->iv_length != 16)) { memcpy((uint8_t *)iv_buf, rte_crypto_op_ctod_offset(cop, uint8_t *, sess->iv_offset), @@ -2520,7 +2521,7 @@ fill_fc_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, } } } - fc_params.ctx_buf.vaddr = &sess->roc_se_ctx; + fc_params.ctx = &sess->roc_se_ctx; if (!(sess->auth_first) && unlikely(sess->is_null || sess->cpt_op == ROC_SE_OP_DECODE)) inplace = 0; @@ -2649,7 +2650,7 @@ fill_pdcp_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, d_offs = (uint64_t)c_data_off << 16; d_lens = (uint64_t)c_data_len << 32; - fc_params.ctx_buf.vaddr = &sess->roc_se_ctx; + fc_params.ctx = &sess->roc_se_ctx; if (likely(m_dst == NULL || m_src == m_dst)) { fc_params.dst_iov = fc_params.src_iov = (void *)src; @@ -2792,7 +2793,7 @@ fill_pdcp_chain_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, ci_data_length, true); } - fc_params.ctx_buf.vaddr = &sess->roc_se_ctx; + fc_params.ctx = &sess->roc_se_ctx; if (likely((m_dst == NULL || m_dst == m_src)) && inplace) { fc_params.dst_iov = fc_params.src_iov = (void *)src; @@ -2991,7 +2992,7 @@ fill_digest_params(struct rte_crypto_op *cop, struct cnxk_se_sess *sess, d_lens = sym_op->auth.data.length; - params.ctx_buf.vaddr = &sess->roc_se_ctx; + params.ctx = &sess->roc_se_ctx; if (auth_op == ROC_SE_OP_AUTH_GENERATE) { if (sym_op->auth.digest.data) { -- 2.25.1