examples/vhost: support vhost async data path
[dpdk.git] / examples / vhost / ioat.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2010-2020 Intel Corporation
3  */
4
5 #ifndef _IOAT_H_
6 #define _IOAT_H_
7
8 #include <rte_vhost.h>
9 #include <rte_pci.h>
10 #include <rte_vhost_async.h>
11
12 #define MAX_VHOST_DEVICE 1024
13 #define IOAT_RING_SIZE 4096
14 #define MAX_ENQUEUED_SIZE 256
15
16 struct dma_info {
17         struct rte_pci_addr addr;
18         uint16_t dev_id;
19         bool is_valid;
20 };
21
22 struct dma_for_vhost {
23         struct dma_info dmas[RTE_MAX_QUEUES_PER_PORT * 2];
24         uint16_t nr;
25 };
26
27 #ifdef RTE_ARCH_X86
28 int open_ioat(const char *value);
29 #else
30 static int open_ioat(const char *value __rte_unused)
31 {
32         return -1;
33 }
34 #endif
35
36 uint32_t
37 ioat_transfer_data_cb(int vid, uint16_t queue_id,
38                 struct rte_vhost_async_desc *descs,
39                 struct rte_vhost_async_status *opaque_data, uint16_t count);
40
41 uint32_t
42 ioat_check_completed_copies_cb(int vid, uint16_t queue_id,
43                 struct rte_vhost_async_status *opaque_data,
44                 uint16_t max_packets);
45 #endif /* _IOAT_H_ */