FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
vhost_std.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 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
#ifndef __VIRTIO_VHOST_STD_H__
16
#define __VIRTIO_VHOST_STD_H__
17
18
typedef
struct
19
{
20
u64
guest_phys_addr
;
21
u64
memory_size
;
22
u64
userspace_addr
;
23
u64
mmap_offset
;
24
}
vhost_memory_region_t
;
25
26
typedef
struct
27
{
28
u32
nregions
;
29
u32
padding
;
30
vhost_memory_region_t
regions
[0];
31
}
vhost_memory_t
;
32
33
typedef
struct
34
{
35
u32
index
;
36
u32
num
;
37
}
vhost_vring_state_t
;
38
39
typedef
struct
40
{
41
u32
index
;
42
int
fd
;
43
}
vhost_vring_file_t
;
44
45
typedef
struct
46
{
47
u32
index
;
48
u32
flags
;
49
u64
desc_user_addr
;
50
u64
used_user_addr
;
51
u64
avail_user_addr
;
52
u64
log_guest_addr
;
53
}
vhost_vring_addr_t
;
54
55
typedef
struct
56
{
57
u64
size
;
58
u64
offset
;
59
}
vhost_user_log_t
;
60
61
/* vhost kernel ioctls */
62
#define VHOST_VIRTIO 0xAF
63
#define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, u64)
64
#define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, u64)
65
#define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01)
66
#define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02)
67
#define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, vhost_memory_t)
68
#define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, u64)
69
#define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int)
70
#define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, vhost_vring_state_t)
71
#define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, vhost_vring_addr_t)
72
#define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, vhost_vring_state_t)
73
#define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, vhost_vring_state_t)
74
#define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, vhost_vring_file_t)
75
#define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, vhost_vring_file_t)
76
#define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, vhost_vring_file_t)
77
#define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, vhost_vring_file_t)
78
79
#endif
80
81
/*
82
* fd.io coding-style-patch-verification: ON
83
*
84
* Local Variables:
85
* eval: (c-set-style "gnu")
86
* End:
87
*/
vhost_user_log_t::size
u64 size
Definition:
vhost_std.h:57
vhost_vring_state_t::index
u32 index
Definition:
vhost_std.h:35
vhost_memory_region_t::memory_size
u64 memory_size
Definition:
vhost_std.h:21
vhost_vring_addr_t::avail_user_addr
u64 avail_user_addr
Definition:
vhost_std.h:51
regions
vhost_user_memory_region_t regions[VHOST_MEMORY_MAX_NREGIONS]
Definition:
vhost_user.h:125
vhost_vring_addr_t::log_guest_addr
u64 log_guest_addr
Definition:
vhost_std.h:52
vhost_vring_addr_t::desc_user_addr
u64 desc_user_addr
Definition:
vhost_std.h:49
vhost_memory_t::nregions
u32 nregions
Definition:
vhost_std.h:28
vhost_memory_region_t::guest_phys_addr
u64 guest_phys_addr
Definition:
vhost_std.h:20
vhost_vring_state_t::num
u32 num
Definition:
vhost_std.h:36
vhost_user_log_t
Definition:
vhost_std.h:55
vhost_vring_addr_t::flags
u32 flags
Definition:
vhost_std.h:48
vhost_vring_state_t
Definition:
vhost_std.h:33
vhost_memory_region_t::userspace_addr
u64 userspace_addr
Definition:
vhost_std.h:22
vhost_vring_file_t::fd
int fd
Definition:
vhost_std.h:42
vhost_user_log_t::offset
u64 offset
Definition:
vhost_std.h:58
vhost_vring_addr_t::used_user_addr
u64 used_user_addr
Definition:
vhost_std.h:50
u64
unsigned long u64
Definition:
types.h:89
vhost_vring_addr_t::index
u32 index
Definition:
vhost_std.h:47
vhost_vring_file_t::index
u32 index
Definition:
vhost_std.h:41
u32
unsigned int u32
Definition:
types.h:88
vhost_memory_region_t::mmap_offset
u64 mmap_offset
Definition:
vhost_std.h:23
vhost_memory_t
Definition:
vhost_std.h:26
vhost_memory_t::padding
u32 padding
Definition:
vhost_std.h:29
vhost_memory_region_t
Definition:
vhost_std.h:18
vhost_vring_addr_t
Definition:
vhost_std.h:45
vhost_vring_file_t
Definition:
vhost_std.h:39
src
vnet
devices
virtio
vhost_std.h
Generated on Sat Jan 8 2022 10:04:47 for FD.io VPP by
1.8.17