DPDK  19.11.14
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 #define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)
13 #define VHOST_CRYPTO_MAX_BURST_SIZE (64)
14 #define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
15 #define VHOST_CRYPTO_SESSION_MAP_ENTRIES (1024)
17 #define VIRTIO_CRYPTO_MAX_NUM_BURST_VQS (64)
18 #define VHOST_CRYPTO_MAX_IV_LEN (32)
19 #define VHOST_CRYPTO_MAX_N_DESC (32)
20 
21 enum rte_vhost_crypto_zero_copy {
22  RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE = 0,
23  RTE_VHOST_CRYPTO_ZERO_COPY_ENABLE = 1,
24  RTE_VHOST_CRYPTO_MAX_ZERO_COPY_OPTIONS
25 };
26 
45 __rte_experimental
46 int
47 rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,
48  struct rte_mempool *sess_pool,
49  struct rte_mempool *sess_priv_pool,
50  int socket_id);
51 
61 __rte_experimental
62 int
63 rte_vhost_crypto_free(int vid);
64 
76 __rte_experimental
77 int
78 rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option);
79 
97 __rte_experimental
98 uint16_t
99 rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
100  struct rte_crypto_op **ops, uint16_t nb_ops);
119 __rte_experimental
120 uint16_t
121 rte_vhost_crypto_finalize_requests(struct rte_crypto_op **ops,
122  uint16_t nb_ops, int *callfds, uint16_t *nb_callfds);
123 
124 #ifdef __cplusplus
125 }
126 #endif
127 
128 #endif