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 DC904A034C; Mon, 8 Aug 2022 10:07:50 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 301E942C88; Mon, 8 Aug 2022 10:06:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by mails.dpdk.org (Postfix) with ESMTP id 4CF4B42C83 for ; Mon, 8 Aug 2022 10:06:47 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 277N0RZ4005916 for ; Mon, 8 Aug 2022 01:06:46 -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=+eR4+SAOOB8HpaHv4i/xB0Vbm/PRHvFcJVxhlZZro14=; b=kaf1nOPt+yNxv1DSs5NShDu1WLC6ACPBbv757hRxPijQ36/otGqymZxatGFeRo0oZ3PG HExo1/o0rN+BM3iDPiFBhA35mA81Vdtgcnmvu2bVlFuPeYwAd1MDDHRfn/d4FjeffrPf 4tYvn0or2KPCGoyD0PCavX4DlIhZiLflwfOEEfsjawz/fboGoMC47Z9cj0d1FOifI8+r mVo3RUhhdDGNt46G+unti4b8vwRMguzpSTUvVpztizEPDef/iVpJKTHA+5hHEPQ2igYk TfofMxbOTMbqhT5+K3/7BSGqsQ91qOs3e+wCL30s1jnqCbHOj13x6/JmYLU/Bu73jtJU jg== Received: from dc5-exch01.marvell.com ([199.233.59.181]) by mx0b-0016f401.pphosted.com (PPS) with ESMTPS id 3hsqtmmxfb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT) for ; Mon, 08 Aug 2022 01:06:46 -0700 Received: from DC5-EXCH01.marvell.com (10.69.176.38) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 8 Aug 2022 01:06:44 -0700 Received: from maili.marvell.com (10.69.176.80) by DC5-EXCH01.marvell.com (10.69.176.38) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Mon, 8 Aug 2022 01:06:44 -0700 Received: from BG-LT92004.corp.innovium.com (unknown [10.28.160.62]) by maili.marvell.com (Postfix) with ESMTP id C30AE3F7043; Mon, 8 Aug 2022 01:06:42 -0700 (PDT) From: Anoob Joseph To: Akhil Goyal , Jerin Jacob CC: Archana Muniganti , Tejasree Kondoj , Subject: [PATCH 15/18] crypto/cnxk: remove unused ctx buf len Date: Mon, 8 Aug 2022 13:36:03 +0530 Message-ID: <20220808080606.220-16-anoobj@marvell.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220808080606.220-1-anoobj@marvell.com> References: <20220808080606.220-1-anoobj@marvell.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-Proofpoint-GUID: rEoNluYLLskaRoQCZmWYNcBzpad4GLtv X-Proofpoint-ORIG-GUID: rEoNluYLLskaRoQCZmWYNcBzpad4GLtv 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-08_05,2022-08-05_01,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 dc9621fb84..44b31bfe97 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; @@ -2408,7 +2409,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), @@ -2523,7 +2524,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; @@ -2651,7 +2652,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; @@ -2794,7 +2795,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; @@ -2993,7 +2994,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