[2/2] crypto/cnxk: support for security session enqueue

Message ID 20220325111615.1118946-3-vfialko@marvell.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series Session crypto event metadata api |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/iol-broadcom-Functional fail Functional Testing issues
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-intel-Functional success Functional Testing PASS
ci/intel-Testing success Testing PASS
ci/iol-intel-Performance success Performance Testing PASS
ci/github-robot: build fail github build: failed
ci/iol-aarch64-unit-testing success Testing PASS
ci/iol-aarch64-compile-testing success Testing PASS
ci/iol-x86_64-compile-testing success Testing PASS
ci/iol-abi-testing warning Testing issues
ci/iol-x86_64-unit-testing success Testing PASS

Commit Message

Volodymyr Fialko March 25, 2022, 11:16 a.m. UTC
  Add support for enqueue security session to event crypto adapter. Event
metadata is used to store request/response information that is needed to
enqueue an event after the crypto operation completed.

Signed-off-by: Volodymyr Fialko <vfialko@marvell.com>
---
 drivers/crypto/cnxk/cnxk_cryptodev_ops.h | 5 +++++
 1 file changed, 5 insertions(+)
  

Patch

diff --git a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
index 1c58254bef..857fe95e1c 100644
--- a/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
+++ b/drivers/crypto/cnxk/cnxk_cryptodev_ops.h
@@ -7,6 +7,7 @@ 
 
 #include <rte_cryptodev.h>
 #include <rte_event_crypto_adapter.h>
+#include <rte_security.h>
 
 #include "roc_api.h"
 
@@ -142,6 +143,10 @@  cnxk_event_crypto_mdata_get(struct rte_crypto_op *op)
 		 op->private_data_offset)
 		ec_mdata = (union rte_event_crypto_metadata
 				    *)((uint8_t *)op + op->private_data_offset);
+	else if (op->sess_type == RTE_CRYPTO_OP_SECURITY_SESSION &&
+		 op->type == RTE_CRYPTO_OP_TYPE_SYMMETRIC)
+		ec_mdata = rte_security_session_get_event_mdata(
+			op->sym->sec_session);
 	else
 		return NULL;