DPDK  20.08.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 
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 
32  int (*dev_close)(int vid);
33 
35  int (*set_vring_state)(int vid, int vring, int state);
36 
38  int (*set_features)(int vid);
39 
41  int (*migration_done)(int vid);
42 
44  int (*get_vfio_group_fd)(int vid);
45 
47  int (*get_vfio_device_fd)(int vid);
48 
50  int (*get_notify_area)(int vid, int qid,
51  uint64_t *offset, uint64_t *size);
52 
54  int (*get_stats_names)(struct rte_vdpa_device *dev,
55  struct rte_vdpa_stat_name *stats_names,
56  unsigned int size);
57 
59  int (*get_stats)(struct rte_vdpa_device *dev, int qid,
60  struct rte_vdpa_stat *stats, unsigned int n);
61 
63  int (*reset_stats)(struct rte_vdpa_device *dev, int qid);
64 
66  void *reserved[2];
67 };
68 
73  TAILQ_ENTRY(rte_vdpa_device) next;
75  struct rte_device *device;
78 };
79 
93 __rte_experimental
94 struct rte_vdpa_device *
95 rte_vdpa_register_device(struct rte_device *rte_dev,
96  struct rte_vdpa_dev_ops *ops);
97 
109 __rte_experimental
110 int
111 rte_vdpa_unregister_device(struct rte_vdpa_device *dev);
112 
128 __rte_experimental
129 int
130 rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable);
131 
149 __rte_experimental
150 int
151 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
152 
153 #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(* dev_close)(int vid)
Definition: rte_vdpa_dev.h:32
void * reserved[2]
Definition: rte_vdpa_dev.h:66
struct rte_device * device
Definition: rte_vdpa_dev.h:75
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa_dev.h:35
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa_dev.h:77
int(* get_stats)(struct rte_vdpa_device *dev, int qid, struct rte_vdpa_stat *stats, unsigned int n)
Definition: rte_vdpa_dev.h:59
int(* migration_done)(int vid)
Definition: rte_vdpa_dev.h:41
int(* set_features)(int vid)
Definition: rte_vdpa_dev.h:38
__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_dev.h:47
int(* get_stats_names)(struct rte_vdpa_device *dev, struct rte_vdpa_stat_name *stats_names, unsigned int size)
Definition: rte_vdpa_dev.h:54
int(* dev_conf)(int vid)
Definition: rte_vdpa_dev.h:29
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa_dev.h:50
int(* get_features)(struct rte_vdpa_device *dev, uint64_t *features)
Definition: rte_vdpa_dev.h:22
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa_dev.h:44
int(* get_protocol_features)(struct rte_vdpa_device *dev, uint64_t *protocol_features)
Definition: rte_vdpa_dev.h:25
int(* reset_stats)(struct rte_vdpa_device *dev, int qid)
Definition: rte_vdpa_dev.h:63