DPDK  21.08.0
rte_vhost_async.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2020 Intel Corporation
3  */
4 
5 #ifndef _RTE_VHOST_ASYNC_H_
6 #define _RTE_VHOST_ASYNC_H_
7 
8 #include "rte_vhost.h"
9 
15  size_t offset;
17  size_t count;
19  struct iovec *iov;
21  unsigned long nr_segs;
22 };
23 
32 };
33 
39  uintptr_t *src_opaque_data;
41  uintptr_t *dst_opaque_data;
42 };
43 
64  int32_t (*transfer_data)(int vid, uint16_t queue_id,
65  struct rte_vhost_async_desc *descs,
66  struct rte_vhost_async_status *opaque_data,
67  uint16_t count);
81  int32_t (*check_completed_copies)(int vid, uint16_t queue_id,
82  struct rte_vhost_async_status *opaque_data,
83  uint16_t max_packets);
84 };
85 
90  struct rte_mbuf *mbuf;
91  uint16_t descs; /* num of descs inflight */
92  uint16_t nr_buffers; /* num of buffers inflight for packed ring */
93 };
94 
98 enum {
99  RTE_VHOST_ASYNC_INORDER = 1U << 0,
100 };
101 
106  uint32_t async_threshold;
107  uint32_t features;
108  uint32_t rsvd[2];
109 };
110 
125 __rte_experimental
126 int rte_vhost_async_channel_register(int vid, uint16_t queue_id,
127  struct rte_vhost_async_config config,
128  struct rte_vhost_async_channel_ops *ops);
129 
140 __rte_experimental
141 int rte_vhost_async_channel_unregister(int vid, uint16_t queue_id);
142 
161 __rte_experimental
162 int rte_vhost_async_channel_register_thread_unsafe(int vid, uint16_t queue_id,
163  struct rte_vhost_async_config config,
164  struct rte_vhost_async_channel_ops *ops);
165 
180 __rte_experimental
181 int rte_vhost_async_channel_unregister_thread_unsafe(int vid,
182  uint16_t queue_id);
183 
210 __rte_experimental
211 uint16_t rte_vhost_submit_enqueue_burst(int vid, uint16_t queue_id,
212  struct rte_mbuf **pkts, uint16_t count,
213  struct rte_mbuf **comp_pkts, uint32_t *comp_count);
214 
231 __rte_experimental
232 uint16_t rte_vhost_poll_enqueue_completed(int vid, uint16_t queue_id,
233  struct rte_mbuf **pkts, uint16_t count);
234 
246 __rte_experimental
247 int rte_vhost_async_get_inflight(int vid, uint16_t queue_id);
248 
267 __rte_experimental
268 uint16_t rte_vhost_clear_queue_thread_unsafe(int vid, uint16_t queue_id,
269  struct rte_mbuf **pkts, uint16_t count);
270 
271 #endif /* _RTE_VHOST_ASYNC_H_ */
struct iovec * iov
struct rte_vhost_iov_iter * dst
struct rte_vhost_iov_iter * src
unsigned long nr_segs