DPDK  19.11.14
rte_vdpa.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4 
5 #ifndef _RTE_VDPA_H_
6 #define _RTE_VDPA_H_
7 
8 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
18 #include <stdbool.h>
19 
20 #include <rte_pci.h>
21 #include "rte_vhost.h"
22 
23 #define MAX_VDPA_NAME_LEN 128
24 
25 enum vdpa_addr_type {
26  PCI_ADDR,
27  VDPA_ADDR_MAX
28 };
29 
35  enum vdpa_addr_type type;
36 
38  union {
39  uint8_t __dummy[64];
40  struct rte_pci_addr pci_addr;
41  };
42 };
43 
49  int (*get_queue_num)(int did, uint32_t *queue_num);
50 
52  int (*get_features)(int did, uint64_t *features);
53 
55  int (*get_protocol_features)(int did, uint64_t *protocol_features);
56 
58  int (*dev_conf)(int vid);
59  int (*dev_close)(int vid);
60 
62  int (*set_vring_state)(int vid, int vring, int state);
63 
65  int (*set_features)(int vid);
66 
68  int (*migration_done)(int vid);
69 
71  int (*get_vfio_group_fd)(int vid);
72 
74  int (*get_vfio_device_fd)(int vid);
75 
77  int (*get_notify_area)(int vid, int qid,
78  uint64_t *offset, uint64_t *size);
79 
81  void *reserved[5];
82 };
83 
89  struct rte_vdpa_dev_addr addr;
93 
107 __rte_experimental
108 int
110  struct rte_vdpa_dev_ops *ops);
111 
123 __rte_experimental
124 int
126 
138 __rte_experimental
139 int
141 
153 __rte_experimental
154 struct rte_vdpa_device *
155 rte_vdpa_get_device(int did);
156 
166 __rte_experimental
167 int
169 
183 __rte_experimental
184 int
185 rte_vhost_host_notifier_ctrl(int vid, bool enable);
186 
204 __rte_experimental
205 int
206 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
207 
208 #ifdef __cplusplus
209 }
210 #endif
211 
212 #endif /* _RTE_VDPA_H_ */
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa.h:91
__rte_experimental struct rte_vdpa_device * rte_vdpa_get_device(int did)
__rte_experimental int rte_vhost_host_notifier_ctrl(int vid, bool enable)
__rte_experimental int rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
__rte_experimental int rte_vdpa_unregister_device(int did)
enum vdpa_addr_type type
Definition: rte_vdpa.h:35
#define __rte_cache_aligned
Definition: rte_common.h:322
__rte_experimental int rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr, struct rte_vdpa_dev_ops *ops)
__rte_experimental int rte_vdpa_find_device_id(struct rte_vdpa_dev_addr *addr)
__rte_experimental int rte_vdpa_get_device_num(void)