DPDK 25.03.0-rc0
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#ifdef __cplusplus
11extern "C" {
12#endif
13
14/* pre-declare structs to avoid including full headers */
15struct rte_mempool;
16struct rte_crypto_op;
17
18#define VHOST_CRYPTO_MBUF_POOL_SIZE (8192)
19#define VHOST_CRYPTO_MAX_BURST_SIZE (64)
20#define VHOST_CRYPTO_MAX_DATA_SIZE (4096)
21#define VHOST_CRYPTO_SESSION_MAP_ENTRIES (1024)
23#define VIRTIO_CRYPTO_MAX_NUM_BURST_VQS (64)
24#define VHOST_CRYPTO_MAX_IV_LEN (32)
25#define VHOST_CRYPTO_MAX_N_DESC (32)
26
27enum rte_vhost_crypto_zero_copy {
28 RTE_VHOST_CRYPTO_ZERO_COPY_DISABLE = 0,
29 RTE_VHOST_CRYPTO_ZERO_COPY_ENABLE = 1,
30 RTE_VHOST_CRYPTO_MAX_ZERO_COPY_OPTIONS
31};
32
41int
42rte_vhost_crypto_driver_start(const char *path);
43
60int
61rte_vhost_crypto_create(int vid, uint8_t cryptodev_id,
62 struct rte_mempool *sess_pool,
63 int socket_id);
64
74int
75rte_vhost_crypto_free(int vid);
76
88int
89rte_vhost_crypto_set_zero_copy(int vid, enum rte_vhost_crypto_zero_copy option);
90
108uint16_t
109rte_vhost_crypto_fetch_requests(int vid, uint32_t qid,
110 struct rte_crypto_op **ops, uint16_t nb_ops);
129uint16_t
130rte_vhost_crypto_finalize_requests(struct rte_crypto_op **ops,
131 uint16_t nb_ops, int *callfds, uint16_t *nb_callfds);
132
133#ifdef __cplusplus
134}
135#endif
136
137#endif