diff mbox series

[12/20] crypto/cnxk: add chained operation in session

Message ID 1622652221-22732-13-git-send-email-anoobj@marvell.com (mailing list archive)
State Superseded
Delegated to: akhil goyal
Headers show
Series Add Marvell CNXK crypto PMDs | expand

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph June 2, 2021, 4:43 p.m. UTC
From: Archana Muniganti <marchana@marvell.com>

Add support for chained operations in session.

Signed-off-by: Ankur Dwivedi <adwivedi@marvell.com>
Signed-off-by: Anoob Joseph <anoobj@marvell.com>
Signed-off-by: Archana Muniganti <marchana@marvell.com>
Signed-off-by: Tejasree Kondoj <ktejasree@marvell.com>
---
 doc/guides/cryptodevs/features/cn10k.ini |  2 ++
 doc/guides/cryptodevs/features/cn9k.ini  |  2 ++
 drivers/crypto/cnxk/cn10k_cryptodev.c    |  4 +++-
 drivers/crypto/cnxk/cn9k_cryptodev.c     |  4 +++-
 drivers/crypto/cnxk/cnxk_cryptodev_ops.c | 14 ++++++++++++++
 5 files changed, 24 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/doc/guides/cryptodevs/features/cn10k.ini b/doc/guides/cryptodevs/features/cn10k.ini
index 7f433fa..175fbf7 100644
--- a/doc/guides/cryptodevs/features/cn10k.ini
+++ b/doc/guides/cryptodevs/features/cn10k.ini
@@ -5,8 +5,10 @@ 
 ;
 [Features]
 Symmetric crypto       = Y
+Sym operation chaining = Y
 HW Accelerated         = Y
 Symmetric sessionless  = Y
+Digest encrypted       = Y
 
 ;
 ; Supported crypto algorithms of 'cn10k' crypto driver.
diff --git a/doc/guides/cryptodevs/features/cn9k.ini b/doc/guides/cryptodevs/features/cn9k.ini
index 9c9d54d..c22b25c 100644
--- a/doc/guides/cryptodevs/features/cn9k.ini
+++ b/doc/guides/cryptodevs/features/cn9k.ini
@@ -5,8 +5,10 @@ 
 ;
 [Features]
 Symmetric crypto       = Y
+Sym operation chaining = Y
 HW Accelerated         = Y
 Symmetric sessionless  = Y
+Digest encrypted       = Y
 
 ;
 ; Supported crypto algorithms of 'cn9k' crypto driver.
diff --git a/drivers/crypto/cnxk/cn10k_cryptodev.c b/drivers/crypto/cnxk/cn10k_cryptodev.c
index 2abd396..4d20409 100644
--- a/drivers/crypto/cnxk/cn10k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn10k_cryptodev.c
@@ -81,7 +81,9 @@  cn10k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			     RTE_CRYPTODEV_FF_HW_ACCELERATED |
-			     RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
+			     RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+			     RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
+			     RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED;
 
 	cn10k_cpt_set_enqdeq_fns(dev);
 
diff --git a/drivers/crypto/cnxk/cn9k_cryptodev.c b/drivers/crypto/cnxk/cn9k_cryptodev.c
index db61175..f629dac 100644
--- a/drivers/crypto/cnxk/cn9k_cryptodev.c
+++ b/drivers/crypto/cnxk/cn9k_cryptodev.c
@@ -79,7 +79,9 @@  cn9k_cpt_pci_probe(struct rte_pci_driver *pci_drv __rte_unused,
 
 	dev->feature_flags = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
 			     RTE_CRYPTODEV_FF_HW_ACCELERATED |
-			     RTE_CRYPTODEV_FF_SYM_SESSIONLESS;
+			     RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
+			     RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
+			     RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED;
 
 	cn9k_cpt_set_enqdeq_fns(dev);
 
diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
index 3cc3b4d..3b7cd44 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.c
@@ -453,6 +453,20 @@  sym_session_configure(struct roc_cpt *roc_cpt, int driver_id,
 	case CNXK_CPT_AEAD:
 		ret = fill_sess_aead(xform, sess_priv);
 		break;
+	case CNXK_CPT_CIPHER_ENC_AUTH_GEN:
+	case CNXK_CPT_CIPHER_DEC_AUTH_VRFY:
+		ret = fill_sess_cipher(xform, sess_priv);
+		if (ret < 0)
+			break;
+		ret = fill_sess_auth(xform->next, sess_priv);
+		break;
+	case CNXK_CPT_AUTH_VRFY_CIPHER_DEC:
+	case CNXK_CPT_AUTH_GEN_CIPHER_ENC:
+		ret = fill_sess_auth(xform, sess_priv);
+		if (ret < 0)
+			break;
+		ret = fill_sess_cipher(xform->next, sess_priv);
+		break;
 	default:
 		ret = -1;
 	}