|
FD.io VPP
v21.06-3-gbb25fbf28
Vector Packet Processing
|
Go to the documentation of this file.
15 #ifndef __VIRTIO_STD_H__
16 #define __VIRTIO_STD_H__
18 #define foreach_virtio_net_features \
19 _ (VIRTIO_NET_F_CSUM, 0) \
20 _ (VIRTIO_NET_F_GUEST_CSUM, 1) \
21 _ (VIRTIO_NET_F_CTRL_GUEST_OFFLOADS, 2) \
22 _ (VIRTIO_NET_F_MTU, 3) \
23 _ (VIRTIO_NET_F_MAC, 5) \
24 _ (VIRTIO_NET_F_GSO, 6) \
25 _ (VIRTIO_NET_F_GUEST_TSO4, 7) \
26 _ (VIRTIO_NET_F_GUEST_TSO6, 8) \
27 _ (VIRTIO_NET_F_GUEST_ECN, 9) \
28 _ (VIRTIO_NET_F_GUEST_UFO, 10) \
29 _ (VIRTIO_NET_F_HOST_TSO4, 11) \
30 _ (VIRTIO_NET_F_HOST_TSO6, 12) \
31 _ (VIRTIO_NET_F_HOST_ECN, 13) \
32 _ (VIRTIO_NET_F_HOST_UFO, 14) \
33 _ (VIRTIO_NET_F_MRG_RXBUF, 15) \
34 _ (VIRTIO_NET_F_STATUS, 16) \
35 _ (VIRTIO_NET_F_CTRL_VQ, 17) \
36 _ (VIRTIO_NET_F_CTRL_RX, 18) \
37 _ (VIRTIO_NET_F_CTRL_VLAN, 19) \
38 _ (VIRTIO_NET_F_CTRL_RX_EXTRA, 20) \
39 _ (VIRTIO_NET_F_GUEST_ANNOUNCE, 21) \
40 _ (VIRTIO_NET_F_MQ, 22) \
41 _ (VIRTIO_NET_F_CTRL_MAC_ADDR, 23) \
42 _ (VIRTIO_F_NOTIFY_ON_EMPTY, 24) \
43 _ (VHOST_F_LOG_ALL, 26) \
44 _ (VIRTIO_F_ANY_LAYOUT, 27) \
45 _ (VIRTIO_RING_F_INDIRECT_DESC, 28) \
46 _ (VIRTIO_RING_F_EVENT_IDX, 29)
50 _ (VHOST_USER_F_PROTOCOL_FEATURES, 30) \
51 _ (VIRTIO_F_VERSION_1, 32) \
52 _ (VIRTIO_F_IOMMU_PLATFORM, 33) \
53 _ (VIRTIO_F_RING_PACKED, 34) \
54 _ (VIRTIO_F_IN_ORDER, 35) \
56 _ (VIRTIO_F_ORDER_PLATFORM, 36) \
58 _ (VIRTIO_F_NOTIFICATION_DATA, 38) \
60 _ (VIRTIO_NET_F_SPEED_DUPLEX, 63)
69 #define VIRTIO_FEATURE(X) (1ULL << X)
71 #define VRING_MAX_SIZE 32768
73 #define VRING_DESC_F_NEXT 1
74 #define VRING_DESC_F_WRITE 2
75 #define VRING_DESC_F_INDIRECT 4
77 #define VRING_DESC_F_AVAIL (1 << 7)
78 #define VRING_DESC_F_USED (1 << 15)
80 #define foreach_virtio_event_idx_flags \
81 _ (VRING_EVENT_F_ENABLE, 0) \
82 _ (VRING_EVENT_F_DISABLE, 1) \
83 _ (VRING_EVENT_F_DESC, 2)
92 #define VRING_USED_F_NO_NOTIFY 1
93 #define VRING_AVAIL_F_NO_INTERRUPT 1
132 }) vring_packed_desc_t;
140 }) vring_desc_event_t;
142 #define VIRTIO_NET_HDR_F_NEEDS_CSUM 1
143 #define VIRTIO_NET_HDR_F_DATA_VALID 2
145 #define VIRTIO_NET_HDR_GSO_NONE 0
146 #define VIRTIO_NET_HDR_GSO_TCPV4 1
147 #define VIRTIO_NET_HDR_GSO_UDP 3
148 #define VIRTIO_NET_HDR_GSO_TCPV6 4
149 #define VIRTIO_NET_HDR_GSO_ECN 0x80
160 }) virtio_net_hdr_v1_t;
174 virtio_net_hdr_t hdr;
176 }) virtio_net_hdr_mrg_rxbuf_t;
197 sizeof (
u16) * (3 + num) + align - 1) & ~(align -
205 + align - 1) & ~(align - 1))
typedef CLIB_PACKED(struct { u64 addr;u32 len;u16 id;u16 flags;}) vring_packed_desc_t
static_always_inline u16 vring_size(u32 num, u32 align)
#define static_always_inline
STATIC_ASSERT_SIZEOF(vring_packed_desc_t, 16)
#define foreach_virtio_event_idx_flags
#define foreach_virtio_net_features
static_always_inline void vring_init(vring_t *vr, u32 num, void *p, u32 align)
vl_api_wireguard_peer_flags_t flags