DPDK  20.11.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 
90 struct rte_vdpa_device *
91 rte_vdpa_register_device(struct rte_device *rte_dev,
92  struct rte_vdpa_dev_ops *ops);
93 
102 int
103 rte_vdpa_unregister_device(struct rte_vdpa_device *dev);
104 
117 int
118 rte_vhost_host_notifier_ctrl(int vid, uint16_t qid, bool enable);
119 
134 int
135 rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m);
136 
137 #endif /* _RTE_VDPA_DEV_H_ */
rte_vhost.h
rte_vdpa_dev_ops::reserved
void * reserved[2]
Definition: rte_vdpa_dev.h:66
rte_vdpa_dev_ops::set_features
int(* set_features)(int vid)
Definition: rte_vdpa_dev.h:38
rte_vdpa_dev_ops::get_vfio_group_fd
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa_dev.h:44
rte_vdpa_device::device
struct rte_device * device
Definition: rte_vdpa_dev.h:75
rte_vdpa_dev_ops::get_notify_area
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa_dev.h:50
rte_vdpa_dev_ops::dev_conf
int(* dev_conf)(int vid)
Definition: rte_vdpa_dev.h:29
rte_vdpa_dev_ops::get_features
int(* get_features)(struct rte_vdpa_device *dev, uint64_t *features)
Definition: rte_vdpa_dev.h:22
rte_vdpa_dev_ops::get_protocol_features
int(* get_protocol_features)(struct rte_vdpa_device *dev, uint64_t *protocol_features)
Definition: rte_vdpa_dev.h:25
rte_vdpa_dev_ops::reset_stats
int(* reset_stats)(struct rte_vdpa_device *dev, int qid)
Definition: rte_vdpa_dev.h:63
rte_vdpa_dev_ops::get_stats_names
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
rte_vdpa_relay_vring_used
int rte_vdpa_relay_vring_used(int vid, uint16_t qid, void *vring_m)
rte_vdpa_device::ops
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa_dev.h:77
rte_vdpa_stat_name
Definition: rte_vdpa.h:40
rte_vdpa_dev_ops::get_vfio_device_fd
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa_dev.h:47
rte_vdpa_dev_ops
Definition: rte_vdpa_dev.h:17
rte_vdpa_dev_ops::set_vring_state
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa_dev.h:35
rte_vdpa_stat
Definition: rte_vdpa.h:28
rte_vdpa_device
Definition: rte_vdpa_dev.h:72
rte_vdpa_dev_ops::dev_close
int(* dev_close)(int vid)
Definition: rte_vdpa_dev.h:32
rte_device
Definition: rte_dev.h:92
rte_vdpa_dev_ops::migration_done
int(* migration_done)(int vid)
Definition: rte_vdpa_dev.h:41
rte_vdpa_dev_ops::get_queue_num
int(* get_queue_num)(struct rte_vdpa_device *dev, uint32_t *queue_num)
Definition: rte_vdpa_dev.h:19
rte_vdpa_dev_ops::get_stats
int(* get_stats)(struct rte_vdpa_device *dev, int qid, struct rte_vdpa_stat *stats, unsigned int n)
Definition: rte_vdpa_dev.h:59