drivers/crypto: return error for not supported SA lifetime
[dpdk.git] / drivers / crypto / dpaa_sec / dpaa_sec.c
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