FD.io VPP  v18.04-17-g3a0d853
Vector Packet Processing
vfio.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018 Cisco and/or its affiliates.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at:
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef included_vlib_linux_vfio_h
17 #define included_vlib_linux_vfio_h
18 
19 typedef struct
20 {
21  int group;
22  int fd;
23  int refcnt;
25 
26 typedef struct
27 {
29 #define LINUX_VFIO_F_HAVE_IOMMU (1 << 0)
30 #define LINUX_VFIO_F_HAVE_NOIOMMU (1 << 1)
32 
33  /* VFIO */
35 
36  /* pool of IOMMU groups */
38 
39  /* iommu group pool index by group id hash */
41 
43 
45 
49  int *fd);
50 
51 
52 #endif /* included_vlib_linux_vfio_h */
53 
54 /*
55  * fd.io coding-style-patch-verification: ON
56  *
57  * Local Variables:
58  * eval: (c-set-style "gnu")
59  * End:
60  */
void linux_vfio_dma_map_regions(vlib_main_t *vm)
Definition: vfio.c:66
int iommu_mode
Definition: vfio.h:34
clib_error_t * linux_vfio_group_get_device_fd(vlib_pci_addr_t *addr, int *fd)
Definition: vfio.c:157
linux_pci_vfio_iommu_group_t * iommu_groups
Definition: vfio.h:37
clib_error_t * linux_vfio_init(vlib_main_t *vm)
Definition: vfio.c:218
vlib_main_t * vm
Definition: buffer.c:294
unsigned int u32
Definition: types.h:88
uword * iommu_pool_index_by_group
Definition: vfio.h:40
u64 uword
Definition: types.h:112
linux_vfio_main_t vfio_main
Definition: vfio.c:35
int container_fd
Definition: vfio.h:31
vhost_vring_addr_t addr
Definition: vhost-user.h:83