DPDK  21.02.0
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 #include "rte_vdpa.h"
12 
13 #define RTE_VHOST_QUEUE_ALL UINT16_MAX
14 
20  int (*get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num);
21 
23  int (*get_features)(struct rte_vdpa_device *dev, uint64_t *features);
24 
27  uint64_t *protocol_features);
28 
30  int (*dev_conf)(int vid);
31 
33  int (*dev_close)(int vid);
34 
36  int (*set_vring_state)(int vid, int vring, int state);
37 
39  int (*set_features)(int vid);
40 
42  int (*migration_done)(int vid);
43 
45  int (*get_vfio_group_fd)(int vid);
46 
48  int (*get_vfio_device_fd)(int vid);
49 
51  int (*get_notify_area)(int vid, int qid,
52  uint64_t *offset, uint64_t *size);
53 
55  int (*get_stats_names)(struct rte_vdpa_device *dev,
56  struct rte_vdpa_stat_name *stats_names,
57  unsigned int size);
58 
60  int (*get_stats)(struct rte_vdpa_device *dev, int qid,
61  struct rte_vdpa_stat *stats, unsigned int n);
62 
64  int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
65 
67  void *reserved[2];
68 };
69 
74  TAILQ_ENTRY(rte_vdpa_device) next;
76  struct rte_device *device;
79 };
80 
91 struct rte_vdpa_device *
92 rte_vdpa_register_device(struct rte_device *rte_dev,
93  struct rte_vdpa_dev_ops *ops);
94 
103 int
104 rte_vdpa_unregister_device(struct rte_vdpa_device *dev);
105 
118 int
119 rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable);
120 
135 int
136 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
137 
138 #endif /* _RTE_VDPA_DEV_H_ */
int(* get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num)
Definition: rte_vdpa_dev.h:20
int(* dev_close)(int vid)
Definition: rte_vdpa_dev.h:33
void * reserved[2]
Definition: rte_vdpa_dev.h:67
struct rte_device * device
Definition: rte_vdpa_dev.h:76
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa_dev.h:36
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa_dev.h:78
int(* get_stats)(struct rte_vdpa_device *dev, int qid, struct rte_vdpa_stat *stats, unsigned int n)
Definition: rte_vdpa_dev.h:60
int(* migration_done)(int vid)
Definition: rte_vdpa_dev.h:42
int(* set_features)(int vid)
Definition: rte_vdpa_dev.h:39
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa_dev.h:48
int rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
int(* get_stats_names)(struct rte_vdpa_device *dev, struct rte_vdpa_stat_name *stats_names, unsigned int size)
Definition: rte_vdpa_dev.h:55
int(* dev_conf)(int vid)
Definition: rte_vdpa_dev.h:30
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa_dev.h:51
int(* get_features)(struct rte_vdpa_device *dev, uint64_t *features)
Definition: rte_vdpa_dev.h:23
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa_dev.h:45
int(* get_protocol_features)(struct rte_vdpa_device *dev, uint64_t *protocol_features)
Definition: rte_vdpa_dev.h:26
int(* reset_stats)(struct rte_vdpa_device *dev, int qid)
Definition: rte_vdpa_dev.h:64