DPDK patches and discussions
 help / color / mirror / Atom feed
From: Tejasree Kondoj <ktejasree@marvell.com>
To: Akhil Goyal <akhil.goyal@nxp.com>, Radu Nicolau <radu.nicolau@intel.com>
Cc: Tejasree Kondoj <ktejasree@marvell.com>,
	Narayana Prasad <pathreya@marvell.com>,
	Anoob Joseph <anoobj@marvell.com>,
	Vamsi Attunuru <vattunuru@marvell.com>, <dev@dpdk.org>
Subject: [dpdk-dev] [PATCH v2 1/9] crypto/octeontx2: move capabilities initialization into probe
Date: Wed, 15 Jul 2020 14:56:55 +0530	[thread overview]
Message-ID: <20200715092703.17936-2-ktejasree@marvell.com> (raw)
In-Reply-To: <20200715092703.17936-1-ktejasree@marvell.com>

This patch moves capabilities initialization into probe.

Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 drivers/crypto/octeontx2/otx2_cryptodev.c              | 2 ++
 drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c | 9 ++++++---
 drivers/crypto/octeontx2/otx2_cryptodev_capabilities.h | 8 +++++++-
 drivers/crypto/octeontx2/otx2_cryptodev_ops.c          | 2 +-
 4 files changed, 16 insertions(+), 5 deletions(-)

diff --git a/drivers/crypto/octeontx2/otx2_cryptodev.c b/drivers/crypto/octeontx2/otx2_cryptodev.c
index 9aa0fe35b4..a51d532553 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev.c
@@ -101,6 +101,8 @@ otx2_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 		goto otx2_dev_fini;
 	}
 
+	otx2_crypto_capabilities_init(vf->hw_caps);
+
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			     RTE_CRYPTODEV_FF_HW_ACCELERATED |
 			     RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
index f6f4dee6cf..f0ed1e2df9 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.c
@@ -737,10 +737,9 @@ cpt_caps_add(const struct rte_cryptodev_capabilities *caps, int nb_caps)
 	cur_pos += nb_caps;
 }
 
-const struct rte_cryptodev_capabilities *
-otx2_cpt_capabilities_get(union cpt_eng_caps *hw_caps)
+void
+otx2_crypto_capabilities_init(union cpt_eng_caps *hw_caps)
 {
-
 	CPT_CAPS_ADD(hw_caps, mul);
 	CPT_CAPS_ADD(hw_caps, sha1_sha2);
 	CPT_CAPS_ADD(hw_caps, chacha20);
@@ -751,6 +750,10 @@ otx2_cpt_capabilities_get(union cpt_eng_caps *hw_caps)
 
 	cpt_caps_add(caps_null, RTE_DIM(caps_null));
 	cpt_caps_add(caps_end, RTE_DIM(caps_end));
+}
 
+const struct rte_cryptodev_capabilities *
+otx2_cpt_capabilities_get(void)
+{
 	return otx2_cpt_caps;
 }
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.h b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.h
index e07a2a8c92..a439cbefd3 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.h
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_capabilities.h
@@ -16,11 +16,17 @@ enum otx2_cpt_egrp {
 	OTX2_CPT_EGRP_MAX,
 };
 
+/*
+ * Initialize crypto capabilities for the device
+ *
+ */
+void otx2_crypto_capabilities_init(union cpt_eng_caps *hw_caps);
+
 /*
  * Get capabilities list for the device
  *
  */
 const struct rte_cryptodev_capabilities *
-otx2_cpt_capabilities_get(union cpt_eng_caps *hw_caps);
+otx2_cpt_capabilities_get(void);
 
 #endif /* _OTX2_CRYPTODEV_CAPABILITIES_H_ */
diff --git a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
index a3703682a0..229b719b42 100644
--- a/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
+++ b/drivers/crypto/octeontx2/otx2_cryptodev_ops.c
@@ -1071,7 +1071,7 @@ otx2_cpt_dev_info_get(struct rte_cryptodev *dev,
 	if (info != NULL) {
 		info->max_nb_queue_pairs = vf->max_queues;
 		info->feature_flags = dev->feature_flags;
-		info->capabilities = otx2_cpt_capabilities_get(vf->hw_caps);
+		info->capabilities = otx2_cpt_capabilities_get();
 		info->sym.max_nb_sessions = 0;
 		info->driver_id = otx2_cryptodev_driver_id;
 		info->min_mbuf_headroom_req = OTX2_CPT_MIN_HEADROOM_REQ;
-- 
2.27.0


  reply	other threads:[~2020-07-15  8:33 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-15  9:26 [dpdk-dev] [PATCH v2 0/9] add OCTEON TX2 lookaside IPsec support Tejasree Kondoj
2020-07-15  9:26 ` Tejasree Kondoj [this message]
2020-07-15  9:26 ` [dpdk-dev] [PATCH v2 2/9] net/octeontx2: move otx2_sec_session struct to otx2_security.h Tejasree Kondoj
2020-07-15  9:26 ` [dpdk-dev] [PATCH v2 3/9] crypto/octeontx2: add lookaside SA context definitions Tejasree Kondoj
2020-07-15  9:26 ` [dpdk-dev] [PATCH v2 4/9] crypto/octeontx2: add cryptodev sec registration Tejasree Kondoj
2020-07-15 16:57   ` Akhil Goyal
2020-07-16  5:04     ` Tejasree Kondoj
2020-07-15  9:26 ` [dpdk-dev] [PATCH v2 5/9] crypto/octeontx2: add cryptodev sec capabilities Tejasree Kondoj
2020-07-15  9:27 ` [dpdk-dev] [PATCH v2 6/9] crypto/octeontx2: add cryptodev sec misc callbacks Tejasree Kondoj
2020-07-15  9:27 ` [dpdk-dev] [PATCH v2 7/9] crypto/octeontx2: add cryptodev sec session create Tejasree Kondoj
2020-07-15  9:27 ` [dpdk-dev] [PATCH v2 8/9] crypto/octeontx2: add cryptodev sec enqueue routine Tejasree Kondoj
2020-07-15  9:27 ` [dpdk-dev] [PATCH v2 9/9] crypto/octeontx2: add cryptodev sec dequeue routine Tejasree Kondoj
2020-07-15 17:10   ` Akhil Goyal
2020-07-16  5:05     ` 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=20200715092703.17936-2-ktejasree@marvell.com \
    --to=ktejasree@marvell.com \
    --cc=akhil.goyal@nxp.com \
    --cc=anoobj@marvell.com \
    --cc=dev@dpdk.org \
    --cc=pathreya@marvell.com \
    --cc=radu.nicolau@intel.com \
    --cc=vattunuru@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).