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 v2 08/11] common/cnxk: replace CPT revision check with caps
Date: Fri, 24 Feb 2023 15:10:11 +0530	[thread overview]
Message-ID: <20230224094014.3246764-9-ktejasree@marvell.com> (raw)
In-Reply-To: <20230224094014.3246764-1-ktejasree@marvell.com>

Replace SG version revision check with capabilities
populated from microcode.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/common/cnxk/hw/cpt.h              | 3 ++-
 drivers/crypto/cnxk/cn10k_cryptodev_ops.c | 2 +-
 drivers/event/cnxk/cn10k_eventdev.c       | 3 ++-
 3 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/drivers/common/cnxk/hw/cpt.h b/drivers/common/cnxk/hw/cpt.h
index 44ff8b08b2..82ea076e4c 100644
--- a/drivers/common/cnxk/hw/cpt.h
+++ b/drivers/common/cnxk/hw/cpt.h
@@ -75,7 +75,8 @@ union cpt_eng_caps {
 		uint64_t __io mmul : 1;
 		uint64_t __io reserved_15_33 : 19;
 		uint64_t __io pdcp_chain : 1;
-		uint64_t __io reserved_35_63 : 29;
+		uint64_t __io sg_ver2 : 1;
+		uint64_t __io reserved_36_63 : 28;
 	};
 };
 
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
index d1a43eaf13..9f6fd4e411 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev_ops.c
@@ -1045,7 +1045,7 @@ cn10k_cpt_dequeue_burst(void *qptr, struct rte_crypto_op **ops, uint16_t nb_ops)
 void
 cn10k_cpt_set_enqdeq_fns(struct rte_cryptodev *dev, struct cnxk_cpt_vf *vf)
 {
-	if (vf->cpt.cpt_revision > ROC_CPT_REVISION_ID_106XX)
+	if (vf->cpt.hw_caps[CPT_ENG_TYPE_SE].sg_ver2 && vf->cpt.hw_caps[CPT_ENG_TYPE_IE].sg_ver2)
 		dev->enqueue_burst = cn10k_cpt_sg_ver2_enqueue_burst;
 	else
 		dev->enqueue_burst = cn10k_cpt_sg_ver1_enqueue_burst;
diff --git a/drivers/event/cnxk/cn10k_eventdev.c b/drivers/event/cnxk/cn10k_eventdev.c
index 8e74edff55..ee0428adc8 100644
--- a/drivers/event/cnxk/cn10k_eventdev.c
+++ b/drivers/event/cnxk/cn10k_eventdev.c
@@ -602,7 +602,8 @@ cn10k_sso_fp_fns_set(struct rte_eventdev *event_dev)
 		}
 	}
 
-	if ((cpt != NULL) && (cpt->cpt_revision > ROC_CPT_REVISION_ID_106XX))
+	if ((cpt != NULL) && cpt->hw_caps[CPT_ENG_TYPE_SE].sg_ver2 &&
+	    cpt->hw_caps[CPT_ENG_TYPE_IE].sg_ver2)
 		event_dev->ca_enqueue = cn10k_cpt_sg_ver2_crypto_adapter_enqueue;
 	else
 		event_dev->ca_enqueue = cn10k_cpt_sg_ver1_crypto_adapter_enqueue;
-- 
2.25.1


  parent reply	other threads:[~2023-02-24  9:41 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-24  9:40 [PATCH v2 00/11] fixes and improvements to cnxk crypto PMD Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 01/11] common/cnxk: fix incorrect auth key length Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 02/11] crypto/cnxk: make sg version check const Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 03/11] crypto/cnxk: use version field directly Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 04/11] crypto/cnxk: use direct mode for zero aad length Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 05/11] crypto/cnxk: set ctx for AE Tejasree Kondoj
2023-02-27 17:38   ` Akhil Goyal
2023-02-28  5:40     ` Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 06/11] common/cnxk: ensure flush inval completion with CSR read Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 07/11] common/cnxk: add errata function for CPT set ctx Tejasree Kondoj
2023-02-24  9:40 ` Tejasree Kondoj [this message]
2023-02-24  9:40 ` [PATCH v2 09/11] crypto/cnxk: support cn10k IPsec SG mode Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 10/11] crypto/cnxk: fix order of ECFPM params Tejasree Kondoj
2023-02-24  9:40 ` [PATCH v2 11/11] crypto/cnxk: add model check for pdcp chain Tejasree Kondoj
2023-03-01 12:09 ` [PATCH v2 00/11] fixes and improvements to cnxk crypto PMD 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=20230224094014.3246764-9-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).