FD.io VPP  v18.10-34-gcce845e
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 #ifndef _AVF_VIRTCHNL_H_
19 #define _AVF_VIRTCHNL_H_
20 
21 #define VIRTCHNL_VERSION_MAJOR 1
22 #define VIRTCHNL_VERSION_MINOR 1
23 
24 
25 #define AVFINT_DYN_CTLN(x) (0x00003800 + (0x4 * x))
26 #define AVFINT_ICR0 0x00004800
27 #define AVFINT_ICR0_ENA1 0x00005000
28 #define AVFINT_DYN_CTL0 0x00005C00
29 #define AVF_ARQBAH 0x00006000
30 #define AVF_ATQH 0x00006400
31 #define AVF_ATQLEN 0x00006800
32 #define AVF_ARQBAL 0x00006C00
33 #define AVF_ARQT 0x00007000
34 #define AVF_ARQH 0x00007400
35 #define AVF_ATQBAH 0x00007800
36 #define AVF_ATQBAL 0x00007C00
37 #define AVF_ARQLEN 0x00008000
38 #define AVF_ATQT 0x00008400
39 #define AVFGEN_RSTAT 0x00008800
40 #define AVF_QTX_TAIL(q) (0x00000000 + (0x4 * q))
41 #define AVF_QRX_TAIL(q) (0x00002000 + (0x4 * q))
42 
43 #define AVF_AQ_F_DD (1 << 0)
44 #define AVF_AQ_F_CMP (1 << 1)
45 #define AVF_AQ_F_ERR (1 << 2)
46 #define AVF_AQ_F_VFE (1 << 3)
47 #define AVF_AQ_F_LB (1 << 9)
48 #define AVF_AQ_F_RD (1 << 10)
49 #define AVF_AQ_F_VFC (1 << 11)
50 #define AVF_AQ_F_BUF (1 << 12)
51 #define AVF_AQ_F_SI (1 << 13)
52 #define AVF_AQ_F_EI (1 << 14)
53 #define AVF_AQ_F_FE (1 << 15)
54 
55 
56 #define foreach_virtchnl_op \
57  _(0, UNKNOWN) \
58  _(1, VERSION) \
59  _(2, RESET_VF) \
60  _(3, GET_VF_RESOURCES) \
61  _(4, CONFIG_TX_QUEUE) \
62  _(5, CONFIG_RX_QUEUE) \
63  _(6, CONFIG_VSI_QUEUES) \
64  _(7, CONFIG_IRQ_MAP) \
65  _(8, ENABLE_QUEUES) \
66  _(9, DISABLE_QUEUES) \
67  _(10, ADD_ETH_ADDR) \
68  _(11, DEL_ETH_ADDR) \
69  _(12, ADD_VLAN) \
70  _(13, DEL_VLAN) \
71  _(14, CONFIG_PROMISCUOUS_MODE) \
72  _(15, GET_STATS) \
73  _(16, RSVD) \
74  _(17, EVENT) \
75  _(18, UNDEF_18) \
76  _(19, UNDEF_19) \
77  _(20, IWARP) \
78  _(21, CONFIG_IWARP_IRQ_MAP) \
79  _(22, RELEASE_IWARP_IRQ_MAP) \
80  _(23, CONFIG_RSS_KEY) \
81  _(24, CONFIG_RSS_LUT) \
82  _(25, GET_RSS_HENA_CAPS) \
83  _(26, SET_RSS_HENA) \
84  _(27, ENABLE_VLAN_STRIPPING) \
85  _(28, DISABLE_VLAN_STRIPPING) \
86  _(29, REQUEST_QUEUES)
87 
88 typedef enum
89 {
90 #define _(v,n) VIRTCHNL_OP_##n = v,
92 #undef _
95 
96 typedef enum
97 {
105 
106 #define foreach_avf_vf_cap_flag \
107  _( 0, L2, "l2") \
108  _( 1, IWARP, "iwarp") \
109  _( 2, RSVD, "rsvd") \
110  _( 3, RSS_AQ, "rss-aq") \
111  _( 4, RSS_REG, "rss-reg") \
112  _( 5, WB_ON_ITR, "wb-on-itr") \
113  _( 6, REQ_QUEUES, "req-queues") \
114  _(16, VLAN, "vlan") \
115  _(17, RX_POLLING, "rx-polling") \
116  _(18, RSS_PCTYPE_V2, "rss-pctype-v2") \
117  _(19, RSS_PF, "rss-pf") \
118  _(20, ENCAP, "encap") \
119  _(21, ENCAP_CSUM, "encap-csum") \
120  _(22, RX_ENCAP_CSUM, "rx-encap-csum")
121 
122 typedef enum
123 {
124 #define _(a, b, c) VIRTCHNL_VF_OFFLOAD_##b = (1 << a),
126 #undef _
128 
129 typedef enum
130 {
134 
135 typedef enum
136 {
141 
142 typedef struct
143 {
148  u8 default_mac_addr[6];
150 
151 typedef struct
152 {
162 
163 typedef enum
164 {
170 
171 #define foreach_virtchnl_link_speed \
172  _(1, 100MB, "100 Mbps") \
173  _(2, 1GB, "1 Gbps") \
174  _(3, 10GB, "10 Gbps") \
175  _(4, 40GB, "40 Gbps") \
176  _(5, 20GB, "20 Gbps") \
177  _(6, 25GB, "25 Gbps")
178 
179 typedef enum
180 {
182 #define _(a,b,c) VIRTCHNL_LINK_SPEED_##b = (1 << a),
184 #undef _
186 
187 typedef struct
188 {
190  union
191  {
192  struct
193  {
195  _Bool link_status;
196  } link_event;
197  } event_data;
198  int severity;
200 
202 
203 typedef struct
204 {
208 
209 typedef struct
210 {
215  union
216  {
219  };
220  union
221  {
224  };
227  union
228  {
231  };
232  union
233  {
236  };
237 } avf_aq_desc_t;
238 
240 
241 typedef struct
242 {
249 
251 
252 typedef struct
253 {
266 
268 
269 typedef struct
270 {
274 
275 typedef struct
276 {
282 
284 
285 typedef struct
286 {
292 
294 
295 typedef struct
296 {
304 
305 typedef struct
306 {
310 
312 
313 typedef struct
314 {
315  u8 addr[6];
316  u8 pad[2];
318 
319 typedef struct
320 {
325 
326 #define foreach_virtchnl_eth_stats \
327  _(rx_bytes) \
328  _(rx_unicast) \
329  _(rx_multicast) \
330  _(rx_broadcast) \
331  _(rx_discards) \
332  _(rx_unknown_protocol)\
333  _(tx_bytes) \
334  _(tx_unicast) \
335  _(tx_multicast) \
336  _(tx_broadcast) \
337  _(tx_discards) \
338  _(tx_errors)
339 
340 typedef struct
341 {
342 #define _(s) u64 s;
344 #undef _
346 
347 typedef struct
348 {
351  u8 key[1];
353 
355 
356 typedef struct
357 {
360  u8 lut[1];
362 
364 
365 /* VIRTCHNL_OP_REQUEST_QUEUES */
366 typedef struct
367 {
370 
371 #endif /* AVF_VIRTCHNL_H */
372 
373 /*
374  * fd.io coding-style-patch-verification: ON
375  *
376  * Local Variables:
377  * eval: (c-set-style "gnu")
378  * End:
379  */
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
#define foreach_avf_vf_cap_flag
Definition: virtchnl.h:106
virtchnl_vsi_type_t vsi_type
Definition: virtchnl.h:146
unsigned long u64
Definition: types.h:89
#define foreach_virtchnl_eth_stats
Definition: virtchnl.h:326
virtchnl_link_speed_t
Definition: virtchnl.h:179
virtchnl_vsi_type_t
Definition: virtchnl.h:129
vhost_vring_addr_t addr
Definition: vhost_user.h:121
unsigned char u8
Definition: types.h:56
virtchnl_ops_t
Definition: virtchnl.h:88
unsigned int u32
Definition: types.h:88
virtchnl_link_speed_t link_speed
Definition: virtchnl.h:194
virtchnl_vfr_states_t
Definition: virtchnl.h:135
virtchnl_txq_info_t txq
Definition: virtchnl.h:271
unsigned short u16
Definition: types.h:57
virtchnl_event_codes_t
Definition: virtchnl.h:163
virtchnl_status_code_t
Definition: virtchnl.h:96
virtchnl_ops_t v_opcode
Definition: virtchnl.h:218
virtchnl_status_code_t v_retval
Definition: virtchnl.h:223
STATIC_ASSERT_SIZEOF(virtchnl_pf_event_t, 16)
#define foreach_virtchnl_link_speed
Definition: virtchnl.h:171
virtchnl_event_codes_t event
Definition: virtchnl.h:189
virtchnl_rxq_info_t rxq
Definition: virtchnl.h:272
#define foreach_virtchnl_op
Definition: virtchnl.h:56
avf_vf_cap_flag_t
Definition: virtchnl.h:122