48 #if defined(OCS_INCLUDE_DEBUG)
109 sli_be3_iscsi_cqe_t_cnxinv
150 sli_be3_iscsi_cqe_t_cnxinv
178 uint32_t exp_xfer_len,
187 ocs_memset(buf, 0, size);
190 req->
lun = lun & 0x3fff;
191 req->
dsp = (exp_xfer_len > 0 ? 1 : 0);
249 ocs_memset(buf, 0, size);
252 req->
lun = lun & 0x3fff;
286 uint32_t exp_xfer_len,
291 ocs_memset(buf, 0, size);
294 req->
dsp = (exp_xfer_len > 0 ? 1 : 0);
302 if (exp_xfer_len > 0 && payload1 != NULL) {
305 req->
s0l = (payload2 == NULL ? 1 : 0);
307 req->
sge0_length = (payload2 != NULL ? payload1->size : exp_xfer_len);
310 if (exp_xfer_len > 0 && payload1 != NULL && payload2 != NULL) {
346 uint32_t exp_xfer_len,
355 ocs_memset(buf, 0, size);
358 req->
lun = lun & 0x3fff;
406 ocs_memset(buf, 0, size);
448 uint32_t exp_xfer_len,
449 uint32_t exp_data_sn,
452 uint16_t ref_icd_index,
460 ocs_memset(buf, 0, size);
463 req->
lun = lun & 0x3fff;
514 uint32_t exp_xfer_len,
516 uint16_t ref_icd_index,
518 uint8_t piggy_back_status,
525 ocs_memset(buf, 0, size);
528 req->
lun = lun & 0x3fff;
529 req->
dsp = (exp_xfer_len > 0 ? 1 : 0);
586 uint32_t exp_xfer_len,
591 ocs_memset(buf, 0, size);
594 req->
lun = lun & 0x3fff;
595 req->
dsp = (exp_xfer_len > 0 ? 1 : 0);
603 if (exp_xfer_len > 0 && payload1 != NULL) {
606 req->
s0l = (payload2 == NULL ? 1 : 0);
607 req->
sge0_length = (payload2 != NULL ? payload1->size : exp_xfer_len);
610 if (exp_xfer_len > 0 && payload1 != NULL && payload2 != NULL) {
645 uint32_t exp_xfer_len,
650 ocs_memset(buf, 0, size);
653 req->
dsp = (exp_xfer_len ? 1 : 0);
654 req->
dm = (set_dm ? 1 : 0);
662 if (exp_xfer_len > 0 && payload1 != NULL) {
665 req->
s0l = (payload2 == NULL ? 1 : 0);
666 req->
sge0_length = (payload2 != NULL ? payload1->size : exp_xfer_len);
669 if (exp_xfer_len > 0 && payload1 != NULL && payload2 != NULL) {
731 q->
u.
wq.wqe_free_cnt--;
733 last_wqe_posted = q->
u.
wq.last_wqe_posted;
750 uint32_t *dword = hal_io->
bhs.virt;
753 dword[5] = ocs_htobe32(hal_io->
ttt);
757 uint32_t *dword = hal_io->
bhs.virt;
760 dword[4] = ocs_htobe32(hal_io->
itt);
770 uint32_t *dword = hal_io->
bhs.virt;
774 dword[4] = ocs_htobe32(hal_io->
itt);
783 if (last_wqe_posted != NULL) {
787 #if defined(OCS_INCLUDE_DEBUG)
791 snprintf(desc,
sizeof(desc),
"%s entry %d", q->
name, ctx->
wrb_index);
800 ocs_memcpy(ctx->
qe, entry, q->
size);
803 q->
u.
wq.last_wqe_posted = ctx->
qe;
805 ocs_dma_sync(&q->
dma, OCS_DMASYNC_PREWRITE);
812 ocs_log_err(sli4->
os,
"failed to allocate a WQE object\n");
815 ocs_unlock(&q->
lock);
843 while (NULL != ctx) {
861 ocs_unlock(&q->
lock);
899 ocs_log_test(sli4->
os,
"WQ Error: status 0x%02x\n", i_sol->
code);
929 ocs_log_test(sli4->
os,
"WQ Error: status 0x%02x\n", t_sol->
code);
962 ocs_log_test(sli4->
os,
"WQ Error: status 0x%02x\n", msg->
code);
999 ocs_log_test(sli4->
os,
"WQ Error: status 0x%02x\n", msg->
code);
1029 ocs_log_test(sli4->
os,
"WQ Error: status 0x%02x\n", msg->
code);
This structure contains the type and associated fields for a CQE completion.
static int32_t sli_be3_wqe_update_context(sli4_t *sli4, void *buf, size_t size, ocs_hal_target_login_options_t *lgn_options, uint32_t statsn)
Write a CONTEXT_UPDATE_WQE work queue entry.
#define ISCSI_CQE_CODE_MAX
Used to decode CMNDINV CQEs.
sli4_wqe_context_t * wq_ctx
WQE used to for INITIATOR_NOP_OUT WQE (data from ini->Tgt)
static int32_t sli_be3_wqe_unassisted(sli4_t *sli4, void *buf, size_t size, uint8_t set_dm, uint8_t incr_statsn, uint8_t is_login, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint32_t exp_xfer_len, uint16_t icd_index)
Write an DM_CMD_WQE work queue entry.
uint32_t uint32_t uint32_t statsn
static int32_t sli_be3_wqe_ini_tmf(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t cmdsn, uint16_t icd_index, sli4_sge_t *sgl, uint32_t n_sge)
Write an INITIATOR_TMF WQE work queue entry.
int32_t cqe_handler_t(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Used to decode CNXINV CQEs.
uint32_t piggy_back_status
uint32_t uint32_t sge1_addr_high
cqe_handler_t * ini_be3_cqe_handlers[ISCSI_CQE_CODE_MAX+1]
#define SLI4_WQE_INI_READ
uint32_t uint32_t sge1_addr_high
uint32_t max_qentries[SLI_QTYPE_MAX]
static int32_t sli_be3_wqe_ini_nop(sli4_t *sli4, void *buf, size_t size, uint8_t dm, uint32_t cmdsn, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint32_t exp_xfer_len, uint16_t icd_index)
Write an INITIATOR_NOP_OUT_COMMAND WQE work queue entry.
Defines the generic iSCSI basic header segment.
This structure contains the fields in a DMSG completion.
static int32_t sli_be3_wqe_ini_write(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t exp_xfer_len, uint32_t cmdsn, uint16_t icd_index, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
Write an INITIATOR_WRITE_COMMAND WQE work queue entry.
T10 DIF information passed to the transport.
struct sli4_queue_t::@33::@35 wq
static int32_t sli_be3_wqe_tgt_sts(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, uint16_t lun, uint32_t exp_xfer_len, uint32_t exp_data_sn, uint32_t itt, uint16_t icd_index, uint16_t ref_icd_index, ocs_hal_dif_info_t *dif_info, uint32_t r2t_offset, sli4_sge_t *sgl, uint32_t n_sge)
Write an TGT_STS_WQE work queue entry.
uint32_t uint32_t initial_r2t
uint32_t uint32_t sgl_icd_index
static int32_t sli_be3_iscsi_cqe_t_sol(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
WQE used to Update a connection context.
static void * ocs_list_get_head(ocs_list_t *list)
Return the first item in the list.
uint32_t partial_data_length
#define ISCSI_CQE_CODE_RESIDUAL_UNDERRUN
union sli4_qentry_fields_t::@32 msg
cqe_handler_t * tgt_be3_cqe_handlers[ISCSI_CQE_CODE_MAX+1]
uint32_t uint32_t wqe_index
#define SLI4_WQE_UNASSISTED
#define ISCSI_CQE_CODE_HOST_CXN_INVL_WITH_PDU
uint32_t sge_supported_length
#define SLI4_WQE_TGT_DATAIN
static int32_t sli_be3_wqe_ini_read(sli4_t *sli4, void *buf, size_t size, uint16_t lun, uint32_t exp_xfer_len, uint32_t cmdsn, uint16_t icd_index, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
Write an INITIATOR_READ WQE work queue entry.
uint32_t uint32_t icd_index
Used to decode T_SOL CQEs.
sli_wqe_handlers_t sli_be3_iscsi_wqe_handlers
sli4_qentry_fields_tsol_t tsol
#define ISCSI_CQE_CODE_TCP_RECV_RST
#define ISCSI_CQE_CODE_HOST_CXN_INVALIDATION
uint32_t def_buf_addr_low
static int32_t sli_be3_queue_iscsi_wqe_invalidate(sli4_t *sli4, sli4_queue_t *q, void *io, uint8_t is_for_tm)
Writes a 1 to the invalidate bit of the WQE.
union sli4_queue_t::@33 u
uint32_t piggy_back_status
sli4_qentry_fields_dpdu_t dpdu
void ocs_dump32(uint32_t mask, ocs_os_handle_t os, const char *label, void *buf, uint32_t buf_length)
Dump 32 bit hex/ascii data.
static int32_t sli_be3_iscsi_cqe_i_t_dpdu(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse an iSCSI work queue CQ entry.
static int32_t sli_be3_iscsi_cqe_i_sol(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse an iSCSI work queue CQ entry.
uint32_t uint32_t sge1_addr_high
uint32_t def_buf_addr_high
uint32_t uint32_t data_digest_enable
void ocs_swap_and_dump32(uint32_t mask, ocs_os_handle_t os, const char *label, void *buf, uint32_t buf_length)
WQE used to transmit a PDU without any modificiation.
uint32_t uint32_t sgl_icd_index
uint32_t piggy_back_status
uint32_t uint32_t immediate_data
uint32_t def_buf_addr_high
static int32_t sli_be3_iscsi_cqe_t_cnxinv(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
WQE used to for INITIATOR_READ WQE (data from ini->Tgt)
sli4_qentry_fields_isol_t isol
sli4_qentry_fields_tcmdinv_t tcmdinv
This structure is used to track the WQEs for iSCSI.
static int32_t sli_be3_queue_iscsi_wq_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry, void *io)
Write an WQE entry to the queue object.
This structure contains the fields in a T_DATA_DIGEST completion.
uint32_t uint32_t sge1_addr_high
This structure contains the fields in a CNXINV completion.
#define ISCSI_CQE_CODE_RESIDUAL_OVERRUN
sli4_qentry_fields_cnxinv_t cnxinv
int32_t(* wqe_update_context)(sli4_t *sli4, void *buf, size_t size, ocs_hal_target_login_options_t *lgn_options, uint32_t statsn)
WQE used to for TGT_SOS WQE (Tgt Response)
sli4_qentry_fields_data_digest_t data_digest
struct sli4_t::@38 config
static void ocs_list_add_tail(ocs_list_t *list, void *item)
Add an item to the tail of the list.
uint32_t uint32_t sge1_addr_high
ocs_hal_dif_oper_e dif_oper
This structure is used to track the SLI4 queues.
#define ocs_list_remove_head(list)
Remove and return an item from the head of the list.
WQE used to for TGT_STS WQE (data from Tgt->Ini)
void sli_reg_write(sli4_t *sli, sli4_regname_e reg, uint32_t val)
Write the value to the given SLI register.
uint32_t uint32_t sge1_addr_high
uint32_t buffer_address_low
static void * ocs_list_next(ocs_list_t *list, void *item)
Get the next item on the list.
#define SLI4_WQE_INI_WRITE
uint32_t uint32_t header_digest_enable
uint8_t error_recovery_level
Used to decode I_SOL CQEs.
#define ISCSI_CQE_CODE_NORMAL
sli4_qentry_fields_dmsg_t dmsg
uint32_t uint32_t exp_data_sn
static int32_t sli_be3_iscsi_cqe_i_t_dmsg(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
This structure contains the fields in a DPDU completion.
WQE used to for TGT_STS WQE (data from ini->Tgt)
uint32_t uint32_t data_seg_len
uint32_t buffer_address_high
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...
#define ISCSI_CQE_CODE_TCP_RECV_FIN
static int32_t sli_be3_wqe_tgt_datain(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, uint16_t lun, uint8_t dm, uint8_t underrun, uint8_t overrun, uint32_t exp_xfer_len, uint16_t icd_index, uint16_t ref_icd_index, uint32_t data_sn, uint8_t piggy_back_status, ocs_hal_dif_info_t *dif_info, sli4_sge_t *sgl, uint32_t n_sge)
Write a TGT_DATAIN_WQE work queue entry.
uint32_t uint32_t data_sn
Scatter-Gather Entry (SGE)
WQE used to for INITIATOR_WRITE_COMMAND WQE (data from ini->Tgt)
static int32_t sli_be3_wqe_tgt_sos(sli4_t *sli4, void *buf, size_t size, ocs_dma_t *bhs, ocs_dma_t *payload1, ocs_dma_t *payload2, uint16_t lun, uint8_t dm, uint32_t exp_xfer_len, uint16_t icd_index)
Write a TGT_SOS_WQE work queue entry.
static int32_t sli_be3_iscsi_cqe_t_sol_data_digest(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
WQE used to for INITIATOR_TMF WQE.
uint32_t uint32_t ref_icd_index
Used to decode DPDU CQEs.
ocs_hal_dif_blk_size_e blk_size
Used to decode DMSG CQEs.
#define SLI4_WQ_DOORBELL(n, x, i)
#define SLI4_WQE_CONTEXT_UPDATE
uint32_t uint32_t max_recv_dsl
ocs_session_login_options_t session_options
static int32_t sli_be3_iscsi_cqe_t_cmdinv(sli4_t *, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a iSCSI work queue CQ entry.
This structure contains the fields in a CMNDINV completion.
#define OCS_DEBUG_ENABLE_WQ_DUMP
Defines the iSCSI login PDU header.
uint32_t uint32_t error_recovery_level
Used to decode T_SOL_DATA_DIGEST CQEs.
uint32_t def_buf_addr_low