DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tejasree Kondoj <ktejasree@marvell.com>
To: Akhil Goyal <gakhil@marvell.com>
Cc: Anoob Joseph <anoobj@marvell.com>,
	Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>,
	<dev@dpdk.org>
Subject: [PATCH 07/11] common/cnxk: add errata function for CPT set ctx
Date: Fri, 24 Feb 2023 11:18:09 +0530	[thread overview]
Message-ID: <20230224054813.2855914-8-ktejasree@marvell.com> (raw)
In-Reply-To: <20230224054813.2855914-1-ktejasree@marvell.com>

Adding function in errata header file for CPT ctx_val
and replace CPT revision_id checks with function call.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/common/cnxk/roc_errata.h         |  9 +++++++++
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 13 ++++++++-----
 2 files changed, 17 insertions(+), 5 deletions(-)

diff --git a/drivers/common/cnxk/roc_errata.h b/drivers/common/cnxk/roc_errata.h
index 36e6db467a..9954b7da32 100644
--- a/drivers/common/cnxk/roc_errata.h
+++ b/drivers/common/cnxk/roc_errata.h
@@ -4,6 +4,8 @@
 #ifndef _ROC_ERRATA_H_
 #define _ROC_ERRATA_H_
 
+#include "roc_model.h"
+
 /* Errata IPBUNIXRX-40129 */
 static inline bool
 roc_errata_nix_has_no_drop_re(void)
@@ -98,4 +100,11 @@ roc_errata_nix_sdp_send_has_mtu_size_16k(void)
 		roc_model_is_cn96_a0() || roc_model_is_cn96_b0());
 }
 
+/* Errata IPBUCPT-38753 */
+static inline bool
+roc_errata_cpt_hang_on_mixed_ctx_val(void)
+{
+	return roc_model_is_cn10ka_a0() || roc_model_is_cn10ka_a1();
+}
+
 #endif /* _ROC_ERRATA_H_ */
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 67bd7e3243..adc1c7652b 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -8,6 +8,7 @@
 
 #include "roc_ae_fpm_tables.h"
 #include "roc_cpt.h"
+#include "roc_errata.h"
 #include "roc_ie_on.h"
 
 #include "cnxk_ae.h"
@@ -636,7 +637,7 @@ cnxk_cpt_inst_w7_get(struct cnxk_se_sess *sess, struct roc_cpt *roc_cpt)
 
 	inst_w7.s.cptr = (uint64_t)&sess->roc_se_ctx.se_ctx;
 
-	if (roc_cpt->cpt_revision == ROC_CPT_REVISION_ID_106XX)
+	if (roc_errata_cpt_hang_on_mixed_ctx_val())
 		inst_w7.s.ctx_val = 1;
 	else
 		inst_w7.s.cptr += 8;
@@ -709,7 +710,7 @@ sym_session_configure(struct roc_cpt *roc_cpt, struct rte_crypto_sym_xform *xfor
 
 	sess_priv->cpt_inst_w7 = cnxk_cpt_inst_w7_get(sess_priv, roc_cpt);
 
-	if (roc_cpt->cpt_revision == ROC_CPT_REVISION_ID_106XX)
+	if (roc_errata_cpt_hang_on_mixed_ctx_val())
 		roc_se_ctx_init(&sess_priv->roc_se_ctx);
 
 	return 0;
@@ -735,7 +736,8 @@ sym_session_clear(struct rte_cryptodev_sym_session *sess, bool is_session_less)
 	struct cnxk_se_sess *sess_priv = (struct cnxk_se_sess *)sess;
 
 	/* Trigger CTX flush + invalidate to remove from CTX_CACHE */
-	roc_cpt_lf_ctx_flush(sess_priv->lf, &sess_priv->roc_se_ctx.se_ctx, true);
+	if (roc_errata_cpt_hang_on_mixed_ctx_val())
+		roc_cpt_lf_ctx_flush(sess_priv->lf, &sess_priv->roc_se_ctx.se_ctx, true);
 
 	if (sess_priv->roc_se_ctx.auth_key != NULL)
 		plt_free(sess_priv->roc_se_ctx.auth_key);
@@ -763,7 +765,8 @@ cnxk_ae_session_clear(struct rte_cryptodev *dev, struct rte_cryptodev_asym_sessi
 	struct cnxk_ae_sess *priv = (struct cnxk_ae_sess *)sess;
 
 	/* Trigger CTX flush + invalidate to remove from CTX_CACHE */
-	roc_cpt_lf_ctx_flush(priv->lf, &priv->hw_ctx, true);
+	if (roc_errata_cpt_hang_on_mixed_ctx_val())
+		roc_cpt_lf_ctx_flush(priv->lf, &priv->hw_ctx, true);
 
 	/* Free resources allocated in session_cfg */
 	cnxk_ae_free_session_parameters(priv);
@@ -792,7 +795,7 @@ cnxk_ae_session_cfg(struct rte_cryptodev *dev, struct rte_crypto_asym_xform *xfo
 	w7.u64 = 0;
 	w7.s.egrp = roc_cpt->eng_grp[CPT_ENG_TYPE_AE];
 
-	if (vf->cpt.cpt_revision == ROC_CPT_REVISION_ID_106XX) {
+	if (roc_errata_cpt_hang_on_mixed_ctx_val()) {
 		hwc = &priv->hw_ctx;
 		hwc->w0.s.aop_valid = 1;
 		hwc->w0.s.ctx_hdr_size = 0;
-- 
2.25.1


  parent reply	other threads:[~2023-02-24  5:49 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24  5:48 [PATCH 00/11] fixes and improvements to cnxk crypto PMD Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 01/11] common/cnxk: fix incorrect auth key length Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 02/11] crypto/cnxk: make sg version check const Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 03/11] crypto/cnxk: use version field directly Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 04/11] crypto/cnxk: use direct mode for zero aad length Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 05/11] crypto/cnxk: set ctx for AE Tejasree Kondoj
2023-02-27 17:38   ` Akhil Goyal
2023-02-24  5:48 ` [PATCH 06/11] common/cnxk: ensure flush inval completion with CSR read Tejasree Kondoj
2023-02-24  5:48 ` Tejasree Kondoj [this message]
2023-02-24  5:48 ` [PATCH 08/11] common/cnxk: replace CPT revision check with caps Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 09/11] crypto/cnxk: support cn10k IPsec SG mode Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 10/11] crypto/cnxk: fix order of ECFPM params Tejasree Kondoj
2023-02-24  5:48 ` [PATCH 11/11] crypto/cnxk: add model check for pdcp chain Tejasree Kondoj

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=20230224054813.2855914-8-ktejasree@marvell.com \
    --to=ktejasree@marvell.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=gakhil@marvell.com \
    --cc=gmuthukrishn@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).