DPDK  20.05.0-rc0
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 
14 #include <stdbool.h>
15 
16 #include <rte_pci.h>
17 #include "rte_vhost.h"
18 
19 #define MAX_VDPA_NAME_LEN 128
20 
21 enum vdpa_addr_type {
22  PCI_ADDR,
23  VDPA_ADDR_MAX
24 };
25 
31  enum vdpa_addr_type type;
32 
34  union {
35  uint8_t __dummy[64];
36  struct rte_pci_addr pci_addr;
37  };
38 };
39 
45  int (*get_queue_num)(int did, uint32_t *queue_num);
46 
48  int (*get_features)(int did, uint64_t *features);
49 
51  int (*get_protocol_features)(int did, uint64_t *protocol_features);
52 
54  int (*dev_conf)(int vid);
55  int (*dev_close)(int vid);
56 
58  int (*set_vring_state)(int vid, int vring, int state);
59 
61  int (*set_features)(int vid);
62 
64  int (*migration_done)(int vid);
65 
67  int (*get_vfio_group_fd)(int vid);
68 
70  int (*get_vfio_device_fd)(int vid);
71 
73  int (*get_notify_area)(int vid, int qid,
74  uint64_t *offset, uint64_t *size);
75 
77  void *reserved[5];
78 };
79 
85  struct rte_vdpa_dev_addr addr;
89 
103 __rte_experimental
104 int
106  struct rte_vdpa_dev_ops *ops);
107 
119 __rte_experimental
120 int
122 
134 __rte_experimental
135 int
137 
149 __rte_experimental
150 struct rte_vdpa_device *
151 rte_vdpa_get_device(int did);
152 
162 __rte_experimental
163 int
165 
179 __rte_experimental
180 int
181 rte_vhost_host_notifier_ctrl(int vid, bool enable);
182 
200 __rte_experimental
201 int
202 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
203 #endif /* _RTE_VDPA_H_ */
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa.h:87
__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:31
#define __rte_cache_aligned
Definition: rte_common.h:347
__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)