crypto/cnxk: add feature flag for cn9k lookaside IPsec
[dpdk.git] / drivers / crypto / cnxk / cnxk_cryptodev.c
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(C) 2021 Marvell.
3  */
4
5 #include <rte_cryptodev.h>
6
7 #include "roc_cpt.h"
8
9 #include "cnxk_cryptodev.h"
10
11 uint64_t
12 cnxk_cpt_default_ff_get(void)
13 {
14         uint64_t ff = RTE_CRYPTODEV_FF_SYMMETRIC_CRYPTO |
15                       RTE_CRYPTODEV_FF_ASYMMETRIC_CRYPTO |
16                       RTE_CRYPTODEV_FF_HW_ACCELERATED |
17                       RTE_CRYPTODEV_FF_RSA_PRIV_OP_KEY_QT |
18                       RTE_CRYPTODEV_FF_SYM_OPERATION_CHAINING |
19                       RTE_CRYPTODEV_FF_IN_PLACE_SGL |
20                       RTE_CRYPTODEV_FF_OOP_LB_IN_LB_OUT |
21                       RTE_CRYPTODEV_FF_OOP_SGL_IN_LB_OUT |
22                       RTE_CRYPTODEV_FF_OOP_SGL_IN_SGL_OUT |
23                       RTE_CRYPTODEV_FF_SYM_SESSIONLESS |
24                       RTE_CRYPTODEV_FF_DIGEST_ENCRYPTED |
25                       RTE_CRYPTODEV_FF_SECURITY;
26
27         return ff;
28 }
29
30 int
31 cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt)
32 {
33         int ret;
34
35         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_SE);
36         if (ret < 0) {
37                 plt_err("Could not add CPT SE engines");
38                 return -ENOTSUP;
39         }
40
41         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_IE);
42         if (ret < 0) {
43                 plt_err("Could not add CPT IE engines");
44                 return -ENOTSUP;
45         }
46
47         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_AE);
48         if (ret < 0) {
49                 plt_err("Could not add CPT AE engines");
50                 return -ENOTSUP;
51         }
52
53         return 0;
54 }