DPDK  20.05.0
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  VDPA_ADDR_PCI,
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 
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_ */
int(* get_features)(int did, uint64_t *features)
Definition: rte_vdpa.h:48
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa.h:58
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa.h:87
int(* get_protocol_features)(int did, uint64_t *protocol_features)
Definition: rte_vdpa.h:51
int(* migration_done)(int vid)
Definition: rte_vdpa.h:64
__rte_experimental struct rte_vdpa_device * rte_vdpa_get_device(int did)
__rte_experimental int rte_vhost_host_notifier_ctrl(int vid, bool enable)
void * reserved[5]
Definition: rte_vdpa.h:77
int(* set_features)(int vid)
Definition: rte_vdpa.h:61
__rte_experimental int rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa.h:70
__rte_experimental int rte_vdpa_unregister_device(int did)
int(* dev_conf)(int vid)
Definition: rte_vdpa.h:54
enum vdpa_addr_type type
Definition: rte_vdpa.h:31
struct rte_vdpa_dev_addr addr
Definition: rte_vdpa.h:85
#define __rte_cache_aligned
Definition: rte_common.h:367
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa.h:73
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa.h:67
__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)
int(* get_queue_num)(int did, uint32_t *queue_num)
Definition: rte_vdpa.h:45
__rte_experimental int rte_vdpa_get_device_num(void)