FD.io VPP  v19.08.2-294-g37e99c22d
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 #define foreach_avf_promisc_flags \
25  _(0, UNICAST_PROMISC, "unicast") \
26  _(1, MULTICAST_PROMISC, "multicast")
27 
28 enum
29 {
30 #define _(a, b, c) FLAG_VF_ ##b = (1 << a),
32 #undef _
33 };
34 
35 #define AVFINT_DYN_CTLN(x) (0x00003800 + (0x4 * x))
36 #define AVFINT_ICR0 0x00004800
37 #define AVFINT_ICR0_ENA1 0x00005000
38 #define AVFINT_DYN_CTL0 0x00005C00
39 #define AVF_ARQBAH 0x00006000
40 #define AVF_ATQH 0x00006400
41 #define AVF_ATQLEN 0x00006800
42 #define AVF_ARQBAL 0x00006C00
43 #define AVF_ARQT 0x00007000
44 #define AVF_ARQH 0x00007400
45 #define AVF_ATQBAH 0x00007800
46 #define AVF_ATQBAL 0x00007C00
47 #define AVF_ARQLEN 0x00008000
48 #define AVF_ATQT 0x00008400
49 #define AVFGEN_RSTAT 0x00008800
50 #define AVF_QTX_TAIL(q) (0x00000000 + (0x4 * q))
51 #define AVF_QRX_TAIL(q) (0x00002000 + (0x4 * q))
52 
53 #define AVF_AQ_F_DD (1 << 0)
54 #define AVF_AQ_F_CMP (1 << 1)
55 #define AVF_AQ_F_ERR (1 << 2)
56 #define AVF_AQ_F_VFE (1 << 3)
57 #define AVF_AQ_F_LB (1 << 9)
58 #define AVF_AQ_F_RD (1 << 10)
59 #define AVF_AQ_F_VFC (1 << 11)
60 #define AVF_AQ_F_BUF (1 << 12)
61 #define AVF_AQ_F_SI (1 << 13)
62 #define AVF_AQ_F_EI (1 << 14)
63 #define AVF_AQ_F_FE (1 << 15)
64 
65 
66 #define foreach_virtchnl_op \
67  _(0, UNKNOWN) \
68  _(1, VERSION) \
69  _(2, RESET_VF) \
70  _(3, GET_VF_RESOURCES) \
71  _(4, CONFIG_TX_QUEUE) \
72  _(5, CONFIG_RX_QUEUE) \
73  _(6, CONFIG_VSI_QUEUES) \
74  _(7, CONFIG_IRQ_MAP) \
75  _(8, ENABLE_QUEUES) \
76  _(9, DISABLE_QUEUES) \
77  _(10, ADD_ETH_ADDR) \
78  _(11, DEL_ETH_ADDR) \
79  _(12, ADD_VLAN) \
80  _(13, DEL_VLAN) \
81  _(14, CONFIG_PROMISCUOUS_MODE) \
82  _(15, GET_STATS) \
83  _(16, RSVD) \
84  _(17, EVENT) \
85  _(18, UNDEF_18) \
86  _(19, UNDEF_19) \
87  _(20, IWARP) \
88  _(21, CONFIG_IWARP_IRQ_MAP) \
89  _(22, RELEASE_IWARP_IRQ_MAP) \
90  _(23, CONFIG_RSS_KEY) \
91  _(24, CONFIG_RSS_LUT) \
92  _(25, GET_RSS_HENA_CAPS) \
93  _(26, SET_RSS_HENA) \
94  _(27, ENABLE_VLAN_STRIPPING) \
95  _(28, DISABLE_VLAN_STRIPPING) \
96  _(29, REQUEST_QUEUES) \
97  _(30, ENABLE_CHANNELS) \
98  _(31, DISABLE_CHANNELS) \
99  _(32, ADD_CLOUD_FILTER) \
100  _(33, DEL_CLOUD_FILTER)
101 
102 
103 typedef enum
104 {
105 #define _(v,n) VIRTCHNL_OP_##n = v,
107 #undef _
110 
111 typedef enum
112 {
122 
123 #define foreach_avf_vf_cap_flag \
124  _( 0, OFFLOAD_L2, "l2") \
125  _( 1, OFFLOAD_IWARP, "iwarp") \
126  _( 2, OFFLOAD_RSVD, "rsvd") \
127  _( 3, OFFLOAD_RSS_AQ, "rss-aq") \
128  _( 4, OFFLOAD_RSS_REG, "rss-reg") \
129  _( 5, OFFLOAD_WB_ON_ITR, "wb-on-itr") \
130  _( 6, OFFLOAD_REQ_QUEUES, "req-queues") \
131  _( 7, CAP_ADV_LINK_SPEED, "adv-link-speed") \
132  _(16, OFFLOAD_VLAN, "vlan") \
133  _(17, OFFLOAD_RX_POLLING, "rx-polling") \
134  _(18, OFFLOAD_RSS_PCTYPE_V2, "rss-pctype-v2") \
135  _(19, OFFLOAD_RSS_PF, "rss-pf") \
136  _(20, OFFLOAD_ENCAP, "encap") \
137  _(21, OFFLOAD_ENCAP_CSUM, "encap-csum") \
138  _(22, OFFLOAD_RX_ENCAP_CSUM, "rx-encap-csum") \
139  _(23, OFFLOAD_ADQ, "offload-adq")
140 
141 typedef enum
142 {
143 #define _(a, b, c) VIRTCHNL_VF_##b = (1 << a),
145 #undef _
147 
148 typedef enum
149 {
153 
154 typedef enum
155 {
160 
161 typedef struct
162 {
167  u8 default_mac_addr[6];
169 
170 typedef struct
171 {
181 
182 #define foreach_virtchnl_event_code \
183  _(0, UNKNOWN) \
184  _(1, LINK_CHANGE) \
185  _(2, RESET_IMPENDING) \
186  _(3, PF_DRIVER_CLOSE)
187 
188 typedef enum
189 {
190 #define _(a,b) VIRTCHNL_EVENT_##b = (a),
192 #undef _
194 
195 #define foreach_virtchnl_link_speed \
196  _(0, 2_5GB, "2.5 Gbps") \
197  _(1, 100MB, "100 Mbps") \
198  _(2, 1GB, "1 Gbps") \
199  _(3, 10GB, "10 Gbps") \
200  _(4, 40GB, "40 Gbps") \
201  _(5, 20GB, "20 Gbps") \
202  _(6, 25GB, "25 Gbps") \
203  _(7, 5GB, "5 Gbps")
204 
205 typedef enum
206 {
208 #define _(a,b,c) VIRTCHNL_LINK_SPEED_##b = (1 << a),
210 #undef _
212 
213 typedef struct
214 {
216  union
217  {
218  struct
219  {
222  } link_event;
223  struct
224  {
226  u8 link_status;
227  } link_event_adv;
228  } event_data;
229  int severity;
231 
233 
234 typedef struct
235 {
239 
240 typedef struct
241 {
246  union
247  {
250  };
251  union
252  {
255  };
258  union
259  {
262  };
263  union
264  {
267  };
268 } avf_aq_desc_t;
269 
271 
272 typedef struct
273 {
280 
282 
283 typedef struct
284 {
297 
299 
300 typedef struct
301 {
305 
306 typedef struct
307 {
313 
315 
316 typedef struct
317 {
323 
325 
326 typedef struct
327 {
335 
336 typedef struct
337 {
341 
343 
344 typedef struct
345 {
346  u8 addr[6];
347  u8 pad[2];
349 
350 typedef struct
351 {
356 
357 #define foreach_virtchnl_eth_stats \
358  _(rx_bytes) \
359  _(rx_unicast) \
360  _(rx_multicast) \
361  _(rx_broadcast) \
362  _(rx_discards) \
363  _(rx_unknown_protocol)\
364  _(tx_bytes) \
365  _(tx_unicast) \
366  _(tx_multicast) \
367  _(tx_broadcast) \
368  _(tx_discards) \
369  _(tx_errors)
370 
371 typedef struct
372 {
373 #define _(s) u64 s;
375 #undef _
377 
378 typedef struct
379 {
382  u8 key[1];
384 
386 
387 typedef struct
388 {
391  u8 lut[1];
393 
395 
396 /* VIRTCHNL_OP_REQUEST_QUEUES */
397 typedef struct
398 {
401 
402 #endif /* AVF_VIRTCHNL_H */
403 
404 /*
405  * fd.io coding-style-patch-verification: ON
406  *
407  * Local Variables:
408  * eval: (c-set-style "gnu")
409  * End:
410  */
u8 pad[3]
log2 (size of the packing page block)
Definition: bihash_doc.h:61
#define foreach_avf_vf_cap_flag
Definition: virtchnl.h:123
virtchnl_vsi_type_t vsi_type
Definition: virtchnl.h:165
unsigned long u64
Definition: types.h:89
#define foreach_virtchnl_eth_stats
Definition: virtchnl.h:357
virtchnl_link_speed_t
Definition: virtchnl.h:205
virtchnl_vsi_type_t
Definition: virtchnl.h:148
vhost_vring_addr_t addr
Definition: vhost_user.h:147
unsigned char u8
Definition: types.h:56
virtchnl_ops_t
Definition: virtchnl.h:103
#define foreach_virtchnl_event_code
Definition: virtchnl.h:182
unsigned int u32
Definition: types.h:88
virtchnl_link_speed_t link_speed
Definition: virtchnl.h:220
virtchnl_vfr_states_t
Definition: virtchnl.h:154
virtchnl_txq_info_t txq
Definition: virtchnl.h:302
unsigned short u16
Definition: types.h:57
#define foreach_avf_promisc_flags
Definition: virtchnl.h:24
virtchnl_event_codes_t
Definition: virtchnl.h:188
virtchnl_status_code_t
Definition: virtchnl.h:111
virtchnl_ops_t v_opcode
Definition: virtchnl.h:249
virtchnl_status_code_t v_retval
Definition: virtchnl.h:254
STATIC_ASSERT_SIZEOF(virtchnl_pf_event_t, 16)
#define foreach_virtchnl_link_speed
Definition: virtchnl.h:195
virtchnl_event_codes_t event
Definition: virtchnl.h:215
virtchnl_rxq_info_t rxq
Definition: virtchnl.h:303
#define foreach_virtchnl_op
Definition: virtchnl.h:66
typedef key
Definition: ipsec.api:247
avf_vf_cap_flag_t
Definition: virtchnl.h:141