[v2,3/6] crypto/octeontx2: add checks for life configuration

Message ID 1631032372-275-4-git-send-email-anoobj@marvell.com (mailing list archive)
State Changes Requested, archived
Delegated to: akhil goyal
Headers
Series Add SA lifetime in security |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Anoob Joseph Sept. 7, 2021, 4:32 p.m. UTC
  Lifetime tracking is not supported by hardware and is not implemented in
software either. Return failure when lifetime is configured.

Signed-off-by: Anoob Joseph <anoobj@marvell.com>
---
 drivers/crypto/octeontx2/otx2_ipsec_po.h | 6 ++++++
 1 file changed, 6 insertions(+)
  

Patch

diff --git a/drivers/crypto/octeontx2/otx2_ipsec_po.h b/drivers/crypto/octeontx2/otx2_ipsec_po.h
index b3e7456..b61c5e0 100644
--- a/drivers/crypto/octeontx2/otx2_ipsec_po.h
+++ b/drivers/crypto/octeontx2/otx2_ipsec_po.h
@@ -293,6 +293,12 @@  ipsec_po_xform_verify(struct rte_security_ipsec_xform *ipsec,
 	struct rte_crypto_sym_xform *auth_xform, *cipher_xform;
 	int ret;
 
+	if (ipsec->life.bytes_hard_limit != 0 ||
+	    ipsec->life.bytes_soft_limit != 0 ||
+	    ipsec->life.packets_hard_limit != 0 ||
+	    ipsec->life.packets_soft_limit != 0)
+		return -ENOTSUP;
+
 	if (xform->type == RTE_CRYPTO_SYM_XFORM_AEAD)
 		return ipsec_po_xform_aead_verify(ipsec, xform);