Emulex Logo
OneCoreā„¢ Storage SDK Release 11.2
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
sli4_be3_iscsi.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2011-2015, Emulex
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * 1. Redistributions of source code must retain the above copyright notice,
9  * this list of conditions and the following disclaimer.
10  *
11  * 2. Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * 3. Neither the name of the copyright holder nor the names of its contributors
16  * may be used to endorse or promote products derived from this software
17  * without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
23  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29  * POSSIBILITY OF SUCH DAMAGE.
30  *
31  */
32 
33 /**
34  * @file
35  * Define iSCSI SLI-4 structures and function prototypes (BE3: Blade Engine 3)
36  */
37 
38 #ifndef _SLI4_BE3_ISCSI_H
39 #define _SLI4_BE3_ISCSI_H
40 
41 /**
42  * @brief WQE used to for INITIATOR_WRITE_COMMAND WQE (data from ini->Tgt)
43  */
44 typedef struct sli4_be3_wqe_ini_write_s {
45 #if BYTE_ORDER == LITTLE_ENDIAN
46  uint32_t lun:14,
47  :1,
48  inv:1,
49  wrb_index:8,
50  dsp:1,
51  :3,
52  type:4;
53 
54  uint32_t next_wqe:8,
55  exp_xfer_len:24;
56 
57  uint32_t icd_index:16,
58  :16;
59 
60  uint32_t rsvd1;
61  uint32_t bhs_addr_high;
62  uint32_t bhs_addr_low;
63  uint32_t cmdsn;
64  uint32_t dif_ref_tag;
65  uint32_t sge0_addr_high;
66  uint32_t sge0_addr_low;
67 
68  uint32_t sge0_offset:22,
69  :1,
70  dif_mode:2,
71  dif_blk_size:3,
72  :3,
73  s0l:1;
74 
75  uint32_t sge0_length:17,
76  :15;
77 
78  uint32_t sge1_addr_high;
79  uint32_t sge1_addr_low;
80 
81  uint32_t sge1_offset:22,
82  :9,
83  s1l:1;
84 
85  uint32_t sge1_length:17,
86  :15;
87 #else
88 #error big endian version not defined
89 #endif
91 
92 
93 /**
94  * @brief WQE used to for INITIATOR_TMF WQE
95  */
96 typedef struct sli4_be3_wqe_ini_tmf_s {
97 #if BYTE_ORDER == LITTLE_ENDIAN
98  uint32_t lun:14,
99  :1,
100  inv:1,
101  wrb_index:8,
102  :4,
103  type:4;
104 
105  uint32_t next_wqe:8,
106  :24;
107 
108  uint32_t icd_index:16,
109  :16;
110 
111  uint32_t rsvd1;
112  uint32_t bhs_addr_high;
113  uint32_t bhs_addr_low;
114  uint32_t cmdsn;
115  uint32_t rsvd2[9];
116 #else
117 #error big endian version not defined
118 #endif
120 
121 
122 /**
123  * @brief WQE used to for INITIATOR_NOP_OUT WQE (data from ini->Tgt)
124  */
125 typedef struct sli4_be3_wqe_ini_nop_s {
126 #if BYTE_ORDER == LITTLE_ENDIAN
127  uint32_t rsvd1:15,
128  inv:1,
129  wrb_index:8,
130  dsp:1,
131  dm:1,
132  :2,
133  type:4;
134  uint32_t next_wqe:8,
135  exp_xfer_len:24;
136  uint32_t icd_index:16,
137  :16;
138  uint32_t rsvd2;
139  uint32_t bhs_addr_high;
140  uint32_t bhs_addr_low;
141  uint32_t cmdsn;
142  uint32_t rsvd3;
143  uint32_t sge0_addr_high;
144  uint32_t sge0_addr_low;
145  uint32_t sge0_offset:22,
146  :9,
147  s0l:1;
148  uint32_t sge0_length:17,
149  :15;
150  uint32_t sge1_addr_high;
151  uint32_t sge1_addr_low;
152  uint32_t sge1_offset:22,
153  :9,
154  s1l:1;
155  uint32_t sge1_length:17,
156  :15;
157 #else
158 #error big endian version not defined
159 #endif
161 
162 
163 /**
164  * @brief WQE used to for INITIATOR_READ WQE (data from ini->Tgt)
165  */
166 typedef struct sli4_be3_wqe_ini_read_s {
167 #if BYTE_ORDER == LITTLE_ENDIAN
168  uint32_t lun:14,
169  :1,
170  inv:1,
171  wrb_index:8,
172  :4,
173  type:4;
174 
175  uint32_t next_wqe:8,
176  exp_xfer_len:24;
177 
178  uint32_t icd_index:16,
179  :16;
180 
181  uint32_t rsvd1;
182  uint32_t bhs_addr_high;
183  uint32_t bhs_addr_low;
184  uint32_t cmdsn;
185  uint32_t dif_ref_tag;
186  uint32_t sge0_addr_high;
187  uint32_t sge0_addr_low;
188 
189  uint32_t sge0_offset:22,
190  :1,
191  dif_mode:2,
192  dif_blk_size:3,
193  :3,
194  s0l:1;
195 
196  uint32_t sge0_length:17,
197  :15;
198 
199  uint32_t sge1_addr_high;
200  uint32_t sge1_addr_low;
201 
202  uint32_t sge1_offset:22,
203  :9,
204  s1l:1;
205 
206  uint32_t sge1_length:17,
207  :15;
208 #else
209 #error big endian version not defined
210 #endif
212 
213 
214 /**
215  * @brief WQE used to Update a connection context
216  */
217 typedef struct sli4_be3_wqe_context_update_s {
218 #if BYTE_ORDER == LITTLE_ENDIAN
219  uint32_t rsvd0:16,
220  wrb_index:8,
221  :1,
222  dm:1,
223  :2,
224  type:4;
225 
226  uint32_t next_wqe:8,
227  max_burst:19,
228  :5;
229 
230  uint32_t rsvd1:15,
231  max_recv_dsl:17;
232 
233  uint32_t first_burst:14,
234  :18;
235 
236  uint32_t rsvd2:17,
237  header_digest_enable:1,
238  data_digest_enable:1,
239  error_recovery_level:2,
240  :6,
241  immediate_data:1,
242  initial_r2t:1,
243  :3;
244 
245  uint32_t statsn;
246  uint32_t rsvd3[10];
247 #else
248 #error big endian version not defined
249 #endif
251 
252 /**
253  * @brief WQE used to for TGT_STS WQE (data from ini->Tgt)
254  */
255 typedef struct sli4_be3_wqe_tgt_sts_s {
256 #if BYTE_ORDER == LITTLE_ENDIAN
257  uint32_t lun:14,
258  :1,
259  inv:1,
260  wrb_index:8,
261  :4,
262  type:4;
263 
264  uint32_t next_wqe:8,
265  exp_xfer_len:24;
266 
267  uint32_t icd_index:16,
268  :16;
269 
270  uint32_t exp_data_sn;
271  uint32_t bhs_addr_high;
272  uint32_t bhs_addr_low;
273  uint32_t itt;
274  uint32_t dif_ref_tag;
275  uint32_t rsvd2[2];
276 
277  uint32_t rsvd3:23,
278  dif_mode:2,
279  dif_blk_size:3,
280  :4;
281 
282  uint32_t rsvd4[3];
283 
284  uint32_t r2t_offset:22,
285  :10;
286 
287  uint32_t rsvd5:17,
288  ref_icd_index:12,
289  :3;
290 #else
291 #error big endian version not defined
292 #endif
294 
295 /**
296  * @brief WQE used to for TGT_STS WQE (data from Tgt->Ini)
297  */
298 typedef struct sli4_be3_wqe_tgt_datain_s {
299 #if BYTE_ORDER == LITTLE_ENDIAN
300  uint32_t lun:14,
301  :1,
302  inv:1,
303  wrb_index:8,
304  dsp:1,
305  dm:1,
306  underrun:1,
307  overrun:1,
308  type:4;
309 
310  uint32_t next_wqe:8,
311  exp_xfer_len:24;
312 
313  uint32_t icd_index:16,
314  :16;
315 
316  uint32_t data_sn;
317  uint32_t bhs_addr_high;
318  uint32_t bhs_addr_low;
319  uint32_t rsvd1;
320  uint32_t dif_ref_tag;
321  uint32_t sge0_addr_high;
322  uint32_t sge0_addr_low;
323 
324  uint32_t sge0_offset:22,
325  piggy_back_status:1,
326  dif_mode:2,
327  dif_blk_size:3,
328  :3,
329  s0l:1;
330 
331  uint32_t sge0_length:17,
332  :15;
333 
334  uint32_t sge1_addr_high;
335  uint32_t sge1_addr_low;
336 
337  uint32_t sge1_offset:22,
338  :9,
339  s1l:1;
340 
341  uint32_t sge1_length:17,
342  ref_icd_index:12,
343  :3;
344 #else
345 #error big endian version not defined
346 #endif
348 
349 /**
350  * @brief WQE used to for TGT_SOS WQE (Tgt Response)
351  */
352 typedef struct sli4_be3_wqe_tgt_sos_s {
353 #if BYTE_ORDER == LITTLE_ENDIAN
354  uint32_t lun:14,
355  :1,
356  inv:1,
357  wrb_index:8,
358  dsp:1,
359  dm:1,
360  :2,
361  type:4;
362  uint32_t next_wqe:8,
363  exp_xfer_len:24;
364  uint32_t icd_index:16,
365  :16;
366  uint32_t rsvd0;
367  uint32_t bhs_addr_high;
368  uint32_t bhs_addr_low;
369  uint32_t rsvd1[2];
370  uint32_t sge0_addr_high;
371  uint32_t sge0_addr_low;
372  uint32_t sge0_offset:22,
373  piggy_back_status:1, /* Used to incr statSN */
374  :8,
375  s0l:1;
376  uint32_t sge0_length:17,
377  :15;
378  uint32_t sge1_addr_high;
379  uint32_t sge1_addr_low;
380  uint32_t sge1_offset:22,
381  :9,
382  s1l:1;
383  uint32_t sge1_length:17,
384  :15;
385 #else
386 #error big endian version not defined
387 #endif
389 
390 
391 /**
392  * @brief WQE used to transmit a PDU without any modificiation
393  */
394 typedef struct sli4_be3_wqe_unassisted_s {
395 #if BYTE_ORDER == LITTLE_ENDIAN
396  uint32_t rsvd0:15,
397  inv:1,
398  wrb_index:8,
399  dsp:1,
400  dm:1,
401  :2,
402  type:4;
403 
404  uint32_t next_wqe:8,
405  exp_xfer_len:24;
406 
407  uint32_t icd_index:16,
408  :16;
409 
410  uint32_t rsvd1;
411  uint32_t bhs_addr_high;
412  uint32_t bhs_addr_low;
413  uint32_t login_pdu;
414  uint32_t rsvd2;
415  uint32_t sge0_addr_high;
416  uint32_t sge0_addr_low;
417 
418  uint32_t sge0_offset:22,
419  piggy_back_status:1, /* Used to incr statSN */
420  :8,
421  s0l:1;
422 
423  uint32_t sge0_length:17,
424  :15;
425 
426  uint32_t sge1_addr_high;
427  uint32_t sge1_addr_low;
428 
429  uint32_t sge1_offset:22,
430  :9,
431  s1l:1;
432 
433  uint32_t sge1_length:17,
434  :15;
435 #else
436 #error big endian version not defined
437 #endif
439 
440 /**
441  * @brief Used to decode DMSG CQEs.
442  */
443 typedef struct sli4_be3_iscsi_i_t_dmsg_cqe_s {
444 #if BYTE_ORDER == LITTLE_ENDIAN
445  uint32_t ack_num;
446  uint32_t pdu_bytes_rcvd;
447 
448  uint32_t code:6,
449  cid:10,
450  wqe_index:8,
451  :8;
452 
453  uint32_t rsvd:31,
454  valid:1;
455 #else
456 #error big endian version not defined
457 #endif
459 
460 /**
461  * @brief Used to decode DPDU CQEs.
462  */
463 typedef struct sli4_be3_iscsi_i_t_dpdu_cqe_s {
464 #if BYTE_ORDER == LITTLE_ENDIAN
467 
468  uint32_t code:6,
469  cid:10,
470  data_length:16;
471 
472  uint32_t rq_index:16,
473  num_consumed:10,
474  :4,
475  fin:1,
476  valid:1;
477 #else
478 #error big endian version not defined
479 #endif
481 
482 /**
483  * @brief Used to decode I_SOL CQEs.
484  */
485 typedef struct sli4_be3_iscsi_i_sol_cqe_s {
486 #if BYTE_ORDER == LITTLE_ENDIAN
487  uint32_t hw_sts:2,
488  :4,
489  cid_high:2,
490  status:8,
491  response:8,
492  flags:7,
493  sts:1;
494 
495  uint32_t expcmdsn;
496 
497  uint32_t code:6,
498  cid:10,
499  wqe_index:8,
500  cmd_window:8;
501 
502  uint32_t residual:31,
503  valid:1;
504 #else
505 #error big endian version not defined
506 #endif
508 
509 /**
510  * @brief Used to decode T_SOL CQEs.
511  */
512 typedef struct sli4_be3_iscsi_t_sol_cqe_s {
513 #if BYTE_ORDER == LITTLE_ENDIAN
514  uint32_t hw_sts:2,
515  :4,
516  cid_high:2,
517  :24;
518 
519  uint32_t rsvd;
520 
521  uint32_t code:6,
522  cid:10,
523  :16;
524 
525  uint32_t wqe_index:8,
526  :23,
527  valid:1;
528 #else
529 #error big endian version not defined
530 #endif
532 
533 /**
534  * @brief Used to decode T_SOL_DATA_DIGEST CQEs.
535  */
536 typedef struct sli4_be3_iscsi_t_sol_data_digest_cqe_s {
537 #if BYTE_ORDER == LITTLE_ENDIAN
538  uint32_t buffer_offset;
539  uint32_t exp_statsn;
540 
541  uint32_t code:6,
542  cid:10,
543  datasn:12,
544  cid_high:2,
545  fin:1,
546  :1;
547 
548  uint32_t data_seg_len:17,
549  :2,
550  sgl_icd_index:12,
551  valid:1;
552 #else
553 #error big endian version not defined
554 #endif
556 
557 /**
558  * @brief Used to decode CNXINV CQEs.
559  */
560 typedef struct sli4_be3_iscsi_t_cnxinv_cqe_s {
561 #if BYTE_ORDER == LITTLE_ENDIAN
564 
565  uint32_t code:6,
566  cid:10,
567  rq_index:16;
568 
569  uint32_t partial_dsl:17,
570  :14,
571  valid:1;
572 #else
573 #error big endian version not defined
574 #endif
576 
577 /**
578  * @brief Used to decode CMNDINV CQEs.
579  */
580 typedef struct sli4_be3_iscsi_t_cmndinv_cqe_s {
581 #if BYTE_ORDER == LITTLE_ENDIAN
582  uint32_t rsvd0;
583  uint32_t rsvd1;
584 
585  uint32_t code:6,
586  cid:10,
587  :16;
588 
589  uint32_t sgl_icd_index:12,
590  :19,
591  valid:1;
592 #else
593 #error big endian version not defined
594 #endif
596 
600 extern int32_t sli_be3_get_sli4_parameters(sli4_t *sli4);
601 
602 #endif /* !_SLI4_BE3_ISCSI_H */
603 
604 /* vim: set noexpandtab textwidth=120: */
#define ISCSI_CQE_CODE_MAX
Definition: sli4_iscsi.h:1119
Used to decode CMNDINV CQEs.
WQE used to for INITIATOR_NOP_OUT WQE (data from ini->Tgt)
uint32_t uint32_t uint32_t statsn
int32_t cqe_handler_t(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Definition: sli4_iscsi.h:1279
Used to decode CNXINV CQEs.
uint32_t uint32_t rsvd1
uint32_t uint32_t sge1_addr_high
cqe_handler_t * ini_be3_cqe_handlers[ISCSI_CQE_CODE_MAX+1]
uint32_t uint32_t sge1_addr_high
WQE used to Update a connection context.
cqe_handler_t * tgt_be3_cqe_handlers[ISCSI_CQE_CODE_MAX+1]
Used to decode T_SOL CQEs.
sli_wqe_handlers_t sli_be3_iscsi_wqe_handlers
Definition: sli4.h:2201
uint32_t uint32_t rsvd1
uint32_t uint32_t rsvd2
uint32_t uint32_t sge1_addr_high
WQE used to transmit a PDU without any modificiation.
WQE used to for INITIATOR_READ WQE (data from ini->Tgt)
uint32_t uint32_t uint32_t rsvd1
uint32_t uint32_t sge1_addr_high
WQE used to for TGT_SOS WQE (Tgt Response)
uint32_t uint32_t sge1_addr_high
WQE used to for TGT_STS WQE (data from Tgt->Ini)
uint32_t uint32_t sge1_addr_high
uint32_t uint32_t rsvd1
Used to decode I_SOL CQEs.
WQE used to for TGT_STS WQE (data from ini->Tgt)
int32_t sli_be3_get_sli4_parameters(sli4_t *sli4)
Note: GET_SLI4_PARAMETERS IOCTL is not supported on BE3, so we just return constant values...
uint32_t uint32_t rsvd0
WQE used to for INITIATOR_WRITE_COMMAND WQE (data from ini->Tgt)
WQE used to for INITIATOR_TMF WQE.
Used to decode DPDU CQEs.
Used to decode DMSG CQEs.
Used to decode T_SOL_DATA_DIGEST CQEs.