DPDK  20.11.10
rte_vhost_crypto.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2017-2018 Intel Corporation
3  */
4 
5 #ifndef _VHOST_CRYPTO_H_
6 #define _VHOST_CRYPTO_H_
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <stdint.h>
13 
14 #include <rte_compat.h>
15 
16 /* pre-declare structs to avoid including full headers */
17 struct rte_mempool;
18 struct rte_crypto_op;
19 
20 #define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)
21 #define VHOST_CRYPTO_MAX_BURST_SIZE (64)
22 #define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
23 #define VHOST_CRYPTO_SESSION_MAP_ENTRIES (1024)
25 #define VIRTIO_CRYPTO_MAX_NUM_BURST_VQS (64)
26 #define VHOST_CRYPTO_MAX_IV_LEN (32)
27 #define VHOST_CRYPTO_MAX_N_DESC (32)
28 
29 enum rte_vhost_crypto_zero_copy {
30  RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE = 0,
31  RTE_VHOST_CRYPTO_ZERO_COPY_ENABLE = 1,
32  RTE_VHOST_CRYPTO_MAX_ZERO_COPY_OPTIONS
33 };
34 
43 __rte_experimental
44 int
45 rte_vhost_crypto_driver_start(const char *path);
46 
65 __rte_experimental
66 int
67 rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,
68  struct rte_mempool *sess_pool,
69  struct rte_mempool *sess_priv_pool,
70  int socket_id);
71 
81 __rte_experimental
82 int
83 rte_vhost_crypto_free(int vid);
84 
96 __rte_experimental
97 int
98 rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option);
99 
117 __rte_experimental
118 uint16_t
119 rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
120  struct rte_crypto_op **ops, uint16_t nb_ops);
139 __rte_experimental
140 uint16_t
141 rte_vhost_crypto_finalize_requests(struct rte_crypto_op **ops,
142  uint16_t nb_ops, int *callfds, uint16_t *nb_callfds);
143 
144 #ifdef __cplusplus
145 }
146 #endif
147 
148 #endif