1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32#ifndef _ENA_ETH_IO_H_
33#define _ENA_ETH_IO_H_
34
35enum ena_eth_io_l3_proto_index {
36 ENA_ETH_IO_L3_PROTO_UNKNOWN = 0,
37
38 ENA_ETH_IO_L3_PROTO_IPV4 = 8,
39
40 ENA_ETH_IO_L3_PROTO_IPV6 = 11,
41
42 ENA_ETH_IO_L3_PROTO_FCOE = 21,
43
44 ENA_ETH_IO_L3_PROTO_ROCE = 22,
45};
46
47enum ena_eth_io_l4_proto_index {
48 ENA_ETH_IO_L4_PROTO_UNKNOWN = 0,
49
50 ENA_ETH_IO_L4_PROTO_TCP = 12,
51
52 ENA_ETH_IO_L4_PROTO_UDP = 13,
53
54 ENA_ETH_IO_L4_PROTO_ROUTEABLE_ROCE = 23,
55};
56
57struct ena_eth_io_tx_desc {
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79 u32 len_ctrl;
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111 u32 meta_ctrl;
112
113 u32 buff_addr_lo;
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130 u32 buff_addr_hi_hdr_sz;
131};
132
133struct ena_eth_io_tx_meta_desc {
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161 u32 len_ctrl;
162
163
164
165
166 u32 word1;
167
168
169
170
171
172
173
174
175
176 u32 word2;
177
178 u32 reserved;
179};
180
181struct ena_eth_io_tx_cdesc {
182
183 u16 req_id;
184
185 u8 status;
186
187
188
189
190
191 u8 flags;
192
193 u16 sub_qid;
194
195 u16 sq_head_idx;
196};
197
198struct ena_eth_io_rx_desc {
199
200 u16 length;
201
202
203 u8 reserved2;
204
205
206
207
208
209
210
211
212
213
214 u8 ctrl;
215
216 u16 req_id;
217
218
219 u16 reserved6;
220
221 u32 buff_addr_lo;
222
223 u16 buff_addr_hi;
224
225
226 u16 reserved16_w3;
227};
228
229
230
231
232struct ena_eth_io_rx_cdesc_base {
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259 u32 status;
260
261 u16 length;
262
263 u16 req_id;
264
265
266 u32 hash;
267
268 u16 sub_qid;
269
270 u16 reserved;
271};
272
273
274struct ena_eth_io_rx_cdesc_ext {
275 struct ena_eth_io_rx_cdesc_base base;
276
277 u32 buff_addr_lo;
278
279 u16 buff_addr_hi;
280
281 u16 reserved16;
282
283 u32 reserved_w6;
284
285 u32 reserved_w7;
286};
287
288struct ena_eth_io_intr_reg {
289
290
291
292
293
294 u32 intr_control;
295};
296
297struct ena_eth_io_numa_node_cfg_reg {
298
299
300
301
302 u32 numa_cfg;
303};
304
305
306#define ENA_ETH_IO_TX_DESC_LENGTH_MASK GENMASK(15, 0)
307#define ENA_ETH_IO_TX_DESC_REQ_ID_HI_SHIFT 16
308#define ENA_ETH_IO_TX_DESC_REQ_ID_HI_MASK GENMASK(21, 16)
309#define ENA_ETH_IO_TX_DESC_META_DESC_SHIFT 23
310#define ENA_ETH_IO_TX_DESC_META_DESC_MASK BIT(23)
311#define ENA_ETH_IO_TX_DESC_PHASE_SHIFT 24
312#define ENA_ETH_IO_TX_DESC_PHASE_MASK BIT(24)
313#define ENA_ETH_IO_TX_DESC_FIRST_SHIFT 26
314#define ENA_ETH_IO_TX_DESC_FIRST_MASK BIT(26)
315#define ENA_ETH_IO_TX_DESC_LAST_SHIFT 27
316#define ENA_ETH_IO_TX_DESC_LAST_MASK BIT(27)
317#define ENA_ETH_IO_TX_DESC_COMP_REQ_SHIFT 28
318#define ENA_ETH_IO_TX_DESC_COMP_REQ_MASK BIT(28)
319#define ENA_ETH_IO_TX_DESC_L3_PROTO_IDX_MASK GENMASK(3, 0)
320#define ENA_ETH_IO_TX_DESC_DF_SHIFT 4
321#define ENA_ETH_IO_TX_DESC_DF_MASK BIT(4)
322#define ENA_ETH_IO_TX_DESC_TSO_EN_SHIFT 7
323#define ENA_ETH_IO_TX_DESC_TSO_EN_MASK BIT(7)
324#define ENA_ETH_IO_TX_DESC_L4_PROTO_IDX_SHIFT 8
325#define ENA_ETH_IO_TX_DESC_L4_PROTO_IDX_MASK GENMASK(12, 8)
326#define ENA_ETH_IO_TX_DESC_L3_CSUM_EN_SHIFT 13
327#define ENA_ETH_IO_TX_DESC_L3_CSUM_EN_MASK BIT(13)
328#define ENA_ETH_IO_TX_DESC_L4_CSUM_EN_SHIFT 14
329#define ENA_ETH_IO_TX_DESC_L4_CSUM_EN_MASK BIT(14)
330#define ENA_ETH_IO_TX_DESC_ETHERNET_FCS_DIS_SHIFT 15
331#define ENA_ETH_IO_TX_DESC_ETHERNET_FCS_DIS_MASK BIT(15)
332#define ENA_ETH_IO_TX_DESC_L4_CSUM_PARTIAL_SHIFT 17
333#define ENA_ETH_IO_TX_DESC_L4_CSUM_PARTIAL_MASK BIT(17)
334#define ENA_ETH_IO_TX_DESC_REQ_ID_LO_SHIFT 22
335#define ENA_ETH_IO_TX_DESC_REQ_ID_LO_MASK GENMASK(31, 22)
336#define ENA_ETH_IO_TX_DESC_ADDR_HI_MASK GENMASK(15, 0)
337#define ENA_ETH_IO_TX_DESC_HEADER_LENGTH_SHIFT 24
338#define ENA_ETH_IO_TX_DESC_HEADER_LENGTH_MASK GENMASK(31, 24)
339
340
341#define ENA_ETH_IO_TX_META_DESC_REQ_ID_LO_MASK GENMASK(9, 0)
342#define ENA_ETH_IO_TX_META_DESC_EXT_VALID_SHIFT 14
343#define ENA_ETH_IO_TX_META_DESC_EXT_VALID_MASK BIT(14)
344#define ENA_ETH_IO_TX_META_DESC_MSS_HI_SHIFT 16
345#define ENA_ETH_IO_TX_META_DESC_MSS_HI_MASK GENMASK(19, 16)
346#define ENA_ETH_IO_TX_META_DESC_ETH_META_TYPE_SHIFT 20
347#define ENA_ETH_IO_TX_META_DESC_ETH_META_TYPE_MASK BIT(20)
348#define ENA_ETH_IO_TX_META_DESC_META_STORE_SHIFT 21
349#define ENA_ETH_IO_TX_META_DESC_META_STORE_MASK BIT(21)
350#define ENA_ETH_IO_TX_META_DESC_META_DESC_SHIFT 23
351#define ENA_ETH_IO_TX_META_DESC_META_DESC_MASK BIT(23)
352#define ENA_ETH_IO_TX_META_DESC_PHASE_SHIFT 24
353#define ENA_ETH_IO_TX_META_DESC_PHASE_MASK BIT(24)
354#define ENA_ETH_IO_TX_META_DESC_FIRST_SHIFT 26
355#define ENA_ETH_IO_TX_META_DESC_FIRST_MASK BIT(26)
356#define ENA_ETH_IO_TX_META_DESC_LAST_SHIFT 27
357#define ENA_ETH_IO_TX_META_DESC_LAST_MASK BIT(27)
358#define ENA_ETH_IO_TX_META_DESC_COMP_REQ_SHIFT 28
359#define ENA_ETH_IO_TX_META_DESC_COMP_REQ_MASK BIT(28)
360#define ENA_ETH_IO_TX_META_DESC_REQ_ID_HI_MASK GENMASK(5, 0)
361#define ENA_ETH_IO_TX_META_DESC_L3_HDR_LEN_MASK GENMASK(7, 0)
362#define ENA_ETH_IO_TX_META_DESC_L3_HDR_OFF_SHIFT 8
363#define ENA_ETH_IO_TX_META_DESC_L3_HDR_OFF_MASK GENMASK(15, 8)
364#define ENA_ETH_IO_TX_META_DESC_L4_HDR_LEN_IN_WORDS_SHIFT 16
365#define ENA_ETH_IO_TX_META_DESC_L4_HDR_LEN_IN_WORDS_MASK GENMASK(21, 16)
366#define ENA_ETH_IO_TX_META_DESC_MSS_LO_SHIFT 22
367#define ENA_ETH_IO_TX_META_DESC_MSS_LO_MASK GENMASK(31, 22)
368
369
370#define ENA_ETH_IO_TX_CDESC_PHASE_MASK BIT(0)
371
372
373#define ENA_ETH_IO_RX_DESC_PHASE_MASK BIT(0)
374#define ENA_ETH_IO_RX_DESC_FIRST_SHIFT 2
375#define ENA_ETH_IO_RX_DESC_FIRST_MASK BIT(2)
376#define ENA_ETH_IO_RX_DESC_LAST_SHIFT 3
377#define ENA_ETH_IO_RX_DESC_LAST_MASK BIT(3)
378#define ENA_ETH_IO_RX_DESC_COMP_REQ_SHIFT 4
379#define ENA_ETH_IO_RX_DESC_COMP_REQ_MASK BIT(4)
380
381
382#define ENA_ETH_IO_RX_CDESC_BASE_L3_PROTO_IDX_MASK GENMASK(4, 0)
383#define ENA_ETH_IO_RX_CDESC_BASE_SRC_VLAN_CNT_SHIFT 5
384#define ENA_ETH_IO_RX_CDESC_BASE_SRC_VLAN_CNT_MASK GENMASK(6, 5)
385#define ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_SHIFT 8
386#define ENA_ETH_IO_RX_CDESC_BASE_L4_PROTO_IDX_MASK GENMASK(12, 8)
387#define ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM_ERR_SHIFT 13
388#define ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM_ERR_MASK BIT(13)
389#define ENA_ETH_IO_RX_CDESC_BASE_L4_CSUM_ERR_SHIFT 14
390#define ENA_ETH_IO_RX_CDESC_BASE_L4_CSUM_ERR_MASK BIT(14)
391#define ENA_ETH_IO_RX_CDESC_BASE_IPV4_FRAG_SHIFT 15
392#define ENA_ETH_IO_RX_CDESC_BASE_IPV4_FRAG_MASK BIT(15)
393#define ENA_ETH_IO_RX_CDESC_BASE_PHASE_SHIFT 24
394#define ENA_ETH_IO_RX_CDESC_BASE_PHASE_MASK BIT(24)
395#define ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM2_SHIFT 25
396#define ENA_ETH_IO_RX_CDESC_BASE_L3_CSUM2_MASK BIT(25)
397#define ENA_ETH_IO_RX_CDESC_BASE_FIRST_SHIFT 26
398#define ENA_ETH_IO_RX_CDESC_BASE_FIRST_MASK BIT(26)
399#define ENA_ETH_IO_RX_CDESC_BASE_LAST_SHIFT 27
400#define ENA_ETH_IO_RX_CDESC_BASE_LAST_MASK BIT(27)
401#define ENA_ETH_IO_RX_CDESC_BASE_BUFFER_SHIFT 30
402#define ENA_ETH_IO_RX_CDESC_BASE_BUFFER_MASK BIT(30)
403
404
405#define ENA_ETH_IO_INTR_REG_RX_INTR_DELAY_MASK GENMASK(14, 0)
406#define ENA_ETH_IO_INTR_REG_TX_INTR_DELAY_SHIFT 15
407#define ENA_ETH_IO_INTR_REG_TX_INTR_DELAY_MASK GENMASK(29, 15)
408#define ENA_ETH_IO_INTR_REG_INTR_UNMASK_SHIFT 30
409#define ENA_ETH_IO_INTR_REG_INTR_UNMASK_MASK BIT(30)
410
411
412#define ENA_ETH_IO_NUMA_NODE_CFG_REG_NUMA_MASK GENMASK(7, 0)
413#define ENA_ETH_IO_NUMA_NODE_CFG_REG_ENABLED_SHIFT 31
414#define ENA_ETH_IO_NUMA_NODE_CFG_REG_ENABLED_MASK BIT(31)
415
416#endif
417