DPDK  21.11.0
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 #include <stdint.h>
9 
10 #include <rte_compat.h>
11 
12 /* pre-declare structs to avoid including full headers */
13 struct rte_mempool;
14 struct rte_crypto_op;
15 
16 #define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)
17 #define VHOST_CRYPTO_MAX_BURST_SIZE (64)
18 #define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
19 #define VHOST_CRYPTO_SESSION_MAP_ENTRIES (1024)
21 #define VIRTIO_CRYPTO_MAX_NUM_BURST_VQS (64)
22 #define VHOST_CRYPTO_MAX_IV_LEN (32)
23 #define VHOST_CRYPTO_MAX_N_DESC (32)
24 
25 enum rte_vhost_crypto_zero_copy {
26  RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE = 0,
27  RTE_VHOST_CRYPTO_ZERO_COPY_ENABLE = 1,
28  RTE_VHOST_CRYPTO_MAX_ZERO_COPY_OPTIONS
29 };
30 
39 __rte_experimental
40 int
41 rte_vhost_crypto_driver_start(const char *path);
42 
61 int
62 rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,
63  struct rte_mempool *sess_pool,
64  struct rte_mempool *sess_priv_pool,
65  int socket_id);
66 
76 int
77 rte_vhost_crypto_free(int vid);
78 
90 int
91 rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option);
92 
110 uint16_t
111 rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
112  struct rte_crypto_op **ops, uint16_t nb_ops);
131 uint16_t
132 rte_vhost_crypto_finalize_requests(struct rte_crypto_op **ops,
133  uint16_t nb_ops, int *callfds, uint16_t *nb_callfds);
134 
135 #endif