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