FD.io VPP  v21.06-3-gbb25fbf28
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 
30  /* VFIO */
32 
33  /* pool of IOMMU groups */
35 
36  /* iommu group pool index by group id hash */
38 
40 
41  /* logging */
44 
46 
50  int *fd, int *is_noiommu);
51 
53 
54 
55 #endif /* included_vlib_linux_vfio_h */
56 
57 /*
58  * fd.io coding-style-patch-verification: ON
59  *
60  * Local Variables:
61  * eval: (c-set-style "gnu")
62  * End:
63  */
format_vfio_region_info
format_function_t format_vfio_region_info
Definition: vfio.h:52
vfio_main
linux_vfio_main_t vfio_main
Definition: vfio.c:35
vlib_log_class_t
u32 vlib_log_class_t
Definition: vlib.h:52
linux_pci_vfio_iommu_group_t::fd
int fd
Definition: vfio.h:22
clib_bitmap_t
uword clib_bitmap_t
Definition: bitmap.h:50
linux_pci_vfio_iommu_group_t::refcnt
int refcnt
Definition: vfio.h:23
vm
vlib_main_t * vm
X-connect all packets from the HOST to the PHY.
Definition: nat44_ei.c:3047
linux_vfio_group_get_device_fd
clib_error_t * linux_vfio_group_get_device_fd(vlib_pci_addr_t *addr, int *fd, int *is_noiommu)
Definition: vfio.c:177
addr
vhost_vring_addr_t addr
Definition: vhost_user.h:130
linux_vfio_main_t::iommu_pool_index_by_group
uword * iommu_pool_index_by_group
Definition: vfio.h:37
linux_vfio_main_t
Definition: vfio.h:26
uword
u64 uword
Definition: types.h:112
vfio_map_physmem_page
clib_error_t * vfio_map_physmem_page(vlib_main_t *vm, void *addr)
Definition: vfio.c:38
linux_vfio_main_t::container_fd
int container_fd
Definition: vfio.h:28
linux_vfio_main_t::log_default
vlib_log_class_t log_default
Definition: vfio.h:42
format_function_t
u8 *() format_function_t(u8 *s, va_list *args)
Definition: format.h:48
linux_vfio_init
clib_error_t * linux_vfio_init(vlib_main_t *vm)
Definition: vfio.c:240
linux_vfio_main_t::iommu_mode
int iommu_mode
Definition: vfio.h:31
linux_vfio_main_t::physmem_pages_mapped
clib_bitmap_t * physmem_pages_mapped
Definition: vfio.h:39
vlib_main_t
Definition: main.h:102
clib_error_t
Definition: clib_error.h:21
linux_pci_vfio_iommu_group_t::group
int group
Definition: vfio.h:21
linux_pci_vfio_iommu_group_t
Definition: vfio.h:19
linux_vfio_main_t::iommu_groups
linux_pci_vfio_iommu_group_t * iommu_groups
Definition: vfio.h:34