DPDK  18.11.11
rte_vdpa.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: BSD-3-Clause
2  * Copyright(c) 2018 Intel Corporation
3  */
4 
5 #ifndef _RTE_VDPA_H_
6 #define _RTE_VDPA_H_
7 
14 #include <rte_pci.h>
15 #include "rte_vhost.h"
16 
17 #define MAX_VDPA_NAME_LEN 128
18 
19 enum vdpa_addr_type {
20  PCI_ADDR,
21  VDPA_ADDR_MAX
22 };
23 
29  enum vdpa_addr_type type;
30 
32  union {
33  uint8_t __dummy[64];
34  struct rte_pci_addr pci_addr;
35  };
36 };
37 
43  int (*get_queue_num)(int did, uint32_t *queue_num);
44 
46  int (*get_features)(int did, uint64_t *features);
47 
49  int (*get_protocol_features)(int did, uint64_t *protocol_features);
50 
52  int (*dev_conf)(int vid);
53  int (*dev_close)(int vid);
54 
56  int (*set_vring_state)(int vid, int vring, int state);
57 
59  int (*set_features)(int vid);
60 
62  int (*migration_done)(int vid);
63 
65  int (*get_vfio_group_fd)(int vid);
66 
68  int (*get_vfio_device_fd)(int vid);
69 
71  int (*get_notify_area)(int vid, int qid,
72  uint64_t *offset, uint64_t *size);
73 
75  void *reserved[5];
76 };
77 
87 
101 int __rte_experimental
103  struct rte_vdpa_dev_ops *ops);
104 
116 int __rte_experimental
118 
130 int __rte_experimental
132 
144 struct rte_vdpa_device * __rte_experimental
145 rte_vdpa_get_device(int did);
146 
156 int __rte_experimental
158 #endif /* _RTE_VDPA_H_ */
int __rte_experimental rte_vdpa_get_device_num(void)
int(* get_features)(int did, uint64_t *features)
Definition: rte_vdpa.h:46
int __rte_experimental rte_vdpa_find_device_id(struct rte_vdpa_dev_addr *addr)
int __rte_experimental rte_vdpa_unregister_device(int did)
int(* set_vring_state)(int vid, int vring, int state)
Definition: rte_vdpa.h:56
struct rte_vdpa_dev_ops * ops
Definition: rte_vdpa.h:85
int(* get_protocol_features)(int did, uint64_t *protocol_features)
Definition: rte_vdpa.h:49
int(* migration_done)(int vid)
Definition: rte_vdpa.h:62
void * reserved[5]
Definition: rte_vdpa.h:75
int(* set_features)(int vid)
Definition: rte_vdpa.h:59
int(* get_vfio_device_fd)(int vid)
Definition: rte_vdpa.h:68
int __rte_experimental rte_vdpa_register_device(struct rte_vdpa_dev_addr *addr, struct rte_vdpa_dev_ops *ops)
int(* dev_conf)(int vid)
Definition: rte_vdpa.h:52
enum vdpa_addr_type type
Definition: rte_vdpa.h:29
struct rte_vdpa_dev_addr addr
Definition: rte_vdpa.h:83
int(* get_notify_area)(int vid, int qid, uint64_t *offset, uint64_t *size)
Definition: rte_vdpa.h:71
#define __rte_cache_aligned
Definition: rte_memory.h:66
int(* get_vfio_group_fd)(int vid)
Definition: rte_vdpa.h:65
struct rte_vdpa_device *__rte_experimental rte_vdpa_get_device(int did)
int(* get_queue_num)(int did, uint32_t *queue_num)
Definition: rte_vdpa.h:43