DPDK  19.11.3
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
rte_vdpa_dev.h
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4 
5 #ifndef _RTE_VDPA_H_DEV_
6 #define _RTE_VDPA_H_DEV_
7 
8 #include <stdbool.h>
9 
10 #include "rte_vhost.h"
11 
12 #define RTE_VHOST_QUEUE_ALL UINT16_MAX
13 
19  int (*get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num);
20 
22  int (*get_features)(struct rte_vdpa_device *dev, uint64_t *features);
23 
26  uint64_t *protocol_features);
27 
29  int (*dev_conf)(int vid);
30  int (*dev_close)(int vid);
31 
33  int (*set_vring_state)(int vid, int vring, int state);
34 
36  int (*set_features)(int vid);
37 
39  int (*migration_done)(int vid);
40 
42  int (*get_vfio_group_fd)(int vid);
43 
45  int (*get_vfio_device_fd)(int vid);
46 
48  int (*get_notify_area)(int vid, int qid,
49  uint64_t *offset, uint64_t *size);
50 
52  int (*get_stats_names)(struct rte_vdpa_device *dev,
53  struct rte_vdpa_stat_name *stats_names,
54  unsigned int size);
55 
57  int (*get_stats)(struct rte_vdpa_device *dev, int qid,
58  struct rte_vdpa_stat *stats, unsigned int n);
59 
61  int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
62 
64  void *reserved[2];
65 };
66 
71  TAILQ_ENTRY(rte_vdpa_device) next;
73  struct rte_device *device;
76 };
77 
91 __rte_experimental
92 struct rte_vdpa_device *
93 rte_vdpa_register_device(struct rte_device *rte_dev,
94  struct rte_vdpa_dev_ops *ops);
95 
107 __rte_experimental
108 int
109 rte_vdpa_unregister_device(struct rte_vdpa_device *dev);
110 
126 __rte_experimental
127 int
128 rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable);
129 
147 __rte_experimental
148 int
149 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
150 
151 #endif /* _RTE_VDPA_DEV_H_ */
int(* get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num)
Definition: rte_vdpa_dev.h:19
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa_dev.h:33
void * reserved[2]
Definition: rte_vdpa_dev.h:64
struct rte_device * device
Definition: rte_vdpa_dev.h:73
int(* reset_stats)(struct rte_vdpa_device *dev, int qid)
Definition: rte_vdpa_dev.h:61
int(* get_stats)(struct rte_vdpa_device *dev, int qid, struct rte_vdpa_stat *stats, unsigned int n)
Definition: rte_vdpa_dev.h:57
int(* get_stats_names)(struct rte_vdpa_device *dev, struct rte_vdpa_stat_name *stats_names, unsigned int size)
Definition: rte_vdpa_dev.h:52
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa_dev.h:75
int(* dev_conf)(int vid)
Definition: rte_vdpa_dev.h:29
__rte_experimental int rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa_dev.h:48
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa_dev.h:45
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa_dev.h:42
int(* get_protocol_features)(struct rte_vdpa_device *dev, uint64_t *protocol_features)
Definition: rte_vdpa_dev.h:25
int(* migration_done)(int vid)
Definition: rte_vdpa_dev.h:39
int(* get_features)(struct rte_vdpa_device *dev, uint64_t *features)
Definition: rte_vdpa_dev.h:22
int(* set_features)(int vid)
Definition: rte_vdpa_dev.h:36