drivers/crypto: return error for not supported SA lifetime
authorGagandeep Singh <g.singh@nxp.com>
Thu, 18 Nov 2021 07:30:30 +0000 (13:00 +0530)
committerAkhil Goyal <gakhil@marvell.com>
Tue, 23 Nov 2021 18:48:28 +0000 (19:48 +0100)
dpaa, dpaa2 and caam_jr drivers do not support
SA expiry. This result in failure of test cases in
test app. This patch returns ENOTSUP to skip the
SA lifetime test cases.

Signed-off-by: Gagandeep Singh <g.singh@nxp.com>
Acked-by: Akhil Goyal <gakhil@marvell.com>
drivers/crypto/caam_jr/caam_jr.c
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c
drivers/crypto/dpaa_sec/dpaa_sec.c

index 5909eca..8e9cfe7 100644 (file)
@@ -1756,6 +1756,12 @@ caam_jr_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
 
        PMD_INIT_FUNC_TRACE();
 
+       if (ipsec_xform->life.bytes_hard_limit != 0 ||
+           ipsec_xform->life.bytes_soft_limit != 0 ||
+           ipsec_xform->life.packets_hard_limit != 0 ||
+           ipsec_xform->life.packets_soft_limit != 0)
+               return -ENOTSUP;
+
        if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS) {
                cipher_xform = &conf->crypto_xform->cipher;
                auth_xform = &conf->crypto_xform->next->auth;
index 2e8e4c6..a5b0523 100644 (file)
@@ -2877,6 +2877,12 @@ dpaa2_sec_set_ipsec_session(struct rte_cryptodev *dev,
        priv->fle_pool = dev_priv->fle_pool;
        flc = &priv->flc_desc[0].flc;
 
+       if (ipsec_xform->life.bytes_hard_limit != 0 ||
+           ipsec_xform->life.bytes_soft_limit != 0 ||
+           ipsec_xform->life.packets_hard_limit != 0 ||
+           ipsec_xform->life.packets_soft_limit != 0)
+               return -ENOTSUP;
+
        memset(session, 0, sizeof(dpaa2_sec_session));
 
        if (conf->crypto_xform->type == RTE_CRYPTO_SYM_XFORM_CIPHER) {
index 9a7d5eb..a552e64 100644 (file)
@@ -2820,6 +2820,12 @@ dpaa_sec_set_ipsec_session(__rte_unused struct rte_cryptodev *dev,
        session->proto_alg = conf->protocol;
        session->ctxt = DPAA_SEC_IPSEC;
 
+       if (ipsec_xform->life.bytes_hard_limit != 0 ||
+           ipsec_xform->life.bytes_soft_limit != 0 ||
+           ipsec_xform->life.packets_hard_limit != 0 ||
+           ipsec_xform->life.packets_soft_limit != 0)
+               return -ENOTSUP;
+
        if (ipsec_xform->direction == RTE_SECURITY_IPSEC_SA_DIR_EGRESS)
                session->dir = DIR_ENC;
        else