From: Anoob Joseph <anoobj@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>, Jerin Jacob <jerinj@marvell.com>
Cc: Archana Muniganti <marchana@marvell.com>,
Tejasree Kondoj <ktejasree@marvell.com>, <dev@dpdk.org>
Subject: [PATCH 15/18] crypto/cnxk: remove unused ctx buf len
Date: Mon, 8 Aug 2022 13:36:03 +0530 [thread overview]
Message-ID: <20220808080606.220-16-anoobj@marvell.com> (raw)
In-Reply-To: <20220808080606.220-1-anoobj@marvell.com>
Ctx len buf field is unused. Remove it.
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
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
next prev parent reply other threads:[~2022-08-08 8:07 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-08 8:05 [PATCH 00/18] Fixes and improvements in cnxk crypto PMDs Anoob Joseph
2022-08-08 8:05 ` [PATCH 01/18] crypto/cnxk: add AES-CCM support Anoob Joseph
2022-08-08 8:05 ` [PATCH 02/18] crypto/cnxk: add burst enqueue for event crypto Anoob Joseph
2022-08-08 8:05 ` [PATCH 03/18] crypto/cnxk: remove zero IV Anoob Joseph
2022-08-08 8:05 ` [PATCH 04/18] crypto/cnxk: limit the meta buf cache to 128 Anoob Joseph
2022-08-08 8:05 ` [PATCH 05/18] crypto/cnxk: add separate path for pdcp chain opcode Anoob Joseph
2022-08-08 8:05 ` [PATCH 06/18] crypto/cnxk: add separate datapath for pdcp cipher operation Anoob Joseph
2022-08-08 8:05 ` [PATCH 07/18] crypto/cnxk: remove MAC len check for AEAD Anoob Joseph
2022-08-08 8:05 ` [PATCH 08/18] crypto/cnxk: fix endianness in anti-replay Anoob Joseph
2022-08-08 8:05 ` [PATCH 09/18] crypto/cnxk: remove extra indirection for FC and Kasumi Anoob Joseph
2022-08-08 8:05 ` [PATCH 10/18] crypto/cnxk: remove extra digest len check Anoob Joseph
2022-08-08 8:05 ` [PATCH 11/18] crypto/cnxk: avoid accessing se ctx in aes gcm path Anoob Joseph
2022-08-08 8:06 ` [PATCH 12/18] crypto/cnxk: remove auth iv from kasumi cipher Anoob Joseph
2022-08-08 8:06 ` [PATCH 13/18] crypto/cnxk: enable IE engine for Chacha-Poly Anoob Joseph
2022-08-08 8:06 ` [PATCH 14/18] crypto/cnxk: use dedicated dp threads depending on operation Anoob Joseph
2022-08-08 8:06 ` Anoob Joseph [this message]
2022-08-08 8:06 ` [PATCH 16/18] drivers: change crypto adapter datapath error print to debug Anoob Joseph
2022-08-08 8:06 ` [PATCH 17/18] crypto/cnxk: update flow label copy capability Anoob Joseph
2022-08-08 8:06 ` [PATCH 18/18] crypto/cnxk: add support for DOCSIS algorithm Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 00/18] Fixes and improvements in cnxk crypto PMDs Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 01/18] crypto/cnxk: add AES-CCM support Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 02/18] crypto/cnxk: add burst enqueue for event crypto Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 03/18] crypto/cnxk: remove zero IV Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 04/18] crypto/cnxk: limit the meta buf cache to 128 Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 05/18] crypto/cnxk: add separate path for pdcp chain opcode Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 06/18] crypto/cnxk: add separate datapath for pdcp cipher operation Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 07/18] crypto/cnxk: remove MAC len check for AEAD Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 08/18] crypto/cnxk: fix endianness in anti-replay Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 09/18] crypto/cnxk: remove extra indirection for FC and Kasumi Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 10/18] crypto/cnxk: remove extra digest len check Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 11/18] crypto/cnxk: avoid accessing se ctx in aes gcm path Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 12/18] crypto/cnxk: remove auth iv from kasumi cipher Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 13/18] crypto/cnxk: enable IE engine for Chacha-Poly Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 14/18] crypto/cnxk: use dedicated dp threads depending on operation Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 15/18] crypto/cnxk: remove unused ctx buf len Anoob Joseph
2022-09-28 10:14 ` Thomas Monjalon
2022-09-28 10:17 ` [EXT] " Anoob Joseph
2022-09-28 11:00 ` Thomas Monjalon
2022-08-09 10:53 ` [PATCH v2 16/18] drivers: change crypto adapter datapath error print to debug Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 17/18] crypto/cnxk: update flow label copy capability Anoob Joseph
2022-08-09 10:53 ` [PATCH v2 18/18] crypto/cnxk: add support for DOCSIS algorithm Anoob Joseph
2022-08-28 13:25 ` [PATCH v2 00/18] Fixes and improvements in cnxk crypto PMDs Akhil Goyal
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220808080606.220-16-anoobj@marvell.com \
--to=anoobj@marvell.com \
--cc=dev@dpdk.org \
--cc=gakhil@marvell.com \
--cc=jerinj@marvell.com \
--cc=ktejasree@marvell.com \
--cc=marchana@marvell.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).