net/virtio: fix incorrect cast of void *
[dpdk.git] / 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
26         if (roc_model_is_cn10k())
27                 ff |= RTE_CRYPTODEV_FF_SECURITY;
28
29         return ff;
30 }
31
32 int
33 cnxk_cpt_eng_grp_add(struct roc_cpt *roc_cpt)
34 {
35         int ret;
36
37         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_SE);
38         if (ret < 0) {
39                 plt_err("Could not add CPT SE engines");
40                 return -ENOTSUP;
41         }
42
43         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_IE);
44         if (ret < 0) {
45                 plt_err("Could not add CPT IE engines");
46                 return -ENOTSUP;
47         }
48
49         ret = roc_cpt_eng_grp_add(roc_cpt, CPT_ENG_TYPE_AE);
50         if (ret < 0) {
51                 plt_err("Could not add CPT AE engines");
52                 return -ENOTSUP;
53         }
54
55         return 0;
56 }