FD.io VPP  v18.07-rc0-415-g6c78436
Vector Packet Processing
virtchnl.h
Go to the documentation of this file.
1 /*
2  *------------------------------------------------------------------
3  * Copyright (c) 2018 Cisco and/or its affiliates.
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at:
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  *------------------------------------------------------------------
16  */
17 
18 #define VIRTCHNL_VERSION_MAJOR 1
19 #define VIRTCHNL_VERSION_MINOR 1
20 
21 
22 #define AVFINT_DYN_CTLN(x) (0x00003800 + (0x4 * x))
23 #define AVFINT_ICR0 0x00004800
24 #define AVFINT_ICR0_ENA1 0x00005000
25 #define AVFINT_DYN_CTL0 0x00005C00
26 #define AVF_ARQBAH 0x00006000
27 #define AVF_ATQH 0x00006400
28 #define AVF_ATQLEN 0x00006800
29 #define AVF_ARQBAL 0x00006C00
30 #define AVF_ARQT 0x00007000
31 #define AVF_ARQH 0x00007400
32 #define AVF_ATQBAH 0x00007800
33 #define AVF_ATQBAL 0x00007C00
34 #define AVF_ARQLEN 0x00008000
35 #define AVF_ATQT 0x00008400
36 #define AVFGEN_RSTAT 0x00008800
37 #define AVF_QTX_TAIL(q) (0x00000000 + (0x4 * q))
38 #define AVF_QRX_TAIL(q) (0x00002000 + (0x4 * q))
39 
40 #define AVF_AQ_F_DD (1 << 0)
41 #define AVF_AQ_F_CMP (1 << 1)
42 #define AVF_AQ_F_ERR (1 << 2)
43 #define AVF_AQ_F_VFE (1 << 3)
44 #define AVF_AQ_F_LB (1 << 9)
45 #define AVF_AQ_F_RD (1 << 10)
46 #define AVF_AQ_F_VFC (1 << 11)
47 #define AVF_AQ_F_BUF (1 << 12)
48 #define AVF_AQ_F_SI (1 << 13)
49 #define AVF_AQ_F_EI (1 << 14)
50 #define AVF_AQ_F_FE (1 << 15)
51 
52 
53 #define foreach_virtchnl_op \
54  _(0, UNKNOWN) \
55  _(1, VERSION) \
56  _(2, RESET_VF) \
57  _(3, GET_VF_RESOURCES) \
58  _(4, CONFIG_TX_QUEUE) \
59  _(5, CONFIG_RX_QUEUE) \
60  _(6, CONFIG_VSI_QUEUES) \
61  _(7, CONFIG_IRQ_MAP) \
62  _(8, ENABLE_QUEUES) \
63  _(9, DISABLE_QUEUES) \
64  _(10, ADD_ETH_ADDR) \
65  _(11, DEL_ETH_ADDR) \
66  _(12, ADD_VLAN) \
67  _(13, DEL_VLAN) \
68  _(14, CONFIG_PROMISCUOUS_MODE) \
69  _(15, GET_STATS) \
70  _(16, RSVD) \
71  _(17, EVENT) \
72  _(18, UNDEF_18) \
73  _(19, UNDEF_19) \
74  _(20, IWARP) \
75  _(21, CONFIG_IWARP_IRQ_MAP) \
76  _(22, RELEASE_IWARP_IRQ_MAP) \
77  _(23, CONFIG_RSS_KEY) \
78  _(24, CONFIG_RSS_LUT) \
79  _(25, GET_RSS_HENA_CAPS) \
80  _(26, SET_RSS_HENA) \
81  _(27, ENABLE_VLAN_STRIPPING) \
82  _(28, DISABLE_VLAN_STRIPPING) \
83  _(29, REQUEST_QUEUES)
84 
85 typedef enum
86 {
87 #define _(v,n) VIRTCHNL_OP_##n = v,
89 #undef _
92 
93 typedef enum
94 {
102 
103 #define foreach_avf_vf_cap_flag \
104  _( 0, L2, "l2") \
105  _( 1, IWARP, "iwarp") \
106  _( 2, RSVD, "rsvd") \
107  _( 3, RSS_AQ, "rss-aq") \
108  _( 4, RSS_REG, "rss-reg") \
109  _( 5, WB_ON_ITR, "wb-on-itr") \
110  _( 6, REQ_QUEUES, "req-queues") \
111  _(16, VLAN, "vlan") \
112  _(17, RX_POLLING, "rx-polling") \
113  _(18, RSS_PCTYPE_V2, "rss-pctype-v2") \
114  _(19, RSS_PF, "rss-pf") \
115  _(20, ENCAP, "encap") \
116  _(21, ENCAP_CSUM, "encap-csum") \
117  _(22, RX_ENCAP_CSUM, "rx-encap-csum")
118 
119 typedef enum
120 {
121 #define _(a, b, c) VIRTCHNL_VF_OFFLOAD_##b = (1 << a),
123 #undef _
125 
126 typedef enum
127 {
131 
132 typedef struct
133 {
138  u8 default_mac_addr[6];
140 
141 typedef struct
142 {
152 
153 typedef enum
154 {
160 
161 #define foreach_virtchnl_link_speed \
162  _(1, 100MB, "100 Mbps") \
163  _(2, 1GB, "1 Gbps") \
164  _(3, 10GB, "10 Gbps") \
165  _(4, 40GB, "40 Gbps") \
166  _(5, 20GB, "20 Gbps") \
167  _(6, 25GB, "25 Gbps")
168 
169 typedef enum
170 {
172 #define _(a,b,c) VIRTCHNL_LINK_SPEED_##b = (1 << a),
174 #undef _
176 
177 typedef struct
178 {
180  union
181  {
182  struct
183  {
185  _Bool link_status;
186  } link_event;
187  } event_data;
188  int severity;
190 
192 
193 typedef struct
194 {
198 
199 typedef struct
200 {
205  union
206  {
209  };
210  union
211  {
214  };
217  union
218  {
221  };
222  union
223  {
226  };
227 } avf_aq_desc_t;
228 
230 
231 typedef struct
232 {
239 
241 
242 typedef struct
243 {
256 
258 
259 typedef struct
260 {
264 
265 typedef struct
266 {
272 
274 
275 typedef struct
276 {
282 
284 
285 typedef struct
286 {
294 
295 typedef struct
296 {
300 
302 
303 typedef struct
304 {
305  u8 addr[6];
306  u8 pad[2];
308 
309 typedef struct
310 {
315 
316 #define foreach_virtchnl_eth_stats \
317  _(rx_bytes) \
318  _(rx_unicast) \
319  _(rx_multicast) \
320  _(rx_broadcast) \
321  _(rx_discards) \
322  _(rx_unknown_protocol)\
323  _(tx_bytes) \
324  _(tx_unicast) \
325  _(tx_multicast) \
326  _(tx_broadcast) \
327  _(tx_discards) \
328  _(tx_errors)
329 
330 typedef struct
331 {
332 #define _(s) u64 s;
334 #undef _
336 
337 typedef struct
338 {
341  u8 key[1];
343 
345 
346 typedef struct
347 {
350  u8 lut[1];
352 
354 
355 /*
356  * fd.io coding-style-patch-verification: ON
357  *
358  * Local Variables:
359  * eval: (c-set-style "gnu")
360  * End:
361  */
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
#define foreach_avf_vf_cap_flag
Definition: virtchnl.h:103
virtchnl_vsi_type_t vsi_type
Definition: virtchnl.h:136
unsigned long u64
Definition: types.h:89
#define foreach_virtchnl_eth_stats
Definition: virtchnl.h:316
virtchnl_link_speed_t
Definition: virtchnl.h:169
virtchnl_vsi_type_t
Definition: virtchnl.h:126
unsigned char u8
Definition: types.h:56
virtchnl_ops_t
Definition: virtchnl.h:85
unsigned int u32
Definition: types.h:88
virtchnl_link_speed_t link_speed
Definition: virtchnl.h:184
virtchnl_txq_info_t txq
Definition: virtchnl.h:261
unsigned short u16
Definition: types.h:57
virtchnl_event_codes_t
Definition: virtchnl.h:153
virtchnl_status_code_t
Definition: virtchnl.h:93
virtchnl_ops_t v_opcode
Definition: virtchnl.h:208
virtchnl_status_code_t v_retval
Definition: virtchnl.h:213
STATIC_ASSERT_SIZEOF(virtchnl_pf_event_t, 16)
#define foreach_virtchnl_link_speed
Definition: virtchnl.h:161
virtchnl_event_codes_t event
Definition: virtchnl.h:179
virtchnl_rxq_info_t rxq
Definition: virtchnl.h:262
#define foreach_virtchnl_op
Definition: virtchnl.h:53
vhost_vring_addr_t addr
Definition: vhost-user.h:83
avf_vf_cap_flag_t
Definition: virtchnl.h:119