DPDK  20.11.10
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 #ifdef __cplusplus
9 extern "C" {
10 #endif
11 
12 #include <stdbool.h>
13 
14 #include "rte_vhost.h"
15 #include "rte_vdpa.h"
16 
17 #define RTE_VHOST_QUEUE_ALL UINT16_MAX
18 
24  int (*get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num);
25 
27  int (*get_features)(struct rte_vdpa_device *dev, uint64_t *features);
28 
31  uint64_t *protocol_features);
32 
34  int (*dev_conf)(int vid);
35 
37  int (*dev_close)(int vid);
38 
40  int (*set_vring_state)(int vid, int vring, int state);
41 
43  int (*set_features)(int vid);
44 
46  int (*migration_done)(int vid);
47 
49  int (*get_vfio_group_fd)(int vid);
50 
52  int (*get_vfio_device_fd)(int vid);
53 
55  int (*get_notify_area)(int vid, int qid,
56  uint64_t *offset, uint64_t *size);
57 
59  int (*get_stats_names)(struct rte_vdpa_device *dev,
60  struct rte_vdpa_stat_name *stats_names,
61  unsigned int size);
62 
64  int (*get_stats)(struct rte_vdpa_device *dev, int qid,
65  struct rte_vdpa_stat *stats, unsigned int n);
66 
68  int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
69 
71  void *reserved[2];
72 };
73 
78  TAILQ_ENTRY(rte_vdpa_device) next;
80  struct rte_device *device;
83 };
84 
95 struct rte_vdpa_device *
96 rte_vdpa_register_device(struct rte_device *rte_dev,
97  struct rte_vdpa_dev_ops *ops);
98 
107 int
108 rte_vdpa_unregister_device(struct rte_vdpa_device *dev);
109 
122 int
123 rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable);
124 
139 int
140 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
141 
142 #ifdef __cplusplus
143 }
144 #endif
145 
146 #endif /* _RTE_VDPA_DEV_H_ */
int(* get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num)
Definition: rte_vdpa_dev.h:24
int(* dev_close)(int vid)
Definition: rte_vdpa_dev.h:37
void * reserved[2]
Definition: rte_vdpa_dev.h:71
struct rte_device * device
Definition: rte_vdpa_dev.h:80
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa_dev.h:40
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa_dev.h:82
int(* get_stats)(struct rte_vdpa_device *dev, int qid, struct rte_vdpa_stat *stats, unsigned int n)
Definition: rte_vdpa_dev.h:64
int(* migration_done)(int vid)
Definition: rte_vdpa_dev.h:46
int(* set_features)(int vid)
Definition: rte_vdpa_dev.h:43
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa_dev.h:52
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:59
int(* dev_conf)(int vid)
Definition: rte_vdpa_dev.h:34
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa_dev.h:55
int(* get_features)(struct rte_vdpa_device *dev, uint64_t *features)
Definition: rte_vdpa_dev.h:27
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa_dev.h:49
int(* get_protocol_features)(struct rte_vdpa_device *dev, uint64_t *protocol_features)
Definition: rte_vdpa_dev.h:30
int(* reset_stats)(struct rte_vdpa_device *dev, int qid)
Definition: rte_vdpa_dev.h:68