58 #define RC_MOVE_ASYNC 0x4173796e
59 #define OCS_HAL_WQ_ENTRIES 128
60 #define OCS_HAL_WQ_ENTRIES_USED (OCS_HAL_WQ_ENTRIES / 2)
61 #define OCS_HAL_CQ_NUM_FOR_INI 2
62 #define OCS_HAL_MAX_ABORT_IOS 128
105 ocs_log_err(os,
"bad parameter(s) hal=%p\n", hal);
141 ocs_log_err(hal->
os,
"SLI setup failed\n");
207 uint32_t eq_index_rq;
208 uint32_t eq_index_ulp[2];
214 ocs_log_err(hal->
os,
"ERROR: Current firmware version %s is older than the minimum supported version %s.\n",
232 ocs_log_err(hal->
os,
"command found on cmd list\n");
237 ocs_log_err(hal->
os,
"command found on pending list\n");
242 ocs_log_err(hal->
os,
"command found on async list\n");
270 ocs_log_err(hal->
os,
"requested %d EQ but %d allowed\n",
277 ocs_log_err(hal->
os,
"requested %d CQ but %d allowed\n",
284 ocs_log_err(hal->
os,
"requested %d WQ but %d allowed\n",
291 ocs_log_err(hal->
os,
"requested %d MQ but %d allowed\n",
298 ocs_log_err(hal->
os,
"requested %d RQ but %d allowed\n",
306 OCS_M_ZERO | OCS_M_NOWAIT);
307 if (NULL == hal->
wq) {
308 ocs_log_err(hal->
os,
"Failed to allocate WQ structures\n");
313 OCS_M_ZERO | OCS_M_NOWAIT);
314 if (NULL == hal->
cq) {
315 ocs_log_err(hal->
os,
"Failed to allocate CQ structures\n");
326 ocs_log_err(hal->
os,
"EQ[%d] allocation failure\n", i);
331 OCS_M_ZERO | OCS_M_NOWAIT);
333 ocs_log_err(hal->
os,
"Failed to allocate CQ pending pointers\n");
365 ocs_log_debug(hal->
os,
"ulp_start %d, ulp_max %d\n",
377 eq_index_ulp[0] = (hal->
config.
n_eq > 1 ? 1 : 0);
405 ocs_log_debug(hal->
os,
"%d Wqs, %d Tgt CQs, %d Ini CQs, %d total CQs\n",
412 ocs_log_err(hal->
os,
"ERROR: Internal error allocating CQs.\n");
425 eq_index = eq_index_rq;
427 eq_index = eq_index_ulp[0];
429 eq_index = eq_index_ulp[1];
434 &hal->
eq[eq_index], ulp_curr)) {
435 ocs_log_err(hal->
os,
"CQ[%d] allocation failure\n", i);
438 hal->
cq[i].
u.
flag.is_ini_cq = 0;
440 i < hal->cq_index_mq) {
441 hal->
cq[i].
u.
flag.is_ini_cq = 1;
461 ocs_log_err(hal->
os,
"WQ allocation failure\n");
470 OCS_M_ZERO | OCS_M_NOWAIT);
471 if (NULL == hal->
wq[i].
u.
wq.wqe_context) {
472 ocs_log_err(hal->
os,
"Failed to allocate WQ %d context structures\n",
478 hal->
wq[i].
u.
wq.wqe_context[j].wrb_index = j;
479 hal->
wq[i].
u.
wq.wqe_context[j].qe =
480 ((uint8_t*)hal->
wq[i].
dma.virt) + (j * hal->
wq[i].
size);
482 &hal->
wq[i].
u.
wq.wqe_context[j]);
503 ocs_log_err(hal->
os,
"RQ allocation failure\n");
516 OCS_M_ZERO | OCS_M_NOWAIT);
518 ocs_log_err(hal->
os,
"RQ buf allocation failure\n");
525 OCS_M_ZERO | OCS_M_NOWAIT);
527 ocs_log_err(hal->
os,
"RQ list allocation failure\n");
533 for (j = 0; j < hal->
rq[i].
length; j++) {
545 ocs_log_err(hal->
os,
"MQ allocation failure\n");
553 ocs_log_err(hal->
os,
"Failed to set DIF mode value\n");
560 ocs_log_err(hal->
os,
"connections setup failure\n");
566 ocs_log_err(hal->
os,
"IO allocation failure\n");
572 ocs_log_err(hal->
os,
"IO initialization failure\n");
578 ocs_log_err(hal->
os,
"iSNS Send buffer allocation failed\n");
587 ocs_log_err(hal->
os,
"rx_allocate failed\n");
592 ocs_log_warn(hal->
os,
"WARNING - error posting RQ buffers\n");
612 ocs_log_debug(hal->
os,
"complete\n");
643 index = cq_id - hal->
cq[0].
id;
646 hal->
cq[index].
id != cq_id) {
648 ocs_log_test(hal->
os,
"Standard lookup failed\n");
650 if (cq_id == hal->
cq[i].
id) {
677 index = (wq_id - hal->
wq[0].
id) * 2;
680 hal->
wq[index].
id != wq_id) {
681 index = ((wq_id - hal->
wq[1].
id) * 2) + 1;
684 hal->
wq[index].
id != wq_id) {
686 ocs_log_test(hal->
os,
"Standard lookup failed\n");
689 if (wq_id == hal->
wq[i].
id) {
716 ocs_cxn_t *cxn = NULL;
740 uint16_t rqindex = buffer->
rqindex;
746 phys[0] = ocs_addr32_hi(buffer->
dma.phys);
747 phys[1] = ocs_addr32_lo(buffer->
dma.phys);
752 ocs_log_err(hal->
os,
"RQ_ID=%#x write failed\n", rq->
id);
753 ocs_unlock(&rq->
lock);
764 if (NULL != rq_list) {
767 rq_list->
index = qindex;
771 ocs_log_err(hal->
os,
"out of rq_list_free buffers for rq[%d] index %d\n",
776 ocs_unlock(&rq->
lock);
804 uint64_t zero = (0xdead0000 |
805 ((rq->
id & 0xf) << 12) |
808 if (bufindex >= rq->
length) {
815 if (addr_high == ocs_addr32_hi(phys) &&
816 addr_low == ocs_addr32_lo(phys)) {
830 if (rq_list->
index == bufindex) {
831 phys = rq_list->
rq_buf->
dma.phys + length;
832 if (addr_high == ocs_addr32_hi(phys) &&
833 addr_low == ocs_addr32_lo(phys)) {
843 #if defined(OCS_INCLUDE_DEBUG)
848 ocs_log_test(hal->
os,
"CQE address not found at index %d: 0x%x 0x%08x, dl = %d\n",
849 bufindex, addr_high, addr_low, length);
853 ocs_log_test(hal->
os,
" RQ address 0x%x 0x%08x (Lookup tbl)\n",
861 ocs_log_test(hal->
os,
" RQ address 0x%x 0x%08x (Actual)\n",
862 (uint32_t)(rq_addr & 0xFFFFFFFF),
863 (uint32_t)(rq_addr >> 32));
867 if (rq_list->
index == bufindex) {
868 ocs_log_test(hal->
os,
" RQ address 0x%x 0x%08x (List)\n",
869 ocs_addr32_hi(rq_list->
rq_buf->
dma.phys),
870 ocs_addr32_lo(rq_list->
rq_buf->
dma.phys));
875 ocs_unlock(&rq->
lock);
896 uint8_t code = dpdu->
code;
902 ocs_log_test(hal->
os,
"DPDU CQE with index %d (CID 0x%x not found)\n",
913 cxn->data_digest_error = TRUE;
918 (is_hdr ? cxn->rqindex : cxn->rqindex + 1),
924 if (rq_buf == NULL) {
925 ocs_log_test(hal->
os,
"DPDU CQE with index %d (no DMA posted at this index) for cid 0x%x\n",
939 if (cxn->data_digest_error) {
962 cxn->data_digest_error = FALSE;
966 cxn->hdr_buf = rq_buf;
969 ocs_log_test(hal->
os,
"Data PDU without final set for CID %d\n",
974 ocs_log_test(hal->
os,
"Data PDU with NULL Cxn for CID %d\n",
1004 ocs_log_test(hal->
os,
"WQ for cid %d was not found, completion for WQE index 0x%x discarded\n", dmsg->
cid, dmsg->
wqe_index);
1031 if (NULL != io->
done) {
1033 void *arg = io->
arg;
1036 rc = done(io, io->
node, tsol->
code, NULL, arg);
1039 ocs_log_test(hal->
os,
"IO at index %d for WQ id %d was not found\n",
1044 ocs_log_test(hal->
os,
"WQ for cid %d was not found, completion for WQE index 0x%x discarded\n",
1073 if (NULL != io->
done) {
1075 void *arg = io->
arg;
1087 if (isol->
status == 0x2) {
1088 ini_fields.
sense_len = ocs_be16toh(*(uint16_t*)((uint8_t *)io->
bhs.virt + 64));
1091 rc = done(io, io->
node, isol->
code, &ini_fields, arg);
1094 ocs_log_test(hal->
os,
"IO at index %d for WQ id %d was not found\n",
1099 ocs_log_test(hal->
os,
"WQ for cid %d was not found, completion for WQE index 0x%x discarded\n",
1123 uint8_t wait_for_tcp_ack;
1133 if (wait_for_tcp_ack) {
1139 ocs_log_debug(hal->
os,
"IO at ICD index %d for WQ id %d waiting for TCP-ACK\n",
1142 }
else if (NULL != io->
done) {
1144 void *arg = io->
arg;
1148 rc = done(io, io->
node, cmdinv->
code, NULL, arg);
1151 ocs_log_test(hal->
os,
"IO at ICD index %d for WQ id %d was not found\n",
1156 ocs_log_test(hal->
os,
"WQ for cid %d was not found, completion for icd index 0x%x discarded\n",
1157 cmdinv->
cid, cmdinv->
cid);
1183 ocs_log_test(hal->
os,
"CXN_INVALID CQE (CID 0x%x not found)\n",
1202 if (cxn->hdr_length != 0) {
1216 cxn->hdr_buf = NULL;
1217 cxn->hdr_length = 0;
1264 digest->
fin = data_digest->
fin;
1268 &hal->
wq[cxn->wq_index],
1270 digest->
arg = (digest->
io == NULL ? NULL : digest->
io->
arg);
1274 ocs_log_test(hal->
os,
"Connection for cid 0x%x not found - dropped\n",
1297 uint8_t wait_for_tcp_ack;
1307 if (wait_for_tcp_ack) {
1313 ocs_log_debug(hal->
os,
"IO at ICD index %d for WQ id %d waiting for TCP-ACK\n",
1316 }
else if (NULL != io->
done) {
1318 void *arg = io->
arg;
1325 ocs_log_test(hal->
os,
"IO at ICD index %d for WQ id %d was not found\n",
1330 ocs_log_test(hal->
os,
"WQ for cid %d was not found, completion for icd index 0x%x discarded\n",
1352 uint32_t n_processed = 0;
1356 uint8_t log_entry = FALSE;
1375 switch (fields.
ctype) {
1427 ocs_log_test(hal->
os,
"unhandled ctype=%#x\n", fields.
ctype);
1459 uint64_t tag = ((uint64_t)mqe_hdr->
tag[1] << 32) | mqe_hdr->
tag[0];
1472 ocs_memcpy(ctx->
cmd, mqe, size);
1473 rc = ctx->
cb(hal, status, ctx);
1526 ocs_memset(&hal->
link, 0,
sizeof(hal->
link));
1528 switch (event->status) {
1530 ocs_log_info(hal->
os,
"Link up, speed is %d\n", event->speed);
1533 ocs_log_info(hal->
os,
"Link down\n");
1536 ocs_log_test(hal->
os,
"unhandled link status %#x\n", event->status);
1568 uint8_t additional_status)
1573 ocs_log_debug(hal->
os,
"bad async status of 0x%x, additional 0x%x\n",
1574 status, additional_status);
1584 rc = ctx->
cb(hal, status, ctx);
1639 ocs_log_test(hal->
os,
"Error posting GET_IF_INFO\n");
1642 ocs_log_test(hal->
os,
"Error building GET_IF_INFO message\n");
1676 while (NULL != ctx) {
1697 ocs_log_test(hal->
os,
"Error posting DISCOVERED_ISNS\n");
1700 ocs_log_test(hal->
os,
"Error building DISCOVERED_ISNS message\n");
1726 switch(event->event) {
1738 &event->params.stateless_cmpl,
1743 &event->params.stateless_cmpl,
1770 uintptr_t dataout_virt = 0;
1771 uintptr_t dataout_phys = 0;
1780 ocs_log_err(hal->
os,
"data out template buffer allocation failed\n");
1789 cxn = ocs_malloc(hal->
os,
sizeof(ocs_cxn_t), OCS_M_ZERO | OCS_M_NOWAIT);
1792 cxn->wq_id = hal->
wq[i].
id;
1797 cxn->instance_index = i;
1799 ocs_lock_init(hal->
os, &cxn->active_ios_lock,
"active_ios[%d]", cxn->instance_index);
1804 cxn->dataout_tmpl.virt = (
void*)dataout_virt;
1805 cxn->dataout_tmpl.phys = dataout_phys;
1806 cxn->dataout_tmpl.size = 128;
1815 nop_hdr->
ttt = 0xFFFFFFF;
1817 dataout_virt += 128;
1818 dataout_phys += 128;
1822 ocs_log_err(hal->
os,
"connection allocation failure\n");
1842 uintptr_t bhs_virt = 0;
1843 uintptr_t bhs_phys = 0;
1845 if (NULL == hal->
io) {
1853 ocs_log_err(hal->
os,
"Set fragnum bits failure\n");
1859 ocs_log_err(hal->
os,
"SGL allocation failure\n");
1865 if (NULL == hal->
io) {
1866 ocs_log_err(hal->
os,
"IO memory allocation failed\n");
1872 ocs_log_err(hal->
os,
"SGL Info memory allocation failed\n");
1879 if (ocs_dma_alloc(hal->
os, &hal->
bhs_mem,
1882 ocs_log_err(hal->
os,
"BHS buffer allocation failed\n");
1885 bhs_virt = (uintptr_t)hal->
bhs_mem.virt;
1892 ocs_log_err(hal->
os,
"ICD allocation failed on IO %d\n", i);
1896 io->
bhs.virt = (
void *)bhs_virt;
1897 io->
bhs.phys = bhs_phys;
1961 if (inline_value == 0 && separate_value == 0) {
1964 }
else if ((inline_value == 1 && separate_value == 0) ||
1965 (inline_value == 0 && separate_value == 1)) {
1970 ocs_memset(&mode_param, 0,
sizeof(mode_param));
1977 (uint32_t*)&mode_param)) {
1980 ocs_log_test(hal->
os,
"ocs_hal_command returns %d\n", rc);
1982 ocs_log_debug(hal->
os,
"DIF mode set to %s\n",
1986 ocs_log_test(hal->
os,
"sli_cmd_common_set_features failed\n");
2026 ocs_log_crit(hal->
os,
"Chip is in an error state - reset needed\n");
2037 ocs_log_test(hal->
os,
"Polled command with non-empty mailbox queue\n");
2039 void *bmbx = hal->
sli.
bmbx.virt;
2132 tag = (uintptr_t)ctx;
2133 hdr->
tag[0] = tag & 0xffffffff;
2134 hdr->
tag[1] = tag >> 32;
2137 ocs_log_err(hal->
os,
"sli_queue_write failed: %d\n", rc);
2172 ocs_log_crit(hal->
os,
"Chip is in an error state - reset needed\n");
2208 ocs_log_err(hal->
os,
"bad parameter hal=%p which=%#x func=%p\n",
2211 ocs_log_err(NULL,
"bad parameter hal=%p which=%#x func=%p\n",
2235 ocs_log_test(hal->
os,
"unknown callback %#x\n", which);
2257 if (header == NULL) {
2258 ocs_log_err(hal->
os,
"header is NULL\n");
2260 }
else if (header->
dma.phys == 0) {
2261 ocs_log_err(hal->
os,
"header physical address is zero\n");
2263 }
else if (payload != NULL &&
2264 payload->
dma.phys == 0) {
2265 ocs_log_err(hal->
os,
"payload physical address is zero\n");
2279 if (payload != NULL) {
2306 ocs_log_debug(hal->
os,
"hung command %08x\n",
2307 (NULL == ctx ? UINT32_MAX : *((uint32_t *)ctx->
cmd)));
2310 tag = (uintptr_t)ctx;
2311 mcqe_hdr->
tag[0] = tag & 0xffffffff;
2312 mcqe_hdr->
tag[1] = tag >> 32;
2390 ocs_lock_free(&cxn->active_ios_lock);
2392 ocs_free(cxn->ocs, cxn,
sizeof(ocs_cxn_t));
2413 uint32_t iters = 10;
2414 ocs_sli_port_t *sport;
2419 ocs_log_err(NULL,
"bad parameter(s) hal=%p\n", hal);
2428 ocs_delay_usec(10000);
2434 ocs_log_debug(hal->
os,
"All commands completed on MQ queue\n");
2436 ocs_log_debug(hal->
os,
"Some commands still pending on MQ queue\n");
2460 ocs_log_test(hal->
os,
2461 "iSCSI cleanup failed for queue index %d\n", i);
2469 if (NULL != hal->
wq[i].
u.
wq.wqe_context) {
2470 ocs_free(hal->
os, hal->
wq[i].
u.
wq.wqe_context,
2472 hal->
wq[i].
u.
wq.wqe_context = NULL;
2499 ocs_log_err(hal->
os,
"SLI teardown failed\n");
2515 if (hal->
domain != NULL) {
2523 hal->
domain->node_instance_count = 0;
2532 ocs_memset(&hal->
bhs_mem, 0,
sizeof(ocs_dma_t));
2535 ocs_memset(&hal->
isns_mem, 0,
sizeof(ocs_dma_t));
2560 ocs_sli_port_t *sport;
2572 ocs_delay_usec(10000);
2578 ocs_log_debug(hal->
os,
"All commands completed on MQ queue\n");
2580 ocs_log_debug(hal->
os,
"Some commands still pending on MQ queue\n");
2591 ocs_log_err(hal->
os,
"sli_soft_reset failed\n");
2597 ocs_log_test(hal->
os,
" Undefined reset type\n");
2607 if (hal->
domain != NULL) {
2615 hal->
domain->node_instance_count = 0;
2620 if (NULL != hal->
wq[i].
u.
wq.wqe_context) {
2621 ocs_free(hal->
os, hal->
wq[i].
u.
wq.wqe_context,
2623 hal->
wq[i].
u.
wq.wqe_context = NULL;
2636 for (j = 0; j < hal->
rq[i].
length; j++) {
2745 ocs_log_test(hal->
os,
"unsupported property %#x\n", prop);
2783 ocs_log_test(hal->
os,
"unsupported property %#x\n", prop);
2793 uint32_t dif_inline;
2794 uint32_t dif_separate;
2799 ocs_log_test(hal->
os,
"IO value out of range %d vs %d\n",
2808 ocs_log_test(hal->
os,
"NODE value out of range %d vs %d\n",
2817 ocs_log_test(hal->
os,
"NODE value out of range %d vs %d\n",
2828 ocs_log_test(hal->
os,
"Feature not supported\n");
2833 if (value == 32 || value == 256) {
2836 ocs_log_test(hal->
os,
"Invalid num SGEs per ICD of %d\n", value);
2843 }
else if (value == 1) {
2847 ocs_log_test(hal->
os,
"Post SGL version 1 not supported on this chip\n");
2851 ocs_log_test(hal->
os,
"Invalid post SGL version of %d\n", value);
2870 dif_separate == 0)) {
2873 ocs_log_test(hal->
os,
"chip does not support DIF inline\n");
2882 ocs_log_test(hal->
os,
"chip does not support DIF separate\n");
2888 ocs_log_test(hal->
os,
"unsupported property %#x\n", prop);
2906 ocs_log_test(hal->
os,
"unsupported property %#x\n", prop);
2929 ocs_log_err(NULL,
"HAL context NULL?!?\n");
2936 ocs_log_err(hal->
os,
"vector %d. max %d\n", vector, hal->
config.
n_eq);
2975 uint32_t done = FALSE;
2976 uint32_t tcheck_count;
2986 eq = &hal->
eq[vector];
2989 tstart = ocs_msectime();
3000 if (likely(index >= 0)) {
3003 ocs_log_err(hal->
os,
"bad CQ_ID %#06x\n", cq_id);
3010 if (tcheck_count && (--tcheck_count == 0)) {
3012 telapsed = ocs_msectime() - tstart;
3013 if (telapsed >= max_isr_time_msec) {
3041 if (hal->
domain == NULL) {
3042 sport->domain = domain;
3043 domain->sport = sport;
3065 if (!hal || !domain) {
3066 ocs_log_err(hal ? hal->
os : NULL,
"bad parameter(s) hal=%p domain=%p\n",
3069 }
else if (domain != hal->
domain) {
3070 ocs_log_err(hal->
os,
"domain=%p does not match hal pointer %p\n",
3097 if ((status == 0) && hdr->
status) {
3129 ocs_log_test(hal->
os,
"not implemented for skyhawk\n");
3135 ocs_log_err(hal->
os,
"no buffer for command\n");
3147 ocs_log_test(hal->
os,
"Error posting SET_BE_CONFIG\n");
3151 ocs_log_test(hal->
os,
"Error building SET_BE_CONFIG message\n");
3180 ocs_log_err(hal->
os,
"no buffer for command\n");
3189 (is_jumbo ? 8342 : 1500))) {
3192 ocs_log_test(hal->
os,
"Error posting SET_MTU\n");
3198 ocs_log_test(hal->
os,
"Error building SET_MTU message\n");
3238 if ((status == 0) && resp->
hdr.
status) {
3245 (
void*)(uintptr_t)resp->
iface);
3264 unsigned int vlan_tag,
3273 ocs_log_err(hal->
os,
"no buffer for command\n");
3283 ocs_log_err(hal->
os,
"Error posting IFACE_CREATE\n");
3287 ocs_log_err(hal->
os,
"Error building IFACE_CREATE message\n");
3315 ocs_log_err(hal->
os,
"no buffer for command\n");
3325 ocs_log_err(hal->
os,
"Error posting IFACE_DELETE\n");
3329 ocs_log_err(hal->
os,
"Error building IFACE_DELETE message\n");
3357 if ((status == 0) && hdr->
status) {
3400 for(indx = 0; indx < resp->
ip_count; indx++) {
3403 ocs_memcpy(ip[indx].ip_address, resp->
ip[indx].
ip_addr, 16);
3406 if ((status == 0) && resp->
hdr.
status) {
3413 (status == 0 ? ip : NULL));
3447 ocs_log_debug(hal->
os,
"no IP addresses found\n");
3455 if ((status == 0) && resp->
hdr.
status) {
3456 ocs_log_test(hal->
os,
"bad mailbox status of 0x%x\n",
3464 (status == 0 ? &ip : NULL));
3488 ocs_log_err(hal->
os,
"Set route table failed "
3489 "status 0x%x, ext_status 0x%x\n",
3494 if ((status == 0) && resp->
hdr.
status) {
3528 ocs_log_err(hal->
os,
"Get route table failed "
3529 "status 0x%x, ext_status 0x%x\n",
3533 route_table = ocs_malloc(hal->
os,
sizeof(*route_table),
3534 OCS_M_ZERO|OCS_M_NOWAIT);
3535 if (route_table == NULL) {
3536 ocs_log_err(hal->
os,
"Failed to allocate memory\n");
3541 if ((status == 0) && resp->
hdr.
status) {
3571 ocs_free(hal->
os, route_table,
sizeof(*route_table));
3602 ocs_dma_t route_table;
3603 uint32_t payload_size;
3607 ocs_log_err(hal->
os,
"no buffer for command\n");
3615 rc = ocs_dma_alloc(hal->
os, &route_table, payload_size, 4);
3618 ocs_log_err(hal->
os,
"DMA alloc for set route table failed\n");
3630 hal_ipsub, hal_gateway,
3634 ocs_log_err(hal->
os,
3635 "Error posting set route table command\n");
3638 ocs_log_err(hal->
os,
"Error building set route table command\n");
3644 ocs_dma_free(hal->
os, &route_table);
3667 ocs_dma_t route_table;
3668 uint32_t payload_size;
3672 ocs_log_err(hal->
os,
"no buffer for command\n");
3680 rc = ocs_dma_alloc(hal->
os, &route_table, payload_size, 4);
3683 ocs_log_err(hal->
os,
"DMA alloc for set route table failed\n");
3698 ocs_log_err(hal->
os,
"Error posting set route table command\n");
3701 ocs_log_err(hal->
os,
"Error building set route table command\n");
3707 ocs_dma_free(hal->
os, &route_table);
3740 ocs_log_test(hal->
os,
"Invalid IP address type %d\n", ipaddr->
ip_type);
3746 ocs_log_err(hal->
os,
"no buffer for command\n");
3777 ocs_log_err(hal->
os,
"Error posting IP Add\n");
3781 ocs_log_err(hal->
os,
"Error building message\n");
3815 ocs_log_test(hal->
os,
"Invalid IP address type %d\n", ipaddr->
ip_type);
3821 ocs_log_err(hal->
os,
"no buffer for command\n");
3851 ocs_log_err(hal->
os,
"Error posting IP Remove\n");
3855 ocs_log_err(hal->
os,
"Error building message\n");
3885 if ((status == 0) && resp->
hdr.
status) {
3895 for (i = 0; i < 5 && i < resp->
ip_count; i++) {
3906 (status == 0 ? &rtn : NULL));
3936 ocs_log_err(hal->
os,
"no buffer for command\n");
3946 (uint32_t)portal, isv4)) {
3949 ocs_log_err(hal->
os,
"Error posting getting IF info\n");
3953 ocs_log_err(hal->
os,
"Error building get IF info\n");
3982 if ((status == 0) && resp->
hdr.
status) {
3994 (status == 0 ? &rtn : NULL));
4020 ocs_log_err(hal->
os,
"no buffer for command\n");
4034 ocs_log_test(hal->
os,
"Error posting get default gateway\n");
4038 ocs_log_test(hal->
os,
"Error building get default gateway\n");
4065 ocs_log_err(hal->
os,
"no buffer for command\n");
4078 ocs_log_test(hal->
os,
"Error posting modify default gateway\n");
4082 ocs_log_test(hal->
os,
"Error building modify default gateway\n");
4109 ocs_log_err(hal->
os,
"no buffer for command\n");
4122 ocs_log_test(hal->
os,
"Error posting modify default gateway\n");
4126 ocs_log_test(hal->
os,
"Error building modify default gateway\n");
4158 ocs_log_err(hal->
os,
"ERROR: Current firmware version %s is older than the minimum supported version %s. Listen server not starting.\n",
4165 ocs_log_err(hal->
os,
"no buffer for command\n");
4174 ipaddr, tcp_port)) {
4177 ocs_log_test(hal->
os,
"Error posting START_LISTEN\n");
4181 ocs_log_test(hal->
os,
"Error building START_LISTEN message\n");
4210 ocs_log_err(hal->
os,
"no buffer for command\n");
4219 ipaddr, tcp_port)) {
4222 ocs_log_test(hal->
os,
"Error posting STOP_LISTEN\n");
4226 ocs_log_test(hal->
os,
"Error building STOP_LISTEN message\n");
4253 ocs_log_err(hal->
os,
"no buffer for command\n");
4263 (uint32_t)portal, 1)) {
4266 ocs_log_test(hal->
os,
"Error posting iSNS Discover\n");
4270 ocs_log_test(hal->
os,
"Error building iSNS Discover message\n");
4297 if ((status == 0) && hdr->status) {
4302 hdr->additional_status,
4326 void *packet, uint32_t pkt_len,
4333 ocs_log_test(hal->
os,
"iSNS packet is too big for preallocated buffer\n");
4339 ocs_log_err(hal->
os,
"no buffer for command\n");
4355 ocs_log_test(hal->
os,
"Error posting iSNS Send\n");
4359 ocs_log_test(hal->
os,
"Error building iSNS Send message\n");
4389 ocs_log_err(hal->
os,
"no buffer for command\n");
4398 ipaddr, tcp_port)) {
4401 ocs_log_test(hal->
os,
"Error posting START_ESI_LISTEN\n");
4405 ocs_log_test(hal->
os,
"Error building START_ESI_LISTEN message\n");
4434 ocs_log_err(hal->
os,
"no buffer for command\n");
4443 ipaddr, tcp_port)) {
4446 ocs_log_test(hal->
os,
"Error posting STOP_ESI_LISTEN\n");
4450 ocs_log_test(hal->
os,
"Error building STOP_ESI_LISTEN message\n");
4470 ocs_sli_port_t *sport;
4471 ocs_cxn_t * cxn = NULL;
4473 if (hal->
domain != NULL) {
4482 hal->
domain->node_instance_count++;
4485 cxn->conn_hdl = conn_hdl;
4488 cxn->is_ini_cxn = FALSE;
4495 ocs_log_err(hal->
os,
"failed to allocate a connection\n");
4515 ocs_cxn_t *cxn = ctx->
cxn;
4523 if ((status == 0) && resp->
hdr.
status) {
4553 uint16_t window_size, uint8_t window_scale,
4564 ocs_log_err(hal->
os,
"ERROR: Current firmware version %s is older than the minimum supported version %s. Connection rejected.\n",
4571 ocs_log_err(hal->
os,
"no buffer for command\n");
4590 if (hal->
wq[cxn->wq_index].
ulp != hal->
cq[cxn->cq_index].
ulp) {
4598 ocs_log_debug(hal->
os,
"CQ[%d] on ULP %d assigned to WQ[%d], CQ id %d, WQ id %d/ULP %d, RQ[%d]\n",
4599 cxn->cq_index, hal->
cq[cxn->cq_index].
ulp,
4600 cxn->wq_index, hal->
cq[cxn->cq_index].
id,
4601 hal->
wq[cxn->wq_index].
id, hal->
wq[cxn->wq_index].
ulp,
4606 ipaddr, tcp_port, cxn->wq_id,
4607 hal->
cq[cxn->cq_index].
id,
4609 hal->
rq[cxn->rqindex].
id,
4610 hal->
rq[cxn->rqindex+1].
id,
4617 ipaddr, tcp_port, cxn->wq_id,
4618 hal->
cq[cxn->cq_index].
id,
4620 hal->
rq[cxn->rqindex].
id,
4621 hal->
rq[cxn->rqindex+1].
id,
4627 ocs_log_test(hal->
os,
"Error posting tcp connect\n");
4629 cxn->is_ini_cxn = TRUE;
4633 ocs_log_test(hal->
os,
"Error building tcp connect message\n");
4693 ocs_log_err(hal->
os,
"no buffer for command\n");
4705 ocs_log_test(hal->
os,
"Error posting connection reject\n");
4709 ocs_log_test(hal->
os,
"Error building connection reject message\n");
4729 ocs_cxn_t *cxn = ctx->
cxn;
4731 uint8_t msg_addl_status;
4750 cxn->tcp_wscale = resp->
wscale;
4767 cxn->tcp_wscale = 0;
4771 if ((status == 0) && msg_status) {
4772 status = msg_status;
4804 ocs_log_err(hal->
os,
"no buffer for command\n");
4825 ocs_log_test(hal->
os,
"Error posting connection info\n");
4829 ocs_log_test(hal->
os,
"Error building connection info message\n");
4850 uint32_t lowest_inuse_count = 0xFFFFFFFF;
4862 ocs_lock(&hal->
cq[i].
lock);
4863 if (hal->
wq[cxn->wq_index].
ulp == hal->
cq[i].
ulp &&
4864 hal->
cq[i].
cxn_cnt < lowest_inuse_count &&
4866 lowest_inuse_count = hal->
cq[i].
cxn_cnt;
4867 lowest_inuse_index = i;
4869 ocs_unlock(&hal->
cq[i].
lock);
4872 ocs_lock(&hal->
cq[lowest_inuse_index].
lock);
4874 cxn->cq_index = lowest_inuse_index;
4875 ocs_unlock(&hal->
cq[lowest_inuse_index].
lock);
4877 ocs_log_debug(hal->
os,
"CQ[%d], id %d on ULP %d assigned to WQ[%d], id %d on ULP %d, RQ[%d]\n",
4878 cxn->cq_index, hal->
cq[cxn->cq_index].
id,
4879 hal->
cq[cxn->cq_index].
ulp,
4880 cxn->wq_index, hal->
wq[cxn->wq_index].
id,
4881 hal->
wq[cxn->wq_index].
ulp,
4898 ocs_lock(&hal->
cq[cxn->cq_index].
lock);
4900 ocs_unlock(&hal->
cq[cxn->cq_index].
lock);
4920 uint32_t tcp_window_size,
4921 uint8_t data_digest,
4923 uint32_t max_rcv_dsl,
4933 ocs_log_err(hal->
os,
"no buffer for command\n");
4965 hal->
wq[cxn->wq_index].
ulp + 1,
4967 hal->
cq[cxn->cq_index].
id,
4968 hal->
rq[cxn->rqindex].
id,
4969 hal->
rq[cxn->rqindex+1].
id,
4977 hal->
wq[cxn->wq_index].
ulp + 1,
4979 hal->
cq[cxn->cq_index].
id,
4980 hal->
rq[cxn->rqindex].
id,
4981 hal->
rq[cxn->rqindex+1].
id,
4988 ocs_log_test(hal->
os,
"Error posting connection offload\n");
4990 cxn->is_ini_cxn = FALSE;
4994 ocs_log_test(hal->
os,
"Error building connection offload message\n");
5018 &hal->
wq[cxn->wq_index]);
5046 ocs_log_err(hal->
os,
"no buffer for command\n");
5054 if (cxn->is_ini_cxn) {
5071 ocs_log_test(hal->
os,
"Error posting invalidate connection\n");
5075 ocs_log_test(hal->
os,
"Error building invalidate connection message\n");
5104 ocs_log_err(hal->
os,
"no buffer for command\n");
5118 ocs_log_test(hal->
os,
"Error posting connection upload\n");
5124 ocs_log_test(hal->
os,
"Error building connection upload message\n");
5145 hal->
domain->node_instance_count--;
5181 io->
itt = 0xffffffff;
5210 uint32_t *quarantine_cnt,
5211 ocs_list_t *quarantine_list)
5215 while (*quarantine_cnt > 4) {
5219 (*quarantine_cnt)--;
5299 if (NULL != chain_io) {
5307 sgl_info->
io = chain_io;
5308 sgl_info->
n_sge = 0;
5310 ocs_log_err(hal->
os,
"failed to allocate a chained sgl_info object\n");
5513 (nop_hdr->
itt == 0xffffffff),
5524 ocs_log_test(hal->
os,
"unsupported IO type %#x\n", type);
5530 &hal->
wq[cxn->wq_index], wqe, io);
5534 hal_io->wq_ctx->wrb_index);
5571 ocs_log_err(hal ? hal->
os : NULL,
"bad parameter hal=%p io=%p\n",
5588 data = sgl_info->
sgl;
5639 ocs_log_test(hal->
os,
"unsupported IO type %#x\n", type);
5646 for (i = 0; i < skips; i++) {
5688 sgl_prev = sgl_info;
5690 if (sgl_info == NULL ) {
5691 ocs_log_err(hal->
os,
"No chaining ICDs available\n");
5701 data = sgl_prev->
sgl;
5706 data = sgl_info->
sgl;
5709 sgl_info->
n_sge = 1;
5711 ocs_log_err(hal->
os,
"Exceeded %d SGEs for IO\n", sgl_info->
num_entries);
5738 if (!hal || !io || !addr || !length) {
5739 ocs_log_err(hal ? hal->
os : NULL,
5740 "bad parameter hal=%p io=%p addr=%lx length=%u\n",
5741 hal, io, addr, length);
5746 ocs_log_err(hal->
os,
"length of SGE %d bigger than allowed %d\n",
5752 if (sgl_info == NULL ) {
5756 data = sgl_info->
sgl;
5757 data += sgl_info->
n_sge;
5770 if (sgl_info->
n_sge) {
5771 data[-1].
last = FALSE;
5805 ocs_log_err(hal ? hal->
os : NULL,
"bad parameter hal=%p io=%p dif_info=%p\n",
5811 if (sgl_info == NULL ) {
5815 data = sgl_info->
sgl;
5816 data += sgl_info->
n_sge;
5848 ocs_log_test(hal->
os,
"unsupported DIF operation %#x\n",
5857 if (sgl_info->
n_sge) {
5858 data[-1].
last = FALSE;
5885 if (!hal || !io || !addr) {
5886 ocs_log_err(hal ? hal->
os : NULL,
5887 "bad parameter hal=%p io=%p addr=%lx\n",
5893 if (sgl_info == NULL ) {
5897 data = sgl_info->
sgl;
5898 data += sgl_info->
n_sge;
5910 if (sgl_info->
n_sge) {
5911 data[-1].
last = FALSE;
5948 ocs_log_test(hal->
os,
"Bad abort status of 0x%x\n", status);
5952 for (index = 0; index < rsp->
icd_count; index++) {
5954 ocs_cxn_t *cxn = io->
node;
5956 if ((rsp->
status[index] & 0xFFFF) !=
5958 ocs_log_test(hal->
os,
5959 "IO at index %d, bad abort status of 0x%x\n",
5960 index, rsp->
status[index]);
5961 }
else if (cxn != NULL && cxn->is_ini_cxn) {
5963 if (io->
wq_ctx != NULL) {
5965 &hal->
wq[cxn->wq_index],
5974 if (NULL != io->
done) {
5976 void *arg = io->
arg;
5979 done(io, cxn, -1, NULL, arg);
6016 if (ocs_dma_alloc(hal->
os,
6020 ocs_log_err(hal->
os,
"DMA malloc failed\n");
6028 io_tbl = ocs_malloc(hal->
os,
sizeof(
ocs_hal_io_t*) * num_ios, OCS_M_ZERO | OCS_M_NOWAIT);
6029 if (io_tbl == NULL) {
6030 ocs_log_err(hal->
os,
"failed allocating IO table memory\n");
6031 ocs_dma_free(hal->
os, &dma_mem);
6034 ocs_memcpy(io_tbl, ios,
sizeof(
ocs_hal_io_t*) * num_ios);
6038 ocs_log_err(hal->
os,
"no buffer for command\n");
6039 ocs_dma_free(hal->
os, &dma_mem);
6059 ocs_log_test(hal->
os,
"Error posting Invalidate Cmd\n");
6060 ocs_dma_free(hal->
os, &dma_mem);
6066 for (index = 0; index < num_ios; index++) {
6072 ocs_log_test(hal->
os,
"Error building Invalidate Cmd message\n");
6073 ocs_dma_free(hal->
os, &dma_mem);
6103 ocs_cxn_t *cxn = io->
node;
6113 &hal->
wq[cxn->wq_index],
6115 ocs_log_test(hal->
os,
"Active IO, icd=%d, is not found in WQE\n",
6120 ios[(*io_index)++] = io;
6151 ocs_sli_port_t *sport;
6154 uint16_t io_index = 0;
6158 OCS_M_ZERO | OCS_M_NOWAIT);
6159 if (io_tbl == NULL) {
6160 ocs_log_err(hal->
os,
"failed allocating IP table memory\n");
6165 switch(abort_scope) {
6198 ocs_log_err(hal->
os,
"bad parameter(s) abort_scope=%d\n", abort_scope);
6203 if (rc == 0 && io_index > 0) {
6259 int num_descriptors;
6269 for (i=0; i<num_descriptors; i++) {
6315 ocs_log_err(hal->
os,
"Failed to allocate DMA buffer\n");
6321 ocs_log_err(hal->
os,
"no buffer for command\n");
6338 ocs_log_test(hal->
os,
"Error posting Get Profile List Cmd\n");
6339 ocs_dma_free(hal->
os, &dma_mem);
6343 ocs_log_test(hal->
os,
"Error building Get Profile List Cmd message\n");
6344 ocs_dma_free(hal->
os, &dma_mem);
6365 uint32_t active_profile;
6409 ocs_log_err(hal->
os,
"no buffer for command\n");
6421 ocs_log_test(hal->
os,
"Error posting COMMON_GET_ACTIVE_PROFILE\n");
6425 ocs_log_test(hal->
os,
"Error building COMMON_GET_ACTIVE_PROFILE\n");
6490 ocs_log_err(hal->
os,
"no buffer for command\n");
6503 ocs_log_test(hal->
os,
"Error posting COMMON_SET_ACTIVE_PROFILE\n");
6507 ocs_log_test(hal->
os,
"Error building COMMON_SET_ACTIVE_PROFILE\n");
6522 typedef struct ocs_hal_skyhawk_linkcfg_map_s {
6548 for (i = 0; i < ARRAY_SIZE(skyhawk_linkcfg_map); i++) {
6549 if (skyhawk_linkcfg_map[i].linkcfg == linkcfg) {
6550 return skyhawk_linkcfg_map[i].
config_id;
6568 for (i = 0; i < ARRAY_SIZE(skyhawk_linkcfg_map); i++) {
6569 if (skyhawk_linkcfg_map[i].config_id == config_id) {
6570 return skyhawk_linkcfg_map[i].
linkcfg;
6639 ocs_log_err(hal->
os,
"Failed to allocate DMA buffer\n");
6645 ocs_log_err(hal->
os,
"no buffer for command\n");
6659 ocs_log_test(hal->
os,
"Error posting COMMON_GET_RECONFIG_LINK_INFO\n");
6663 ocs_log_test(hal->
os,
"Error building COMMON_GET_RECONFIG_LINK_INFO\n");
6731 ocs_log_err(hal->
os,
"no buffer for command\n");
6740 NULL, 0, config_id);
6744 ocs_log_test(hal->
os,
"Error posting COMMON_SET_RECONFIG_LINK_ID\n");
6748 ocs_log_test(hal->
os,
"Error building COMMON_SET_RECONFIG_LINK_ID\n");
6755 typedef struct port_protocol_args_s {
6776 int num_descriptors;
6784 pci_func = protocol_args->pci_func;
6790 for (i=0; i<num_descriptors; i++) {
6793 if (pcie_desc_p->pf_number == pci_func) {
6794 switch(pcie_desc_p->pf_type) {
6857 if (ocs_dma_alloc(hal->
os, &dma_mem, 4096, 4)) {
6858 ocs_log_err(hal->
os,
"Failed to allocate DMA buffer\n");
6864 ocs_log_err(hal->
os,
"no buffer for command\n");
6865 ocs_dma_free(hal->
os, &dma_mem);
6870 if (protocol_args == NULL) {
6871 ocs_log_err(hal->
os,
"no memory for args\n");
6872 ocs_dma_free(hal->
os, &dma_mem);
6879 protocol_args->
pci_func = pci_func;
6887 ocs_log_test(hal->
os,
"Error posting COMMON_GET_PROFILE_CONFIG\n");
6888 ocs_dma_free(hal->
os, &dma_mem);
6893 ocs_log_test(hal->
os,
"Error building COMMON_GET_PROFILE_CONFIG\n");
6894 ocs_dma_free(hal->
os, &dma_mem);
6955 int num_descriptors;
6965 int pci_descriptor_count;
6967 int num_fcoe_ports = 0;
6968 int num_iscsi_ports = 0;
6973 new_protocol = protocol_args->new_protocol;
6974 pci_func = protocol_args->pci_func;
6979 pci_descriptor_count = 0;
6981 for (i=0; i<num_descriptors; i++) {
6983 ++pci_descriptor_count;
6993 ocs_log_err(hal->
os,
"Failed to allocate DMA buffer\n");
7001 ocs_log_err(hal->
os,
"no buffer for command\n");
7005 new_ctx->mgmt_cb = ctx->
mgmt_cb;
7009 new_ctx->non_emdedded_mem = dma_mem;
7012 0, &new_ctx->non_emdedded_mem,
7013 0, pci_descriptor_count+1, 1);
7023 for (i=0; i<num_descriptors; i++) {
7026 if (pcie_desc_p->pf_number == pci_func) {
7029 switch(new_protocol) {
7062 if (num_iscsi_ports > 0) {
7063 isap_desc_p->iscsi_tgt = 1;
7064 isap_desc_p->iscsi_ini = 1;
7065 isap_desc_p->iscsi_dif = 1;
7067 if (num_fcoe_ports > 0) {
7068 isap_desc_p->fcoe_tgt = 1;
7069 isap_desc_p->fcoe_ini = 1;
7070 isap_desc_p->fcoe_dif = 1;
7078 ocs_log_test(hal->
os,
"Error posting COMMON_SET_PROFILE_CONFIG\n");
7133 if (ocs_dma_alloc(hal->
os, &dma_mem, 4096, 4)) {
7134 ocs_log_err(hal->
os,
"Failed to allocate DMA buffer\n");
7139 if (protocol_args == NULL) {
7140 ocs_log_err(hal->
os,
"Failed to allocate protocol args\n");
7141 ocs_dma_free(hal->
os, &dma_mem);
7147 ocs_log_err(hal->
os,
"no buffer for command\n");
7153 protocol_args->
pci_func = pci_func;
7164 ocs_log_test(hal->
os,
"Error posting COMMON_GET_FUNCTION_CONFIG\n");
7165 ocs_dma_free(hal->
os, &dma_mem);
7170 ocs_log_test(hal->
os,
"Error building COMMON_GET_FUNCTION_CONFIG\n");
7171 ocs_dma_free(hal->
os, &dma_mem);
7198 hal->
io[i].
itt == itt) {
7230 ocs_t *ocs = hal->
os;
7235 ocs_log_debug(hal->
os,
"allocate %d buffers of 0x%x size for rqindex %d\n",
7236 count, size, rqindex);
7239 rq_buf = ocs_malloc(hal->
os,
sizeof(*rq_buf) * count, OCS_M_NOWAIT | OCS_M_ZERO);
7240 if (rq_buf == NULL) {
7241 ocs_log_err(hal->
os,
"Failure to allocate unsolicited DMA trackers\n");
7245 for (i = 0, prq = rq_buf; i < count; i ++, prq++) {
7247 if (ocs_dma_alloc(ocs, &prq->
dma, size, OCS_MIN_DMA_ALIGNMENT)) {
7250 ocs_log_err(hal->
os,
"DMA allocation failed\n");
7252 for (j = 0; j < i; j++) {
7253 ocs_dma_free(ocs, &rq_buf[j].dma);
7256 ocs_free(hal->
os, rq_buf,
sizeof(*rq_buf) * count);
7280 ocs_t *ocs = hal->
os;
7284 if (rq_buf != NULL) {
7285 for (i = 0, prq = rq_buf; i < count; i++, prq++) {
7286 ocs_dma_free(ocs, &prq->
dma);
7288 ocs_free(hal->
os, rq_buf,
sizeof(*rq_buf) * count);
7302 ocs_t *ocs = hal->
os;
7303 uint32_t num_chutes;
7304 uint32_t max_hal_rq;
7307 uint32_t rqindex = 0;
7318 ocs_log_test(ocs,
"Failed to determine the number of chutes, a value of 1 is used\n");
7333 ocs_log_debug(ocs,
"(%d chutes) allocate %d hdr buffers at 0x%x, %d data at 0x%x\n",
7342 for (i = 0; i < num_chutes; i++) {
7349 if (hal->
rq_buf[rqindex] == NULL) {
7350 ocs_log_err(ocs,
"ocs_hal_rx_buffer_alloc hdr_buf failed\n");
7363 if (hal->
rq_buf[rqindex] == NULL) {
7364 ocs_log_err(ocs,
"ocs_hal_rx_buffer_alloc fb_buf failed\n");
7389 uint32_t rqindex = 0;
7390 uint32_t num_chutes;
7403 ocs_log_test(hal->
os,
"Failed to determine the number of chutes, a value of 1 is used\n");
7411 for (i = 0; i < num_chutes; i++) {
7412 for (j = 0; j < max_bufs; j++) {
7417 hdr = &hal->
rq_buf[rqindex][j];
7421 data = &hal->
rq_buf[rqindex + 1][j];
7447 uint32_t rqindex = 0;
7448 uint32_t num_chutes;
7456 ocs_log_test(hal->
os,
"Failed to determine the number of chutes, a value of 1 is used\n");
7462 for (i = 0; i < num_chutes; i++) {
7467 hal->
rq_buf[rqindex + 1],
7469 hal->
rq_buf[rqindex] = NULL;
7470 hal->
rq_buf[rqindex + 1] = NULL;
7525 ocs_log_err(hal->
os,
"no buffer for command\n");
7536 ocs_log_test(hal->os,
"Error posting NOP\n");
7540 ocs_log_test(hal->os,
"Error building NOP message\n");
7552 if (cxn->is_ini_cxn) {
This structure contains the type and associated fields for a CQE completion.
Mailbox Completion Queue Entry.
int ocs_hal_fw_valid(ocs_hal_t *hal)
Check that firmware version meets minimum requirements.
static int32_t ocs_hal_set_active_profile_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of set_active_profile for a user request.
static void ocs_hal_cxn_cq_select(ocs_hal_t *hal, ocs_cxn_t *cxn)
Assign a CQ for the connection.
static ocs_cxn_t * ocs_hal_cxn_find(ocs_hal_t *hal, uint16_t wq_id)
Find the connection structure given the WQ_ID.
int32_t(* cxn)(void *, ocs_hal_cxn_event_t *)
sli4_port_type_e port_type
sli4_wqe_context_t * wq_ctx
ocs_hal_rq_buffer_t * rq_buf
ocs_hal_ip_type_e ip_type
static void ocs_sport_unlock(ocs_sport_t *sport)
void * sli_queue_iscsi_icd_lookup(sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index)
Returns the IO tied to a specific ICD index.
Structure to track RQ buffers submitted to the chip.
int32_t sli_iscsi_set_frag_bits(sli4_t *sli4)
Allocate the SGL pages assigned to the ICD table and post them to the chip.
static int32_t ocs_hal_discovered_isns_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of retrieving the iSNS discovered list.
ocs_hal_rtn_e ocs_hal_portal_gateway_add(ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
adds the default gateway on an interface.
static ocs_hal_rtn_e ocs_hal_init_io(ocs_hal_t *)
SGL information structure.
uint32_t ocs_hal_cxn_get_free_wq_cnt(ocs_hal_t *hal, ocs_cxn_t *cxn)
Returns the number of free entries on the work queue for this connection.
This structure contains the fields in a T_DATA_DIGEST completion.
ocs_iscsi_route_table_entry_t entry[OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX]
static int32_t ocs_hal_portal_get_default_gateway_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of get_default_gateway for a user request.
ocs_hal_rtn_e ocs_hal_cxn_connect(ocs_hal_t *hal, ocs_cxn_t *cxn, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t window_size, uint8_t window_scale, cxn_cb_t cxn_cb, void *ul_arg)
Establish a TCP connection from an initiator to a target.
ocs_list_t io_ini_read_quarantine
static int32_t ocs_hal_portal_ip_get_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion if get_if_info for a user request.
uint32_t additional_status
static int32_t ocs_hal_portal_std_cb_no_parms(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Send the callback for a network interface delete command.
int32_t sli_fw_error_status(sli4_t *sli4)
Read the SLIPORT_SEMAPHORE and SLIPORT_STATUS registers to check if the port status indicates that a ...
int32_t ocs_hal_get_active_profile(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the currently active profile.
ocs_hal_rtn_e ocs_hal_cxn_close(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t sendRst, cxn_cb_t cxn_cb, void *ul_arg)
Invalidates a connection and optionally sends a TCP Reset.
static void sli_chain_sge_build(sli4_t *sli4, sli4_chain_sge_t *sge, uint32_t icd_index, uint32_t frag_num, uint32_t offset)
int32_t sli_cmd_iscsi_tgt_invalidate_connection(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint16_t cid, uint8_t sendRst)
write a ISCSI_TGT_INVALIDATE_CONNECTION command
uint8_t data_pdu_in_order
#define SLI4_OPC_ISCSI_NTWK_DISCOVER_ISNS_SERVER
int32_t sli_cmd_common_tcp_upload(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t wq_id, uint8_t graceful)
Write a COMMON_TCP_UPLOAD command.
int32_t sli_cmd_iscsi_common_get_default_gateway(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isv4)
write a COMMON_ISCSI_NTWK_GET_DEFAULT_GATEWAY command
static ocs_hal_skyhawk_linkcfg_map_t skyhawk_linkcfg_map[]
Mapping from the HAL linkcfg enum to the Skyhawk link config IDs.
int32_t sli_cmd_iscsi_common_modify_default_gateway(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isadd, ocs_hal_ip_address_t *gateway)
write a COMMON_ISCSI_NTWK_MODIFY_DEFAULT_GATEWAY command
static int32_t ocs_hal_io_abort_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Receives the callback for an invalidate commands mailbox cmd.
sli4_ip_addr_subnet_t addr[5]
ocs_hal_rtn_e ocs_hal_portal_isns_send_packet(ocs_hal_t *hal, ocs_hal_ip_address_t *isns_server, uint32_t tcp_port, void *packet, uint32_t pkt_len, portal_cb_t portal_cb, void *ul_arg)
Sends an iSNS packet to the requested server.
mailbox queue Element header
ocs_hal_rq_lookup_t * rq_lookup[OCS_HAL_MAX_NUM_RQ]
#define SLI4_RESOURCE_DESCRIPTOR_TYPE_PCIE
Resource descriptor.
ocs_hal_sgl_info_t * sgl_info
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Set up Hardware Abstraction Layer module.
ocs_hal_property_e
enum identifying the HAL properties.
static int32_t ocs_hal_get_linkcfg_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of get_linkcfg for a user request.
static int32_t ocs_hal_cxn_tcp_connect_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Process the completion of a request for a new tcp connection.
ocs_hal_rtn_e ocs_hal_command_queue(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
static int32_t ocs_hal_cb_wait_async(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the mailbox completion of command waiting for async messages.
#define ocs_queue_history_wq(...)
This structure contains the fields in a DMSG completion.
int32_t ocs_hal_portal_get_route_table_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of Get Route table command.
ocs_hal_rq_buffer_t * rq_buf[OCS_HAL_MAX_NUM_RQ]
static ocs_hal_rtn_e ocs_hal_io_abort_send_cmd(ocs_hal_t *hal, ocs_hal_io_t **ios, uint16_t num_ios, ocs_hal_abort_type_e abort_type)
Abort a list of IOs.
int32_t sli_cmd_iscsi_cleanup_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t ulp_no, uint8_t hdrq_id, uint8_t dataq_id)
write a COMMON_ISCSI_CLEANUP (version 0) command
static int32_t ocs_hal_cmd_submit_pending(ocs_hal_t *hal)
Submit queued (pending) mbx commands.
static uint32_t sli_is_dif_separate_capable(sli4_t *sli4)
ocs_list_t io_tgt_write_quarantine
static void ocs_hal_sgl_info_free(ocs_hal_t *hal, ocs_hal_sgl_info_t *sgl_info)
Free a previously allocated HAL SGL Chaining object.
int32_t sli_eq_modify_delay(sli4_t *sli4, sli4_queue_t *eq, uint32_t num_eq, uint32_t shift, uint32_t delay_mult)
Modify the delay timer for all the EQs.
static int32_t ocs_list_empty(ocs_list_t *list)
Test if a list is empty.
static void ocs_sport_lock(ocs_sport_t *sport)
ocs_dma_t non_emdedded_mem
ocs_hal_rtn_e ocs_hal_domain_add(ocs_hal_t *hal, ocs_sli_port_t *sport, ocs_domain_t *domain)
Adds a domain object.
#define ocs_queue_history_init(...)
struct ocs_hal_io_param_t::@10 ini_io
T10 DIF information passed to the transport.
ocs_hal_rtn_e ocs_hal_portal_gateway_remove(ocs_hal_t *hal, ocs_hal_ip_address_t *gateway, portal_cb_t portal_cb, void *ul_arg)
removes a default gateway on an interface.
int32_t sli_cmd_iscsi_common_get_if_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4)
write a COMMON_ISCSI_NTWK_GET_IF_INFO command
struct sli4_queue_t::@33::@35 wq
int32_t sli_cmd_common_set_features(sli4_t *sli4, void *buf, size_t size, uint32_t feature, uint32_t param_len, void *parameter)
Write a COMMON_SET_FEATURES command.
static uint32_t sli_is_sgl_chaining_capable(sli4_t *sli4)
int32_t sli_fw_reset(sli4_t *sli4)
int32_t ocs_hal_get_num_eq(ocs_hal_t *hal)
int32_t ocs_hal_get_linkcfg(ocs_hal_t *hal, mgmt_cb_t cb, void *ul_arg)
Get the current link configuration.
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down Hardware Abstraction Layer module.
struct ocs_hal_io_param_t::@14 tgt_write
static ocs_hal_rtn_e ocs_hal_io_abort_add_entry(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_t **ios, uint16_t *io_index, ocs_hal_abort_type_e abort_type)
Abort a list of IOs.
int32_t sli_setup(sli4_t *sli4, ocs_os_handle_t os, sli4_port_type_e port_type)
Setup the SLI context.
uint16_t def_time_to_retain
static ocs_hal_sgl_info_t * ocs_hal_io_get_sgl_info(ocs_hal_t *hal, ocs_hal_io_t *io)
Find the correct position to add an SGL. This may result in the allocation of a chained SGL List...
ocs_cxn_t * ocs_hal_cxn_alloc(ocs_hal_t *hal, uint32_t conn_hdl)
Gets a free connection structure.
#define OCS_HAL_CQ_NUM_FOR_INI
sli4_queue_t ** pending_cqs[OCS_HAL_MAX_NUM_EQ]
int32_t sli_cmd_common_get_profile_config(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_CONFIG command.
int32_t sli_cmd_iscsi_common_discovered_isns_servers(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface)
write a COMMON_ISCSI_NTWK_DISCOVERED_ISNS_SERVERS command
struct ocs_hal_t::@20 callback
#define SLI4_PORT_TYPE_DEFAULT
int32_t sli_cmd_iscsi_tgt_offload_connection_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint32_t tcp_window_size, uint16_t ulp_no, uint16_t wq_id, uint16_t cq_id, uint16_t hdrq_id, uint16_t dataq_id, uint8_t nrs, ocs_hal_target_login_options_t *lgn_options)
write a ISCSI_TGT_OFFLOAD_CONNECTION command (version 1)
ocs_hal_rtn_e ocs_hal_set_linkcfg(ocs_hal_t *hal, mgmt_cb_t cb, ocs_hal_linkcfg_e value, void *ul_arg)
Set the link configuration (Skyhawk only).
static int32_t ocs_hal_stateless_cb_if_info(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion if get_if_info for a configure stateless command.
COMMON_ISCSI_NTWK_GET_ROUTE_TABLE.
int32_t sli_cmd_common_get_active_profile(sli4_t *sli4, void *buf, size_t size, uint64_t tag)
Write a COMMON_COMMON_GET_ACTIVE_PROFILE command.
structure wrapping an IP address and subnet together with their type.
int32_t sli_queue_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Write an entry to the queue object.
static void * ocs_list_get_head(ocs_list_t *list)
Return the first item in the list.
#define ocs_queue_history_cqe(...)
char profile_description[512]
struct sli4_queue_t::@33::@34 flag
Structure to hold the fields returned on a target data digest error event.
uint8_t fw_on_flash_version[32]
#define OCS_HAL_MAX_NUM_RQ
static ocs_hal_rtn_e ocs_hal_setup_cxns(ocs_hal_t *hal)
Initialize the pool of HAL connection objects.
uint32_t partial_data_length
#define OCS_HAL_RQ_SIZE_HDR
Defines the size of the RQ buffers used for each RQ.
ocs_command_ctx_t * ocs_hal_command_get_ctx(ocs_hal_t *hal)
Issue a SLI command.
static int32_t ocs_hal_cxn_std_cb_no_parms(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Send the connection callback with no parameters passed back.
static ocs_hal_rtn_e ocs_hal_rx_allocate(ocs_hal_t *hal)
Allocate the RQ data buffers.
T10 DIF Seed Scatter-Gather Entry (SGE)
#define OCS_FW_VER_STR(x)
ocs_hal_rtn_e ocs_hal_cxn_reject(ocs_hal_t *hal, uint32_t conn_hdl, cxn_cb_t cxn_cb, void *ul_arg)
Rejects an incoming connection on a target.
union sli4_qentry_fields_t::@32 msg
int32_t sli_cmd_common_set_profile_config(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma, uint8_t profile_id, uint32_t descriptor_count, uint8_t isap)
Write a COMMON_COMMON_SET_PROFILE_CONFIG command.
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
static ocs_hal_rq_buffer_t * ocs_hal_rx_buffer_alloc(ocs_hal_t *hal, uint32_t rqindex, uint32_t count, uint32_t size)
Allocate an ocs_hal_rx_buffer_t array.
ocs_hal_rtn_e ocs_hal_portal_esi_listen_stop(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Stops listening on an iSNS ESI TCP port.
#define SLI4_SGE_DIF_OP_IN_CRC_OUT_NODIF
ocs_hal_target_login_options_t lgn_options
static int32_t ocs_hal_portal_isns_send_packet_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Send the callback for the sending of an iSNS packet.
ocs_hal_dhcp_state_t dhcp_state
ocs_hal_rtn_e ocs_hal_set_active_profile(ocs_hal_t *hal, mgmt_cb_t cb, uint32_t profile_id, void *ul_arg)
Set the currently active profile.
ocs_hal_rtn_e ocs_hal_io_add_seed_sge(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_dif_info_t *dif_info)
Add a T10 PI seed scatter gather list entry.
ocs_hal_rtn_e ocs_hal_portal_listen_start(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Starts listening on a TCP port.
ocs_hal_rtn_e
defines common HAL return statuses.
ocs_hal_rtn_e ocs_hal_portal_ip_add(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
Add an IP address to an interface.
static uint32_t sli_is_dif_inline_capable(sli4_t *sli4)
#define OCS_HAL_RQ_SIZE_DATA
ocs_hal_rtn_e ocs_hal_io_init_sges(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_io_type_e type, uint32_t offset)
Initialize the Scatter Gather List entries of an IO.
int32_t sli_iscsi_io_get_icd_and_sgl(sli4_t *sli4, uint32_t io_offset, uint16_t *icd, void **sgl)
return the ICD and virtual SGL pointer for an IO at the specified offset into the ICD table...
ocs_hal_abort_type_e
HAL abort types.
static uint32_t sli_is_ulp_enabled(sli4_t *sli4, uint16_t ulp)
#define OCS_HAL_WQ_ENTRIES
int32_t sli_queue_is_empty(sli4_t *sli4, sli4_queue_t *q)
Check if the given queue is empty.
ocs_hal_rtn_e ocs_hal_command_bootstrap(ocs_hal_t *hal, uint8_t *cmd)
Issue a SLI command to the bootstrap mailbox.
ocs_hal_reset_e
defines the types of resets.
sli4_qentry_fields_tx_dif_error_t tx_dif_err
uint32_t uint32_t profile_description[128]
static void ocs_hal_rx_buffer_free(ocs_hal_t *hal, ocs_hal_rq_buffer_t *rq_buf, uint32_t count)
Free an ocs_hal_rx_buffer_t array.
static int32_t ocs_hal_command_process(ocs_hal_t *, int32_t, uint8_t *, size_t)
COMMON_ISCSI_ERROR_RECOVERY_INVALIDATE_CMDS.
#define SLI4_SGE_TYPE_DISEED
#define SLI4_SGE_TYPE_DIF
ocs_hal_ip_address_t subnet
Structure to define what connection event occurred and it's parameters.
#define OCS_HAL_TIMECHECK_ITERATIONS
ocs_hal_rtn_e ocs_hal_io_add_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr, uint32_t length)
Add a Scatter Gather list Entry to an IO.
struct ocs_hal_io_param_t::@16 unassisted
void ocs_hal_cxn_req_invalidate(ocs_list_t *list_cxn)
int32_t sli_cmd_common_get_reconfig_link_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_RECONFIG_LINK_INFO command.
int32_t sli_cmd_iscsi_common_discover_isns_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint32_t retries)
write a COMMON_ISCSI_NTWK_DISCOVER_ISNS_SERVER command
ocs_hal_rtn_e ocs_hal_portal_set_mac(ocs_hal_t *hal, uint8_t *mac_address, portal_cb_t portal_cb, void *ul_arg)
Set the MAC address on the portal.
ocs_hal_rtn_e ocs_hal_callback(ocs_hal_t *hal, ocs_hal_callback_e which, void *func, void *arg)
register a callback for the given event.
int32_t sli_queue_read(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Read an entry from the queue object.
sli4_qentry_fields_tsol_t tsol
int32_t sli_cmd_iscsi_tcp_connect_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t cid, uint16_t cq_id, ocs_dma_t *data_out, uint16_t hdr_ring_id, uint16_t data_ring_id, uint8_t do_offload)
write a ISCSI_TCP_CONNECT_AND_OFFLOAD V0 command
#define ISCSI_CQE_CODE_UNSOL_HDR_NOTIFY
#define SLI4_SUBSYSTEM_COMMON_ISCSI
static uint32_t sli_get_max_sge(sli4_t *sli4)
T10 DIF Scatter-Gather Entry (SGE)
ocs_hal_rq_list_t * rq_list[OCS_HAL_MAX_NUM_RQ]
int32_t sli_teardown(sli4_t *sli4)
Tear down a SLI context.
#define CONN_STATE_NEW_CONN
uint32_t active_link_config_id
defines the parameters for an IO based on the IO type.
int32_t sli_cmd_iscsi_tgt_stop_listen_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_STOP_LISTEN_SERVER command
#define SLI4_SGE_DIF_OP_IN_CRC_OUT_CRC
#define SLI4_PORT_TYPE_FC
#define SLI4_SGE_DIF_OP_IN_NODIF_OUT_CRC
uint32_t ocs_hal_portal_t
sli4_profile_descriptor_t profile_descriptor[MAX_PRODUCT_DESCRIPTORS]
static int32_t ocs_hal_flush(ocs_hal_t *hal)
ocs_hal_async_cb_t async_cb
uint8_t sli_iscsi_conv_hal_ip_addr_type(ocs_hal_ip_type_e ip_type)
Converts the IP address type field to the SLI4 equivalent value.
int32_t sli_cmd_iscsi_common_iface_delete(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface)
write a COMMON_ISCSI_NTWK_IFACE_CREATE command
void ocs_hal_command_free_ctx(ocs_hal_t *hal, ocs_command_ctx_t *ctx)
Issue a SLI command.
static int32_t ocs_hal_dhcp_async_event(ocs_hal_t *hal, sli4_dhcp_op_cmpl_event_t *event)
Processes the asynchronous DHCP completion message.
ocs_hal_port_protocol_e
Port protocols.
ocs_hal_profile_descriptor_t descriptors[OCS_HAL_MAX_PROFILES]
static int32_t ocs_hal_dmsg_process(ocs_hal_t *hal, sli4_qentry_fields_dmsg_t *dmsg)
Process an TCK acknowledgement(DMSG).
struct ocs_hal_io_param_t::@12 ini_nop
static void * ocs_list_remove(ocs_list_t *list, void *item)
Remove an item from the list.
union ocs_hal_cxn_event_t::@18 params
union sli4_queue_t::@33 u
static int32_t ocs_hal_dpdu_process(ocs_hal_t *hal, sli4_qentry_fields_dpdu_t *dpdu)
Process an unsolicited hdr/data.
static uint32_t sli_get_max_queue(sli4_t *sli4, sli4_qtype_e qtype)
static int32_t ocs_hal_cb_iscsi_async(void *, void *)
Callback function for SLI iSCSI asynchromous events.
uint32_t io_tgt_write_quarantine_cnt
uint32_t completion_status
int32_t sli_cmd_iscsi_tgt_get_connection_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_TGT_GET_CONNECTION_INFO command
COMMON_ISCSI_NTWK_SET_ROUTE_TABLE.
#define OCS_HAL_WQ_ENTRIES_USED
ocs_hal_rtn_e ocs_hal_portal_ip_remove(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_address_subnet_t *ipaddr, portal_cb_t portal_cb, void *ul_arg)
Removes an IP address from an interface.
static ocs_hal_rtn_e ocs_hal_rx_post(ocs_hal_t *hal)
Post the RQ data buffers to the chip.
uint16_t def_time_to_wait
static int32_t ocs_scsi_async_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Check pending error asynchronous callback function.
ocs_hal_callback_e
enum identifying the types of callbacks that can be registered.
#define SLI4_RESOURCE_DESCRIPTOR_TYPE_ISAP
int32_t sli_cqe_async(sli4_t *sli4, void *buf)
Check asynchronous event completion entry.
ocs_list_t rq_list_busy[OCS_HAL_MAX_NUM_RQ]
static void ocs_hal_cxn_cq_release(ocs_hal_t *hal, ocs_cxn_t *cxn)
Release a CQ for the connection.
ocs_hal_io_t * ocs_hal_io_alloc(ocs_hal_t *hal)
Allocate a HAL IO object.
int32_t sli_cmd_iscsi_get_connection_info(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_GET_CONNECTION_INFO command
int32_t sli_cmd_iscsi_tgt_start_esi_listen(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_START_ESI_LISTEN command
static uint32_t sli_is_dual_ulp_capable(sli4_t *sli4)
ocs_hal_io_type_e
enum identifying IO types.
static int32_t ocs_hal_set_linkcfg_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of set_linkcfg for a user request.
ocs_hal_io_t * ocs_hal_io_find_itt(ocs_hal_t *hal, uint32_t itt)
Find an IO based on the initiator task tag.
static void * ocs_list_get_tail(ocs_list_t *list)
Return the first item in the list.
sli4_queue_t rq[OCS_HAL_MAX_NUM_RQ]
static uint32_t sli_get_max_qentries(sli4_t *sli4, sli4_qtype_e qtype)
#define ocs_list_init(head, type, link)
int32_t(* ocs_hal_async_cb_t)(struct ocs_hal_s *hal, int32_t status, void *arg)
ocs_hal_rtn_e ocs_hal_reset(ocs_hal_t *hal, ocs_hal_reset_e reset)
sli4_qentry_fields_dpdu_t dpdu
uint8_t fw_version_too_low
static sli4_queue_t * ocs_hal_wq_find(ocs_hal_t *, uint16_t)
Find the WQ structure given the CQ_ID.
int32_t sli_cmd_common_nop(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint64_t context)
Write a COMMON_NOP command.
int32_t ocs_hal_portal_set_route_table_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of Set Route table command.
sli4_queue_t eq[OCS_HAL_MAX_NUM_EQ]
ocs_hal_rtn_e ocs_hal_io_abort(ocs_hal_t *hal, ocs_hal_io_t *io, ocs_hal_abort_scope_e abort_scope, ocs_hal_abort_type_e abort_type)
Abort a currently running IO.
ocs_hal_rtn_e ocs_hal_portal_delete(ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
Delete a VLAN interface handle.
uint8_t piggy_back_status
uint32_t active_profile_id
static ocs_hal_rq_buffer_t * ocs_hal_rq_get(ocs_hal_t *hal, uint16_t rqindex, uint16_t bufindex, uint32_t addr_high, uint32_t addr_low, uint32_t length)
Process an unsolicited hdr/data.
int32_t ocs_hal_process(ocs_hal_t *hal, uint32_t vector, uint32_t max_isr_time_msec)
Process events associated with the interrupt vector.
#define ocs_list_foreach_safe(list, item, nxt)
Iterate a linked list safely.
COMMON_SET_PROFILE_CONFIG.
void * sli_queue_iscsi_icd_invalid(sli4_t *sli4, sli4_queue_t *q, uint16_t icd_index, uint8_t *wait_for_tcp_ack, uint8_t tcp_ack_status)
Processes a target command invalidation IO completion. Moves the WRB to the free list.
uint32_t rq_buf_size[OCS_HAL_RQ_BUFFER_TYPE_MAX]
ocs_hal_rtn_e ocs_hal_io_send(ocs_hal_t *hal, ocs_hal_io_type_e type, ocs_hal_io_t *io, uint32_t len, ocs_hal_io_param_t *iparam, ocs_cxn_t *cxn, io_cb_t cb, void *arg)
Send a read, write, or response IO.
int32_t sli_eq_parse(sli4_t *sli4, uint8_t *buf, uint16_t *cq_id)
Parse an EQ entry to retrieve the CQ_ID for this event.
int32_t sli_cmd_iscsi_common_configure_stateless_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4, uint32_t retries)
write a COMMON_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR command
ocs_hal_linkcfg_e
Link configurations.
static uint32_t sli_get_sli_rev(sli4_t *sli4)
ocs_hal_rtn_e ocs_hal_io_add_dif_sge(ocs_hal_t *hal, ocs_hal_io_t *io, uintptr_t addr)
Add a T10 DIF scatter gather list entry to an IO.
ocs_hal_ip_address_subnet_t ipsub[5]
ocs_hal_rtn_e ocs_hal_get(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t *value)
#define SLI4_PORT_TYPE_ISCSI
int32_t sli_queue_free(sli4_t *sli4, sli4_queue_t *q)
Free a queue.
uint32_t disable_app_ffff
int32_t sli_cmd_iscsi_ntwk_set_mtu(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t mtu)
write a ISCSI_NTWK_SET_MTU command
ocs_hal_cxn_new_t cxn_new
#define ocs_queue_history_free(...)
ocs_hal_ip_address_t ip_addr
static void ocs_node_lock_init(ocs_node_t *node)
static int32_t ocs_hal_mq_process(ocs_hal_t *, int32_t, sli4_queue_t *)
Process entries on the give mailbox queue.
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
int32_t _sli_queue_peek(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
#define OCS_HAL_RQ_NUM_DATA
#define SLI4_ISCSI_WQE_SIZE
int32_t sli_cmd_iscsi_invalidate_cmds(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *msg_mem, ocs_hal_io_t **ios, uint16_t num_ios, ocs_hal_abort_type_e abort_type)
write a COMMON_ISCSI_INVALIDATE_COMMANDS command
uint32_t profile_descriptor_count
ocs_hal_ip_type_e ip_type
int32_t sli_cmd_iscsi_common_modify_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isadd, ocs_hal_ip_address_subnet_t *ipaddr)
write a COMMON_ISCSI_NTWK_MODIFY_IP_ADDR command
sli4_qentry_fields_isol_t isol
uint8_t use_v1_multi_protocol
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
sli4_qentry_fields_tcmdinv_t tcmdinv
static int32_t ocs_hal_cxn_get_info_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Process the completion of a request for connection information.
sli4_ip_addr_subnet_t ip_sub
This structure is used to track the WQEs for iSCSI.
int32_t(* bounce)(void(*)(void *arg), void *arg, uint32_t cpu)
#define ISCSI_CQE_CODE_UNSOL_DATA_DIGEST_ERROR
static int32_t ocs_hal_tsol_process(ocs_hal_t *hal, sli4_qentry_fields_tsol_t *tsol)
Process an solicited target IO completion.
uint32_t buffer_address_low
This structure contains the fields in a T_DATA_DIGEST completion.
ocs_dma_t dataout_tmpl_mem
This structure contains the fields in a CNXINV completion.
int32_t ocs_hal_event_check(ocs_hal_t *hal, uint32_t vector)
Check for events associated with the interrupt vector.
Defines the iSCSI nop-out PDU header.
COMMON_ISCSI_NTWK_DISCOVER_ISNS_SERVER.
static int32_t ocs_hal_isol_process(ocs_hal_t *hal, sli4_qentry_fields_isol_t *isol)
Process an solicited initiator IO completion.
int32_t sli_iscsi_post_sgl_pages(sli4_t *sli4)
Allocate the SGL pages assigned to the ICD table and post them to the chip.
static uint32_t sli_get_sli_family(sli4_t *sli4)
struct ocs_hal_io_param_t::@15 tgt_rsp
sli4_qentry_fields_cnxinv_t cnxinv
struct ocs_hal_io_param_t::@17 context_upd
static uint32_t sli_get_vpd_len(sli4_t *sli4)
uint32_t ocs_instance(void *os)
Return the instance index of an opaque ocs structure.
int32_t sli_cmd_iscsi_common_set_route_table(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t isadd, ocs_hal_ip_address_subnet_t *hal_ipsub, ocs_hal_ip_address_t *hal_gateway, ocs_dma_t *dma)
write a COMMON_ISCSI_NTWK_SET_ROUTE_TABLE command
Used for returning IP information in return from ocs_hal_portal_ip_get()
void ocs_hal_workaround_setup(struct ocs_hal_s *hal)
Setup HAL runtime workarounds.
int32_t sli_cmd_iscsi_tcp_connect_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, uint16_t cid, uint16_t cq_id, ocs_dma_t *data_out, uint16_t hdr_ring_id, uint16_t data_ring_id, uint8_t do_offload, uint16_t window_size, uint8_t window_scale, uint32_t tcp_mss)
#define SLI4_SET_FEATURES_DIF_MEMORY_MODE
static int32_t ocs_hal_portal_create_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Send the callback for a network interface create command.
ocs_hal_rtn_e ocs_hal_cxn_offload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint32_t tcp_window_size, uint8_t data_digest, uint8_t hdr_digest, uint32_t max_rcv_dsl, cxn_cb_t cxn_cb, void *ul_arg)
Offloads an incoming connection on a target.
static ocs_hal_linkcfg_e ocs_hal_linkcfg_from_config_id(const uint32_t config_id)
Helper function for getting the HAL linkcfg enum from a Skyhawk config ID.
uint32_t auto_incr_ref_tag
int32_t sli_cmd_iscsi_tgt_isns_send_packet(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *isns_server, uint32_t tcp_port, void *packet, uint32_t pkt_length, ocs_dma_t *pkt_mem)
write a ISCSI_TGT_ISNS_SEND_PACKET command
ocs_hal_rtn_e ocs_hal_cxn_free(ocs_hal_t *hal, ocs_cxn_t *cxn)
Frees a connection object for re-use.
int32_t sli_queue_arm(sli4_t *sli4, sli4_queue_t *q, uint8_t arm)
Arm or dis-arm a queue.
HAL link configuration enum to Skyhawk link config ID mapping.
int32_t sli_iscsi_defq_alloc(sli4_t *sli4, sli4_queue_t *header, sli4_queue_t *payload, uint32_t n_entries, uint32_t hsize, uint32_t psize, sli4_queue_t *cq, uint16_t ulp)
allocate a receive queue
sli4_qentry_fields_data_digest_t data_digest
Structure to track RQ buffers submitted to the chip.
struct sli4_t::@38 config
int32_t sli_reset(sli4_t *sli4)
static ocs_hal_rtn_e ocs_hal_set_dif_mode(ocs_hal_t *hal)
Sets the DIF mode value.
static int32_t ocs_hal_get_active_profile_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of get_active_profile for a user request.
uint8_t is_hal_initialized
ocs_hal_rtn_e ocs_hal_portal_esi_listen_start(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Starts listening for iSNS ESI messages on a TCP port.
ocs_hal_rtn_e ocs_hal_get_profile_list(ocs_hal_t *hal, mgmt_cb_t mgmt_cb, void *ul_arg)
Get a list of available profiles.
ocs_hal_abort_scope_e
HAL abort types.
static int32_t ocs_hal_cmdinv_process(ocs_hal_t *hal, sli4_qentry_fields_tcmdinv_t *cmdinv)
Process an target command error IO completion.
static int32_t ocs_hal_compl_async_ctx_bad_status(ocs_hal_t *hal, ocs_command_ctx_t *ctx, uint8_t status, uint8_t additional_status)
Sends a bad status to the caller when an asynchronous message fails.
static uint32_t sli_is_dif_capable(sli4_t *sli4)
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
struct ocs_hal_io_param_t::@11 ini_tmf
uint8_t data_sequence_in_order
int32_t sli_cmd_iscsi_cleanup_v1(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint16_t ulp_no, uint16_t hdrq_id, uint16_t dataq_id)
write a COMMON_ISCSI_CLEANUP (version 1) command
static void ocs_list_add_tail(ocs_list_t *list, void *item)
Add an item to the tail of the list.
void ocs_hal_io_free(ocs_hal_t *hal, ocs_hal_io_t *io)
Free a previously allocated HAL IO object.
ocs_hal_rtn_e ocs_hal_portal_gateway_get(ocs_hal_t *hal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
Retrieves the default gateway on an interface.
static void ocs_node_lock_free(ocs_node_t *node)
uint32_t auto_incr_ref_tag
ocs_hal_dif_oper_e dif_oper
int32_t(* cb)(struct ocs_hal_s *, int32_t, struct ocs_command_ctx_s *)
This structure is used to track the SLI4 queues.
static void ocs_hal_io_check_quarantine_list(ocs_hal_t *hal, uint32_t *quarantine_cnt, ocs_list_t *quarantine_list)
If there are more than 4 objects on the quarantine list, then free IOs until there are at most 4 left...
#define ocs_list_remove_head(list)
Remove and return an item from the head of the list.
ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a domain object.
static void ocs_list_add_head(ocs_list_t *list, void *item)
Add an item to the head of the list.
structure wrapping an IP address together with it's type.
int32_t sli_cmd_common_set_active_profile(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t fd, uint32_t active_profile_id)
Write a COMMON_COMMON_SET_ACTIVE_PROFILE command.
void cxn_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
connection callback function prototype.
static void ocs_node_lock(ocs_node_t *node)
uint32_t rq_buf_cnts[OCS_HAL_RQ_BUFFER_TYPE_MAX]
#define ISCSI_CMD_DATA_OUT
uint32_t buffer_address_low
#define SLI4_SGE_TYPE_DATA
static void ocs_hal_rx_free(ocs_hal_t *hal)
Free the RQ data buffers.
ocs_hal_dif_info_t * dif_info
ocs_hal_rtn_e ocs_hal_portal_listen_stop(ocs_hal_t *hal, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port, portal_cb_t portal_cb, void *ul_arg)
Stops listening on a TCP port.
defines a structure to contain the fields specific to an initiator IO completion. ...
int32_t sli_cmd_iscsi_ini_invalidate_connection(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint16_t cid, uint8_t sendRst)
write a ISCSI_INI_INVALIDATE_CONNECTION command
ocs_hal_workaround_t workaround
int32_t sli_cq_parse(sli4_t *sli4, sli4_queue_t *cq, uint8_t *cqe, sli4_qentry_fields_t *fields)
Parse a CQ entry to retrieve event type and associated queue.
ocs_hal_rtn_e ocs_hal_cxn_get_info(ocs_hal_t *hal, ocs_cxn_t *cxn, cxn_cb_t cxn_cb, void *ul_arg)
Retrieves information about an incoming context.
static int32_t ocs_hal_cxn_invalid_process(ocs_hal_t *hal, sli4_qentry_fields_cnxinv_t *cxn_invalid)
Process an Connection invalid completion entry.
static void * ocs_list_next(ocs_list_t *list, void *item)
Get the next item on the list.
uint8_t additional_status
struct ocs_hal_t::@21 args
ocs_hal_rtn_e ocs_hal_portal_isns_discover(ocs_hal_t *hal, ocs_hal_portal_t portal, portal_cb_t portal_cb, void *ul_arg)
Discovers iSNS servers via DHCP.
void(* ocs_hal_fw_cb_t)(int32_t status, uint32_t bytes_written, void *arg)
void sli_queue_iscsi_cleanup(void *hal, sli4_t *sli4, sli4_queue_t *q)
Moves any WQE entries from the busy back to the free list when a connection is uploaded.
ocs_list_t rq_list_free[OCS_HAL_MAX_NUM_RQ]
int32_t sli_queue_iscsi_tcp_ack(sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
Processes a TCP ACK completion.
uint8_t error_recovery_level
static char * sli_get_ipl_name(sli4_t *sli4)
int32_t _sli_queue_poke(sli4_t *sli4, sli4_queue_t *q, uint32_t index, uint8_t *entry)
#define OCS_HAL_MAX_ABORT_IOS
uint8_t additional_status
struct ocs_hal_io_param_t::@13 tgt_read
static void ocs_node_unlock(ocs_node_t *node)
sli4_qentry_fields_dmsg_t dmsg
#define OCS_HAL_RQ_NUM_HDR
Defines the number of the RQ buffers for each RQ.
uint32_t tcmd_thread_id(void)
Defines the iSCSI data-out PDU header.
int32_t sli_queue_reset(sli4_t *sli4, sli4_queue_t *q)
Zero all queue entries and reset the indexes.
ocs_hal_rtn_e ocs_hal_portal_get_route_table(ocs_hal_t *hal, portal_cb_t portal_cb, void *ul_arg)
Read routing table.
This structure contains the fields in a DPDU completion.
uint8_t cmd[SLI4_BMBX_SIZE]
static void ocs_domain_lock(ocs_domain_t *domain)
ocs_hal_rtn_e ocs_hal_set_port_protocol(ocs_hal_t *hal, uint32_t pci_func, ocs_hal_port_protocol_e new_protocol, mgmt_cb_t cb, void *ul_arg)
Set the port protocol.
ocs_hal_ip_address_t gateway
ocs_hal_unsol_cb_t unsolicited
static int32_t ocs_hal_cq_find(ocs_hal_t *, uint16_t)
Find the CQ structure given the CQ_ID.
uint32_t buffer_address_high
int32_t sli_queue_alloc(sli4_t *sli4, uint32_t qtype, sli4_queue_t *q, uint32_t n_entries, sli4_queue_t *assoc, uint16_t ulp)
Allocate a queue.
int32_t sli_cmd_iscsi_tgt_stop_esi_listen(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_STOP_ESI_LISTEN command
uint32_t buffer_address_high
int32_t ocs_hal_async_call(ocs_hal_t *hal, ocs_hal_async_cb_t callback, void *arg)
Make an async callback using NOP mailbox command.
ocs_hal_rtn_e ocs_hal_portal_set_route_table(ocs_hal_t *hal, ocs_hal_ip_address_subnet_t *hal_ipsub, ocs_hal_ip_address_t *hal_gateway, int32_t add, portal_cb_t portal_cb, void *ul_arg)
Add/Remove an entry to routing table.
int32_t sli_bmbx_command(sli4_t *sli4)
Submit a command to the bootstrap mailbox and check the status.
ocs_hal_cxn_event_e event
ocs_hal_linkcfg_e linkcfg
static ocs_hal_rtn_e ocs_hal_setup_io(ocs_hal_t *)
Initialize the pool of HAL IO objects.
int32_t sli_cmd_iscsi_tgt_offload_connection_v0(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl, uint32_t tcp_window_size, uint16_t ulp_no, uint16_t wq_id, uint16_t cq_id, uint8_t hdrq_id, uint8_t dataq_id, uint8_t nrs, ocs_hal_target_login_options_t *lgn_options)
write a ISCSI_TGT_OFFLOAD_CONNECTION command (version 0)
int32_t sli_cmd_common_set_be_configuration_and_resources(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint8_t *mac_addr)
Write a COMMON_COMMON_SET_BE_CONFIGURATION_AND_RESOURCES command.
int32_t ocs_hal_get_port_protocol(ocs_hal_t *hal, uint32_t pci_func, mgmt_cb_t cb, void *ul_arg)
Get the current port protocol.
ocs_hal_rtn_e ocs_hal_setup(ocs_hal_t *hal, ocs_os_handle_t os, sli4_port_type_e port_type)
Set up the Hardware Abstraction Layer module.
uint32_t sli_queue_iscsi_free_cnt(sli4_t *sli4, sli4_queue_t *q)
Return the number of free WRB entries.
int32_t sli_cmd_common_get_profile_list(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t start_profile_index, ocs_dma_t *dma)
Write a COMMON_COMMON_GET_PROFILE_LIST command.
int32_t sli_callback(sli4_t *sli4, sli4_callback_e which, void *func, void *arg)
Register a callback for the given event.
uint16_t num_sges_per_icd
static ocs_hal_sgl_info_t * ocs_hal_sgl_info_alloc(ocs_hal_t *hal)
Allocate a HAL SGL Chaining object.
int32_t io_cb_t(struct ocs_hal_io_s *io, ocs_cxn_t *cxn, int32_t status, ocs_ini_cmpl_fields_t *ini_fields, void *ul_arg)
IO Completion function prototype.
struct ocs_hal_t::@19 config
Scatter-Gather Entry (SGE)
void portal_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
Portal callback function prototype.
static void ocs_hal_cxn_cleanup(ocs_list_t *list)
Free the connection tracking structures.
static int32_t ocs_hal_get_port_profile_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of get_port_profile for a user request.
ocs_hal_ip_type_e sli_iscsi_conv_sli4_ip_addr_type(uint8_t ip_type)
Converts the SLI4 IP address type field to the HAL equivalent value.
static int32_t ocs_hal_cb_link(void *, void *)
Callback function for SLI link events.
static uint32_t sli_get_if_type(sli4_t *sli4)
ocs_hal_rtn_e ocs_hal_rxbuffer(ocs_hal_t *hal, ocs_hal_rq_buffer_t *header, ocs_hal_rq_buffer_t *payload)
Add a receive buffer pair to the Receive Queue.
#define SLI4_SGE_TYPE_SKIP
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
static int32_t ocs_hal_set_port_protocol_cb1(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of set_port_profile for a user request.
#define SLI4_PORT_TYPE_FCOE
static int32_t ocs_hal_data_digest_process(ocs_hal_t *hal, sli4_qentry_fields_data_digest_t *data_digest)
Process an data digest completion entry.
int32_t sli_cmd_iscsi_common_get_route_table(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma)
write a COMMON_ISCSI_NTWK_GET_ROUTE_TABLE command
Generic Command Request header.
void sli_interrupt_set(sli4_t *sli, uint8_t enable)
ocs_hal_cxn_invalid_t cxn_invalid
#define ocs_list_foreach(list, item)
Iterate a linked list.
static void ocs_hal_ctx_cleanup(ocs_hal_t *hal)
Free the command contents.
static uint32_t ocs_hal_config_id_from_linkcfg(ocs_hal_linkcfg_e linkcfg)
Helper function for getting a Skyhawk link config ID from the HAL linkcfg enum.
struct sli_wqe_handlers * wqe_handlers
Generic Command Response header.
sli4_route_table_entry_t entry[SLI4_ISCSI_ROUTE_TABLE_ENTRIES_MAX]
void mgmt_cb_t(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
management callback function prototype.
ocs_hal_dif_blk_size_e blk_size
void * sli_queue_iscsi_wqe_complete(sli4_t *sli4, sli4_queue_t *q, uint8_t wqe_index)
Processes a solicited IO completion. Moves the WRB to the free list.
uint32_t io_ini_read_quarantine_cnt
static int32_t ocs_hal_set_port_protocol_cb2(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of set_port_profile for a user request.
int32_t sli_cmd_common_set_reconfig_link_id(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_dma_t *dma, uint32_t fd, uint32_t active_link_config_id)
Write a COMMON_COMMON_SET_RECONFIG_LINK_ID command.
ocs_atomic_t io_alloc_failed_count
int32_t sli_cmd_iscsi_tgt_start_listen_server(sli4_t *sli4, void *buf, size_t size, uint64_t tag, ocs_hal_ip_address_t *ipaddr, uint32_t tcp_port)
write a ISCSI_TGT_START_LISTEN_SERVER command
uint32_t disable_app_ref_ffff
#define SLI4_OPC_ISCSI_NTWK_CONFIGURE_STATELESS_IP_ADDR
int32_t _sli_queue_write(sli4_t *sli4, sli4_queue_t *q, uint8_t *entry)
Write an entry to the queue object.
static int32_t ocs_hal_tx_dif_error_process(ocs_hal_t *hal, sli4_qentry_fields_tx_dif_error_t *dif_err)
Process an transmit DIF error completion entry.
static int32_t ocs_hal_get_profile_list_cb(ocs_hal_t *hal, int32_t status, ocs_command_ctx_t *ctx)
Called for the completion of get_profile_list for a user request.
ocs_hal_dhcp_state_t
enum identifying the DHCP states.
static int32_t ocs_hal_cq_process(ocs_hal_t *, sli4_queue_t *)
Process entries on the give completion queue.
int32_t sli_init(sli4_t *sli4)
ocs_hal_rq_buffer_t * rq_buf
This structure contains the fields in a I_SOL completion.
ocs_hal_tgt_data_digest_t tgt_digest
#define SLI4_ISCSI_INVALIDATE_CMDS_STATUS_SUCCESS
ocs_hal_rtn_e ocs_hal_portal_create(ocs_hal_t *hal, unsigned int vlan_tag, portal_cb_t portal_cb, void *ul_arg)
Create a new VLAN interface handle.
ocs_hal_rtn_e ocs_hal_portal_set_mtu(ocs_hal_t *hal, uint8_t is_jumbo, portal_cb_t portal_cb, void *ul_arg)
Enable Jumbo frame support on the portal.
static int32_t ocs_hal_stateless_async_event(ocs_hal_t *hal, sli4_stateless_op_cmpl_event_t *event, uint8_t isv4)
Processes the asynchronous stateless completion message.
ocs_session_login_options_t session_options
int32_t sli_cmd_iscsi_common_iface_create(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t vlan)
write a COMMON_ISCSI_NTWK_IFACE_CREATE command
static void ocs_domain_unlock(ocs_domain_t *domain)
static int32_t ocs_hal_command_cancel(ocs_hal_t *hal)
This structure contains the fields in a T_SOL completion.
ocs_hal_rtn_e ocs_hal_firmware_write(ocs_hal_t *hal, ocs_dma_t *dma, uint32_t size, uint32_t offset, int last, ocs_hal_fw_cb_t cb, void *arg)
Write a portion of a firmware image to the device.
int32_t sli_cmd_iscsi_tgt_connection_reject(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t conn_hdl)
write a ISCSI_TGT_CONNECTION_REJECT command
static int32_t ocs_hal_rq_put(ocs_hal_t *hal, ocs_hal_rq_buffer_t *buffer)
Posts an RX buffer to a queue and update the verification structures.
#define HAL_BHS_ALLOC_SIZE
This structure contains the fields in a CMNDINV completion.
ocs_hal_rtn_e ocs_hal_portal_ip_get(ocs_hal_t *hal, ocs_hal_portal_t portal, ocs_hal_ip_type_e ip_type, portal_cb_t portal_cb, void *ul_arg)
Retrieves the IP addresses on an interface.
ocs_hal_rtn_e ocs_hal_cxn_upload(ocs_hal_t *hal, ocs_cxn_t *cxn, uint8_t graceful, cxn_cb_t cxn_cb, void *ul_arg)
uploads an incoming connection on a target.
ocs_hal_portal_t ocs_hal_portal_get_default(ocs_hal_t *hal)
Return the default portal.
void ocs_tgt_cxn_invalidate(ocs_cxn_t *cxn)
#define OCS_HAL_MAX_PROFILES
int32_t sli_cmd_iscsi_common_release_stateless_ip_addr(sli4_t *sli4, void *buf, size_t size, uint64_t tag, uint32_t iface, uint8_t isv4)
write a COMMON_ISCSI_NTWK_RELEASE_STATELESS_IP_ADDR command