147 #define IDLE_TIMER_MS (30 * 1000)
159 #if defined(OCS_INCLUDE_DEBUG)
160 static void ocs_iscsi_dump_active_ios(
ocs_iscsi_t *iscsi, ocs_cxn_t *cxn);
179 value = ocs_atomic_add_return(&iscsi->
ctx[index].
in_use, 1);
181 rc = &iscsi->
ctx[index];
183 (void)ocs_atomic_sub_return(&iscsi->
ctx[index].
in_use, 1);
210 while (timeout_usec > 0) {
213 OCS_OS_MAX_ISR_TIME_MSEC);
215 delay = MIN(timeout_usec, 1000);
216 rc = ocs_sem_p(&iscsi->
ctx[index].
sem, delay);
222 timeout_usec -= delay;
225 rc = ocs_sem_p(&iscsi->
ctx[index].
sem, timeout_usec);
240 (void)ocs_atomic_sub_return(&iscsi->
ctx[index].
in_use, 1);
255 int in_use = ocs_atomic_read(&ctx->
in_use);
260 ocs_sem_v(&ctx->
sem);
280 ctx = &iscsi->
ctx[index];
281 in_use = ocs_atomic_read(&ctx->
in_use);
468 ocs_snprintf(buffer, size,
"%d.%d.%d.%d",
479 for (i = 0; i < 15; i += 2) {
480 if (address[i] != 0 || address[i + 1] != 0) {
481 ocs_snprintf(&buffer[pos],
484 address[i], address[i + 1]);
515 bool have_digits = FALSE;
516 uint32_t src_index = 0;
517 uint32_t dest_index = 0;
518 uint32_t num_groups = 0;
524 while ((ch = src[src_index]) !=
'\0')
526 if (ch >=
'0' && ch <=
'9')
528 uint32_t new_val = ((ip->
ip_address[dest_index] * 10) +
531 if (have_digits && new_val == 0) {
537 ip->
ip_address[dest_index] = (uint8_t)new_val;
540 if (++num_groups > 4) {
546 else if (ch ==
'.' && have_digits)
548 if (num_groups == 4) {
558 if (num_groups < 4) {
576 uint32_t src_index = 0;
577 uint32_t dest_index = 0;
578 bool have_digits = FALSE;
590 if (src[src_index] ==
':') {
592 if (src[src_index] !=
':') {
597 curtok = &src[src_index];
600 while ((ch = src[src_index]) !=
'\0')
605 if (ch >=
'0' && ch <=
'9'){
607 }
else if (ch >=
'A' && ch <=
'F') {
608 digit = 10 + (ch -
'A');
609 }
else if (ch >=
'a' && ch <=
'f') {
610 digit = 10 + (ch -
'a');
624 curtok = &src[src_index];
632 else if (src[src_index] ==
'\0') {
636 if (dest_index > 16) {
639 ip->
ip_address[dest_index++] = (val >> 8) & 0xff;
646 if (ch ==
'.' && ((dest_index + 4) <= 16) &&
658 if (dest_index + 2 > 16) {
661 ip->
ip_address[dest_index++] = (val >> 8) & 0xff;
671 uint32_t n = (uint32_t)(&ip->
ip_address[dest_index] - colonp);
674 if (dest_index == 16) {
678 for (i = 1; i <= n; i++)
681 colonp[n - i] =
'\0';
685 if (dest_index != 16) {
713 ocs_snprintf(buffer, size,
"%02x:%02x:%02x:%02x:%02x:%02x",
714 address[0], address[1],
715 address[2], address[3],
716 address[4], address[5]);
751 if ((ocs_strlen(src) != 12) && (ocs_strlen(src) != 17)) {
757 for (byte=0; byte<6; byte++) {
758 src_byte[0] = *src_p++;
759 src_byte[1] = *src_p++;
761 value = ocs_strtoul(src_byte, NULL, 16);
762 *dest_p++ = (uint8_t)value;
763 if ((*src_p ==
':') || (*src_p ==
'-')) {
784 ocs_t *
ocs = cxn->ocs;
785 ocs_session_t *session = cxn->session;
789 if (session != NULL && session->is_discovery_session) {
791 ocs_log_test(ocs,
"Error on discovery connection %s, closing\n",
795 ocs_log_debug(ocs,
"Request logout for %s\n", cxn->display_name);
805 ocs_log_debug(ocs,
"state %d do not request logout for %s\n",
806 cxn->cxn_state, cxn->display_name);
821 ocs_t *
ocs = iscsi->
os;
822 ocs_cxn_t *cxn, *cxn_next;
825 uint32_t uerr_mask_lo;
826 uint32_t uerr_mask_hi;
827 ocs_sli_port_t *sport;
838 (((uerr_lo & ~uerr_mask_lo) != 0) || ((uerr_hi & ~uerr_mask_hi) != 0))) {
840 ocs_log_crit(iscsi->
os,
"Error: uerr_hi: 0x%08x (0x%08x) uerr_lo: 0x%08x (0x%08x)\n",
841 uerr_hi, uerr_mask_hi, uerr_lo, uerr_mask_lo);
842 #if defined(OCS_INCLUDE_DEBUG)
847 ocs_iscsi_dump_active_ios(iscsi, cxn);
862 if (cxn->no_idle_timer) {
866 if (cxn->idle_count > 4 &&
869 ocs_log_debug(iscsi->
os,
"killing idle connection%s\n", cxn->display_name);
878 if (cxn->is_ini_cxn) {
879 if (cxn->idle_count == 3) {
887 ocs_log_test(iscsi->
os,
"sending nop-out failed\n");
893 }
else if (cxn->idle_count == 4) {
898 (1 << 31) | cxn->wq_index,
901 ocs_log_test(iscsi->
os,
"sending nop-in failed\n");
952 int in_use = ocs_atomic_read(&ctx->
in_use);
960 if (status == 0 && isns_servers != NULL) {
961 for (indx = 0; indx < 8; indx++) {
962 if (isns_servers[indx].ip_type != 0) {
964 &isns_servers[indx]);
967 if (ctx->
num_ips == ARRAY_SIZE(ctx->
ip) - 1) {
992 int in_use = ocs_atomic_read(&ctx->
in_use);
993 uint16_t *word = params;
1016 if (status == 0 && word != NULL) {
1047 ocs_log_err(iscsi->
os,
"context is busy\n");
1057 ocs_log_test(iscsi->
os,
"failed Starting ESI Listen\n");
1065 ocs_log_debug(iscsi->
os,
"starting ESI listen status 0x%x ext status 0x%x\n",
1097 ocs_log_err(iscsi->
os,
"context is busy\n");
1107 ocs_log_test(iscsi->
os,
"failed Stopping ESI Listen\n");
1115 ocs_log_test(iscsi->
os,
"stopping ESI listen status 0x%x ext status 0x%x\n",
1139 uint32_t max_entries,
1149 ocs_log_err(iscsi->
os,
"context is busy\n");
1158 ocs_log_test(iscsi->
os,
"iSNS Discover failed\n");
1166 *num_ips = MIN(ctx->
num_ips, max_entries);
1167 ocs_memcpy(ip, ctx->
ip,
1171 ocs_log_test(iscsi->
os,
"iSNS Discover status 0x%x ext status 0x%x\n",
1199 void *buffer, uint32_t *pkt_len, uint32_t buff_len)
1208 ocs_log_err(iscsi->
os,
"context is busy\n");
1223 ocs_log_test(iscsi->
os,
"iSNS Send failed\n");
1233 ocs_log_test(iscsi->
os,
"iSNS Send status 0x%x ext status 0x%x\n",
1255 uint32_t ext_status,
1265 for (i=0; i < ctx->
num_ips; i++) {
1289 ocs_log_err(iscsi->
os,
"context is busy\n");
1297 ocs_log_test(iscsi->
os,
"failed setting MAC address\n");
1305 ocs_log_test(iscsi->
os,
"setting MAC address status 0x%x ext status 0x%x\n",
1336 ocs_t *
ocs = iscsi->
os;
1337 #if defined(OCS_INCLUDE_RAMD)
1341 ocs_log_debug(ocs,
"Module parameters:\n");
1342 ocs_log_debug(ocs,
" Initiator=%d\n", ocs->enable_ini);
1343 ocs_log_debug(ocs,
" Target=%d\n", ocs->enable_tgt);
1344 ocs_log_debug(ocs,
" ctrlmask=%d\n", ocs->ctrlmask);
1345 ocs_log_debug(ocs,
" loglevel=%d\n",
loglevel);
1346 ocs_log_debug(ocs,
" enable_sgl_chaining=%d\n", ocs->enable_sgl_chaining);
1347 ocs_log_debug(ocs,
" enable_immediate_data=%d\n", ocs->enable_immediate_data);
1348 ocs_log_debug(ocs,
" enable_hdr_digest=%d\n", ocs->enable_hdr_digest);
1349 ocs_log_debug(ocs,
" enable_data_digest=%d\n", ocs->enable_data_digest);
1350 ocs_log_debug(ocs,
" enable_jumbo_frame=%d\n", ocs->enable_jumbo_frame);
1351 ocs_log_debug(ocs,
" max_sge_size=%d\n", ocs->max_sge_size);
1352 ocs_log_debug(ocs,
" post_sgl_config=%d\n", ocs->post_sgl_config);
1354 #if defined(OCS_INCLUDE_RAMD)
1356 ocs_log_debug(ocs,
" ramdisc_blocksize=%s\n", buffer);
1358 ocs_log_debug(ocs,
" ramdisc_size=%s\n", buffer);
1360 ocs_log_debug(ocs,
" p_type=%s\n", buffer);
1362 ocs_log_debug(ocs,
" num_luns=%s\n", buffer);
1365 ocs_log_debug(ocs,
" num_scsi_ios=%d\n", ocs->num_scsi_ios);
1366 ocs_log_debug(ocs,
" local_ip=%s\n", ocs->local_ip);
1367 ocs_log_debug(ocs,
" local_subnet=%s\n", ocs->local_subnet);
1368 ocs_log_debug(ocs,
" gateway=%s\n", ocs->gateway);
1369 ocs_log_debug(ocs,
" tcp_window_size=%d\n", ocs->tcp_window_size);
1370 ocs_log_debug(ocs,
" tcp_window_scale=%d\n", ocs->tcp_window_scale);
1371 ocs_log_debug(ocs,
" iqn_prefix=%s\n", ocs->iqn_prefix);
1372 ocs_log_debug(ocs,
" iqn_suffix=%s\n", ocs->iqn_suffix);
1376 #if defined(OCS_INCLUDE_RAMD)
1388 int32_t ocs_iscsi_ramd_configure(ocs_t *
ocs)
1398 for (i=0; i < ocs->num_tgts; i++) {
1402 "%s:%02x%02x%02x%02x%02x%02x:tgt%d.disk%d",
1404 mac[0], mac[1],mac[2],mac[3],mac[4],mac[5],
1405 ocs->instance_index,
1411 ocs->iqn_prefix, ocs->iqn_suffix, i);
1414 "%s:tgt%d.ramdisc%d",
1416 ocs->instance_index,
1419 ocs_log_test(ocs,
"Error adding target name %s\n", tgt_name);
1428 ocs_log_err(ocs,
"Error adding target CHAP credentials\n");
1435 ocs_log_err(ocs,
"Error adding target CHAP credentials\n");
1464 uint32_t num_chutes = 0;
1468 ocs_log_debug(os,
"INI/TGT enabled\n");
1471 ocs_log_debug(os,
"INI enabled\n");
1474 ocs_log_debug(os,
"TGT enabled\n");
1478 ocs_log_err(os,
"ocs_hal_setup failed\n");
1483 return num_chutes + 1;
1506 uint32_t device_instance) {
1510 uint8_t scsi_domains_added = FALSE;
1511 uint8_t scsi_sports_added = FALSE;
1512 uint8_t hal_sports_added = FALSE;
1513 uint8_t login_initialized = FALSE;
1514 uint8_t cxn_initialized = FALSE;
1515 uint8_t sess_initialized = FALSE;
1516 uint8_t isns_initialized = FALSE;
1517 uint8_t api_initialized = FALSE;
1519 uint32_t ocs_chaining_enable;
1522 uint8_t ini_device_set = FALSE;
1523 uint8_t tgt_device_set = FALSE;
1530 OCS_M_ZERO | OCS_M_NOWAIT);
1532 ocs_log_err(os,
"Failed to allocated ip_info lookup table\n");
1543 OCS_M_ZERO | OCS_M_NOWAIT);
1544 if (iscsi->
ctx == NULL) {
1545 ocs_log_err(os,
"Failed to allocated API contexts structures\n");
1552 ocs_atomic_init(&iscsi->
ctx[i].
in_use, 0);
1553 ocs_sem_init(&iscsi->
ctx[i].
sem, 0,
"api_ctx:%d", i);
1558 ocs_log_warn(iscsi->
os,
"set max_tgts to %d (exceeded Max)",
1563 ocs_log_debug(iscsi->
os,
"set max_tgts to %d", ocs->num_tgts);
1564 if (ocs->num_tgts == 0) {
1565 ocs_log_test(iscsi->
os,
"ERROR: Number of targets is zero");
1603 ocs_log_err(iscsi->
os,
"ocs_iscsi_hal_configure failed\n");
1610 ocs_log_err(iscsi->
os,
"ocs_iscsi_login_initialize failed\n");
1613 login_initialized = TRUE;
1622 if (ocs_chaining_enable) {
1627 if (ocs->io_pool == NULL) {
1632 ocs_list_init(&ocs->io_pending_list, ocs_io_t, io_pending_link);
1633 ocs_atomic_init(&ocs->io_active_count, 0);
1634 ocs_atomic_init(&ocs->io_pending_count, 0);
1635 ocs_atomic_init(&ocs->io_total_free, 0);
1636 ocs_atomic_init(&ocs->io_total_pending, 0);
1637 ocs_atomic_init(&ocs->io_pending_recursing, 0);
1643 ocs_log_err(iscsi->
os,
"ocs_iscsi_api_initialize failed\n");
1645 api_initialized = TRUE;
1646 #if defined(OCS_INCLUDE_RAMD)
1647 if (ocs_iscsi_ramd_configure(ocs)) {
1648 ocs_log_err(iscsi->
os,
"ocs_iscsi_ramd_configure failed\n");
1657 ocs_log_err(iscsi->
os,
"ocs_cxn_initialize failed\n");
1660 cxn_initialized = TRUE;
1666 ocs_log_err(iscsi->
os,
"ocs_session_initialize failed\n");
1669 sess_initialized = TRUE;
1675 ocs_log_err(iscsi->
os,
"ocs_isns_initialize failed\n");
1678 isns_initialized = TRUE;
1684 if (ocs->domain == NULL) {
1685 ocs_log_err(iscsi->
os,
"ocs_domain_alloc failed\n");
1688 ocs->domain->sport_instance_count = 0;
1689 ocs->domain->node_instance_count = 0;
1695 ocs_log_err(iscsi->
os,
"adding domain to HAL failed\n");
1703 for (i=0; i < iscsi->
num_tgts; i++) {
1705 ocs->sport[i].domain = ocs->domain;
1706 ocs->sport[i].ocs =
ocs;
1707 ocs->sport[i].index = i;
1711 ocs_memcpy(ocs->sport[i].mac, mac, ARRAY_SIZE(ocs->sport[i].mac));
1712 ocs_snprintf(ocs->sport[i].mac_str,
1713 sizeof(ocs->sport[i].mac_str),
1714 "%02x%02x%02x%02x%02x%02x",
1715 mac[0], mac[1], mac[2], mac[3], mac[4], mac[5]);
1722 ocs->sport[i].created = TRUE;
1725 hal_sports_added = TRUE;
1732 ocs_log_err(iscsi->
os,
"Unable to allocate iSCSI transport\n");
1738 ocs->model = ocs_pci_model(ocs->pci_vendor, ocs->pci_device);
1745 ini_device_set = TRUE;
1748 scsi_domains_added = TRUE;
1749 ocs->sport[0].tgt_id = 0;
1752 scsi_sports_added = TRUE;
1763 tgt_device_set = TRUE;
1766 for (i=0; i < iscsi->
num_tgts; i++) {
1768 scsi_domains_added = TRUE;
1769 ocs->sport[i].tgt_id = i;
1772 scsi_sports_added = TRUE;
1782 ocs_log_err(iscsi->
os,
"ocs_hal_init failed\n");
1800 if (ocs->io_pool != NULL) {
1802 ocs->io_pool = NULL;
1805 if (scsi_domains_added) {
1814 for (i=0; i < iscsi->
num_tgts; i++) {
1815 if (scsi_sports_added) {
1823 if (hal_sports_added) {
1826 ocs->sport[i].created = FALSE;
1831 if (tgt_device_set) {
1835 if (ini_device_set) {
1839 if (login_initialized) {
1843 if (ocs->domain != NULL) {
1848 if (cxn_initialized) {
1852 if (sess_initialized) {
1856 if (api_initialized) {
1860 if (isns_initialized) {
1870 ocs_free(os, iscsi->
ctx,
1871 sizeof(&iscsi->
ctx) * OCS_CNFG_CTX_MAX);
1881 ocs_log_debug(iscsi->
os,
"Failed to initialize iSCSI\n");
1922 ocs_t *ocs = iscsi->
os;
1928 ocs_log_debug(iscsi->
os,
"shutting down device\n");
1945 ocs_log_err(iscsi->
os,
"ocs_iscsi_api_shutdown() failed\n");
1954 for (i=0; i < iscsi->
num_tgts; i++) {
1987 if (ocs->io_pool != NULL) {
1989 ocs->io_pool = NULL;
1993 ocs_free(ocs, iscsi->
ctx,
2016 ocs_t *ocs = iscsi->
os;
2018 uint32_t sgl_chain_capable;
2024 ocs_log_err(iscsi->
os,
"Failed setting link CB\n");
2032 ocs_log_err(iscsi->
os,
"Failed setting conection CB\n");
2041 ocs_log_err(iscsi->
os,
"Failed setting unsolicited CB\n");
2049 ocs_log_err(iscsi->
os,
"Failed getting PCI function\n");
2057 ocs_log_err(iscsi->
os,
"Failed getting number of IOs\n");
2065 ocs_log_err(iscsi->
os,
"Failed getting number of connections\n");
2071 uint32_t dif_capable;
2072 uint8_t dif_separate = 0;
2078 dif_separate = ocs_strtoul(prop_buf, 0, 0);
2084 ocs_log_test(iscsi->
os,
"Failed setting the DIF MODE\n");
2090 ocs_log_debug(iscsi->
os,
"Driver configured for %d IOs\n", iscsi->
num_ios);
2091 ocs_log_debug(iscsi->
os,
"Driver configured for %d connections\n", iscsi->
num_cxns);
2095 if (sgl_chain_capable) {
2098 (ocs->enable_sgl_chaining ? 1 : 0)))) {
2099 ocs_log_err(iscsi->
os,
"Failed setting chaining SGL Enable\n");
2105 if (!rc && ocs->post_sgl_config != 0) {
2106 uint32_t num_sges = 0;
2107 uint32_t post_ver = 0;
2109 switch (ocs->post_sgl_config) {
2131 ocs_log_err(iscsi->
os,
"Invalid Post SGL configuration value of %d\n", ocs->post_sgl_config);
2139 ocs_log_err(iscsi->
os,
"Failed setting number of SGEs\n");
2147 ocs_log_err(iscsi->
os,
"Failed setting Post_SGL version\n");
2155 ocs->hal_war_version))) {
2156 ocs_log_err(iscsi->
os,
"Failed setting hal_war_version\n");
2181 ocs_log_err(iscsi->
os,
"context is busy\n");
2189 ocs_log_test(iscsi->
os,
"failed setting TCP MTU size\n");
2197 ocs_log_test(iscsi->
os,
"setting MTU Size status 0x%x ext status 0x%x\n",
2218 ocs_free(iscsi->
os, ctgt,
sizeof(*ctgt));
2235 uint32_t ext_status,
2243 if (status == 0 && ext_status == 0) {
2247 for (inx = 0; inx < route_table->
entry_count; inx++) {
2284 int32_t timeout = 4 * 1000000;
2285 int32_t rc = -EFAULT;
2289 ocs_log_err(iscsi->
os,
"context is busy\n");
2296 &hal_ipsub, &hal_gateway, FALSE,
2300 ocs_log_err(iscsi->
os,
"Submitting route table add entry failed\n");
2309 ocs_log_err(iscsi->
os,
2310 "Route table entry add failed status 0x%x ext_stat 0x%x\n",
2336 int32_t timeout = 4 * 1000000;
2337 int32_t rc = -EFAULT;
2341 ocs_log_err(iscsi->
os,
"context is busy\n");
2348 &hal_ipsub, &hal_gateway, TRUE,
2352 ocs_log_err(iscsi->
os,
"Submitting route table add entry failed\n");
2361 ocs_log_err(iscsi->
os,
2362 "Route table entry add failed status 0x%x ext_stat 0x%x\n",
2375 int32_t timeout = 4 * 1000000;
2376 int32_t rc = -EFAULT;
2380 ocs_log_err(iscsi->
os,
"context is busy\n");
2387 ocs_log_err(iscsi->
os,
"Submitting get route table failed\n");
2396 ocs_log_err(iscsi->
os,
2397 "Get route table failed status 0x%0x ext_stat 0x%x\n",
2400 ocs_memcpy(route_table, &ctx->
route_table,
sizeof(*route_table));
2425 int timeout = 4 * 1000000;
2431 OCS_M_ZERO | OCS_M_NOWAIT);
2432 if (ipsub_tbl == NULL) {
2433 ocs_log_err(iscsi->
os,
"failed allocating IP table memory\n");
2438 ocs_log_err(iscsi->
os,
"context is busy\n");
2444 timeout = 6 * 60 * 1000000;
2454 ocs_log_test(iscsi->
os,
"failed adding IP\n");
2470 for(i = 0; i < num_ips; i++) {
2471 if (ipsub_tbl[i].ip_type == ipsub->
ip_type) {
2485 ocs_log_test(iscsi->
os,
"adding IP status 0x%x ext status 0x%x\n",
2494 if (ipsub_tbl != NULL) {
2521 ocs_log_err(iscsi->
os,
"context is busy\n");
2531 ocs_log_test(iscsi->
os,
"Error %d removing IP\n", rc);
2540 ocs_log_test(iscsi->
os,
"Removing IP status 0x%x ext status 0x%x\n",
2544 ocs_log_test(iscsi->
os,
"Timeout Removing IP\n");
2570 uint32_t max_entries,
2581 ocs_log_err(iscsi->
os,
"context is busy\n");
2590 ocs_log_test(iscsi->
os,
"failed querying IPs\n");
2597 *num_ips = MIN(ctx->
num_ips, max_entries);
2598 ocs_memcpy(ipsub, ctx->
ipsub,
2602 ocs_log_test(iscsi->
os,
"querying IPs status 0x%x ext status 0x%x\n",
2640 ip_type_str =
"DHCP";
2646 ip_type_str =
"Auto v6";
2649 ip_type_str =
"Invalid";
2660 ip_str,
sizeof(ip_str));
2663 mask_str,
sizeof(mask_str));
2664 ocs_log_debug(ocs,
"Adding %s IP address %s mask %s type %s\n",
2680 ocs_log_warn(ocs,
"IP Table overflow\n");
2708 for (i = 0; i < iscsi->
num_ips; i++) {
2710 if (memcmp(&api_ip->
ip, &ip,
sizeof(ip)) == 0 &&
2711 memcmp(&api_ip->
subnet, &subnet,
sizeof(subnet)) == 0) {
2717 if (found_at != -1) {
2719 for (i=found_at; i<iscsi->
num_ips; i++) {
2722 ocs_memcpy(dst, src,
sizeof(*src));
2751 for (i = 0; i < iscsi->
num_ips; i++) {
2753 if (memcmp(&api_ip->
ip, &ip,
sizeof(ip)) == 0 &&
2754 memcmp(&api_ip->
subnet, &subnet,
sizeof(subnet)) == 0) {
2780 ocs_log_err(iscsi->
os,
"context is busy\n");
2790 ocs_log_test(iscsi->
os,
"failed setting gateway\n");
2798 ocs_log_test(iscsi->
os,
"setting gateway status 0x%x ext status 0x%x\n",
2833 uint16_t *tcp_port, int32_t *listening)
2839 for (i = 0; i < iscsi->
num_ips; i++) {
2841 if (api_ip->
portal == iface_handle) {
2842 ocs_memcpy(ip, &api_ip->
ip,
sizeof(*ip));
2843 ocs_memcpy(subnet, &api_ip->
subnet,
sizeof(*subnet));
2874 ocs_memset(&ip, 0,
sizeof(ip));
2875 ocs_memset(&subnet, 0,
sizeof(subnet));
2877 &tcp_port, &listening);
2879 ocs_log_debug(ocs,
"IP's are not found for iface %d\n",
2885 ocs_log_debug(ocs,
"Found IP %s in iface %d\n", ip_str, iface_handle);
2890 ocs_log_err(ocs,
"Failed to stop listening on IP %s\n",
2894 ocs_log_debug(ocs,
"Stopped listening on IP %s\n",
2902 ocs_log_err(ocs,
"Failed removing IP %s\n", ip_str);
2905 ocs_log_debug(ocs,
"Removed IP %s\n", ip_str);
2926 int32_t rc = -EFAULT;
2930 if (portal->
vlan_id == vlan_id) {
2957 if (portal->
vlan_id == vlan_id) {
2985 OCS_M_ZERO | OCS_M_NOWAIT);
2986 if (portal == NULL) {
2987 ocs_log_err(ocs,
"Failed to allocate memory\n");
2995 ocs_log_debug(ocs,
"Added portal %d and vlan %d to portal_list\n",
3020 ocs_log_debug(ocs,
"Removing portal %d from portal_list\n",
3023 ocs_free(ocs, portal,
sizeof(*portal));
3042 uint32_t arg_out_length)
3046 uint32_t remain = arg_out_length;
3047 char *userbuff = (
char *)arg_out;
3049 uint32_t bytes_to_copy;
3057 snprintf(str,
sizeof(str),
"VLAN id %d\n", portal_info->
vlan_id);
3058 len = ocs_strlen(str);
3059 bytes_to_copy = (len > remain ? remain : len);
3060 if (ocs_copy_to_user(userbuff, str, bytes_to_copy)) {
3064 userbuff += bytes_to_copy;
3065 remain -= bytes_to_copy;
3070 snprintf(str,
sizeof(str),
"VLAN list is empty\n");
3071 len = ocs_strlen(str);
3072 bytes_to_copy = (len > remain ? remain : len);
3073 if (ocs_copy_to_user(userbuff, str, bytes_to_copy)) {
3076 userbuff += bytes_to_copy;
3077 remain -= bytes_to_copy;
3086 if (!ocs_copy_to_user(userbuff,
"\0", 1)) {
3105 uint32_t ext_status,
3135 ocs_log_err(ocs,
"VLAN id %d is already exists\n");
3141 ocs_log_err(iscsi->
os,
"context is busy\n");
3148 ocs_log_err(iscsi->
os,
"failed creating portal\n");
3155 *portal = ctx->
iface;
3158 ocs_log_err(iscsi->
os,
"creating portal status 0x%x ext status 0x%x\n",
3191 ocs_log_err(iscsi->
os,
"context is busy\n");
3198 ocs_log_test(iscsi->
os,
"failed creating portal\n");
3206 ocs_log_err(iscsi->
os,
"deleting portal status 0x%x ext status 0x%x\n",
3237 ocs_log_err(iscsi->
os,
"context is busy\n");
3247 ocs_log_test(iscsi->
os,
"failed Starting Listen\n");
3255 ocs_log_test(iscsi->
os,
"starting listen status 0x%x ext status 0x%x\n",
3285 ocs_log_err(iscsi->
os,
"context is busy\n");
3295 ocs_log_test(iscsi->
os,
"failed Stopping Listen\n");
3303 ocs_log_test(iscsi->
os,
"stopping listen status 0x%x ext status 0x%x\n",
3388 ocs_t *ocs = iscsi->
os;
3392 ocs_log_debug(iscsi->
os,
"link is %s\n", (isLinkUp ?
"UP" :
"DOWN"));
3407 #if defined(OCS_INCLUDE_DEBUG)
3418 ocs_cxn_t *cxn = io->node;
3423 ocs_log_debug(iscsi->
os,
"%s ICD %d, ITT 0x%x, dsl=0x%x, wire_xfer_size=0x%x, wire_offset=0x%x, sge_offset=0x%x\n",
3424 (io->is_read ?
"Read" :
"Write"),
3425 (io->hio != NULL ? io->hio->icd : -1),
3428 io->scsi_wire_xfer_size,
3429 io->scsi_wire_offset,
3430 (io->hio != NULL ? io->hio->sge_offset : 0xFFFFFFFF));
3443 while (ctx != NULL) {
3444 if (ctx->
io != NULL &&
3448 ocs_snprintf(dmphdr,
sizeof(dmphdr),
"Io WQE Index %d", ctx->
wrb_index);
3454 ocs_unlock(&q->
lock);
3473 ocs_iscsi_dump_io(iscsi, io);
3497 ocs_log_debug(iscsi->
os,
"Cxn %p with wq_id 0x%x conn_hdl 0x%x for %s Invalidated in FW (0x%x)\n",
3503 #if defined(OCS_INCLUDE_DEBUG)
3504 ocs_iscsi_dump_active_ios(iscsi, cxn);
3521 if (!cxn->is_ini_cxn) {
3522 ocs_log_test(iscsi->
os,
"CQE with code %d - send async logout for %s\n",
3523 code, cxn->display_name);
3526 ocs_log_test(iscsi->
os,
"Request logout status %d for %s\n",
3527 rc, cxn->display_name);
3530 ocs_log_test(iscsi->
os,
"CQE with code %d on ini cxn %s - close\n",
3531 code, cxn->display_name);
3558 ocs_cxn_t *cxn = tgt_digest->
cxn;
3560 ocs_io_t *io = tgt_digest->
arg;
3564 ocs_log_debug(iscsi->
os,
"data digest error on cid %d, icd %d\n",
3566 (hio == NULL ? -1 : hio->
icd));
3580 hdr.
itt = ocs_htobe32(io->init_task_tag);
3581 hdr.
ttt = ocs_htobe32(hio->
ttt);
3606 switch(cxn_event->
event) {
3623 ocs_log_test(iscsi->
os,
"Unhandled cxn event received %d\n",
3646 uint32_t lun = UINT32_MAX;
3647 uint8_t address_method = -1;
3651 switch (address_method) {
3656 if (0 == bus_identifier) {
3659 ocs_log_test(NULL,
"unsupported bus identifier %#02x (LU %02x %02x %02x %02x ...\n",
3660 bus_identifier, lu[0], lu[1], lu[2], lu[3]);
3671 uint8_t length, extended_address_method;
3673 length = (lu[0] & 0x30) >> 4;
3674 extended_address_method = lu[0] & 0xf;
3676 if ((1 == length) && (2 == extended_address_method)) {
3677 lun = (lu[1] << 16) | (lu[2] << 8) | lu[3];
3679 ocs_log_test(NULL,
"unsupported extended addressing method (length=%#x method=%#x)\n",
3680 length, extended_address_method);
3685 ocs_log_test(NULL,
"unsupported LU address method %#02x\n", address_method);
3712 ocs_t *ocs = iscsi->
os;
3718 uint32_t imm_length;
3722 ocs_log_test(iscsi->
os,
"called with connection state %d",
3733 io->cmd_sn = ocs_be32toh(cmd_hdr->
CmdSN);
3734 io->init_task_tag = ocs_be32toh(cmd_hdr->
itt);
3766 io_trace(io,
"IO started (instance%d)\n", io->instance_index);
3779 io->scsi_mem_xfer_size = imm_length;
3780 io->scsi_mem_offset = imm_length;
3781 io->scsi_wire_xfer_size = imm_length;
3782 io->scsi_wire_offset = imm_length;
3800 ocs_log_test(iscsi->
os,
"No IO object on connection %s, dropping command\n",
3819 uint32_t flags,
void *arg)
3843 ocs_t *ocs = iscsi->
os;
3848 ocs_io_t *abortio = NULL;
3850 uint32_t cmd_sn = ocs_be32toh(tm_hdr->
cmd_sn);
3852 uint32_t refcmdsn = ocs_be32toh(tm_hdr->
ref_cmd_sn);
3856 ocs_log_test(iscsi->
os,
"called with connection state %d",
3864 io->init_task_tag = ocs_be32toh(tm_hdr->
itt);
3869 ocs_log_debug(iscsi->
os,
"TM (instance%d) started for ITT 0x%x, ref ITT 0x%x\n",
3870 io->instance_index, io->init_task_tag, reftag);
3878 if (listio->init_task_tag == reftag &&
3879 (listio->cmd_sn == refcmdsn ||
3880 cmd_sn == refcmdsn)) {
3888 if (abortio == NULL) {
3898 #if defined(OCS_INCLUDE_DEBUG)
3899 ocs_iscsi_dump_io(iscsi, abortio);
3937 ocs_log_test(iscsi->
os,
"No IO object on connection %s, dropping TM\n",
3962 uint32_t itt = ocs_be32toh(tm_hdr->
itt);
3963 ocs_io_t *io = NULL, *tmp_io;
3969 ocs_log_test(iscsi->
os,
"called with connection state %d",
3980 if (tmp_io->hio != NULL &&
3981 tmp_io->hio->itt == itt) {
3992 cxn->idle_count = 0;
3995 if (io->scsi_io_cb) {
4009 cb = io->scsi_io_cb;
4012 io->scsi_io_cb = NULL;
4014 io_trace(io,
"TM IO completed with status 0x%x (flags 0x%x)\n",
4017 cb(io, cb_status, &rsp, flags, io->scsi_io_cb_arg);
4021 ocs_log_test(iscsi->
os,
"IO with ITT was not found 0x%x", itt);
4049 uint8_t *reject_reason)
4092 ocs_log_test(iscsi->
os,
"received unexpected OPCODE 0x%x", bhs->
opcode);
4124 ocs_t *ocs = iscsi->
os;
4131 ocs_log_test(iscsi->
os,
4132 "startup connection rcvd opcode 0x%x instead of login resp, state=%u",
4141 cxn->idle_count = 0;
4159 ocs_log_test(iscsi->
os,
"CID 0x%x failed adding target to initiator server\n",
4162 ocs_log_debug(iscsi->
os,
"ocs_scsi_new_target() success\n");
4187 ocs_log_test(iscsi->
os,
"received unexpected OPCODE 0x%x", bhs->
opcode);
4223 if (cxn->is_ini_cxn) {
4226 return iscsi->
unsol_ini(arg, cxn, hdr, hdr_len, data, data_len, code);
4252 ocs_log_test(iscsi->
os,
"Error processing unsolicited PDU\n");
4253 if (cxn->is_ini_cxn) {
4278 tracker->
pages = NULL;
4298 if (tracker->
pages) {
4299 for (indx = 0; indx < tracker->
num_pages; indx ++)
4301 ocs_dma_free(iscsi->
os, &tracker->
pages[indx]);
4302 ocs_memset(&tracker->
pages[indx], 0,
sizeof(ocs_dma_t));
4304 ocs_free(iscsi->
os, tracker->
pages,
4334 uint32_t object_size,
4336 uint32_t num_objects)
4339 uint32_t padded_size;
4340 uint32_t obj_per_page;
4345 if (alignment == 0 ||
4346 (alignment < object_size &&
4347 (object_size % alignment == 0))) {
4348 padded_size = object_size;
4350 padded_size = object_size + (object_size % alignment);
4352 ocs_log_debug(iscsi->
os,
"alignment %d, object size %d, padded size %d\n",
4353 alignment, object_size, padded_size);
4358 if (obj_per_page == 0) {
4364 num_pages = ((num_objects + (obj_per_page - 1)) / obj_per_page);
4366 tracker->
pages = (ocs_dma_t *)ocs_malloc(iscsi->
os,
sizeof(ocs_dma_t) *
4367 (num_pages + num_objects),
4368 OCS_M_ZERO | OCS_M_NOWAIT);
4369 if (tracker->
pages == NULL) {
4370 ocs_log_err(iscsi->
os,
"memory allocation failed for ocs_dma_t entries\n");
4374 for (indx = 0; indx < num_pages; indx++) {
4375 if (ocs_dma_alloc(iscsi->
os,
4376 &tracker->
pages[indx],
4381 ocs_log_err(iscsi->
os,
4382 "memory allocation failed page %d\n",
4385 for (indx_free = 0; indx_free < indx; indx_free++)
4387 ocs_dma_free(iscsi->
os, &tracker->
pages[indx_free]);
4389 ocs_free(iscsi->
os, tracker->
pages,
sizeof(ocs_dma_t) * num_pages);
4394 ocs_memset(tracker->
pages[indx].virt, 0, alloc_size);
4401 for (indx = 0; indx < num_objects; indx++) {
4402 uint32_t page_index = indx / obj_per_page;
4403 uint32_t mem_offset = ((indx % obj_per_page) * padded_size);
4404 ocs_dma_t *mem = &tracker->
pages[num_pages + indx];
4406 mem->virt = ((uint8_t*)tracker->
pages[page_index].virt) + mem_offset;
4407 mem->phys = tracker->
pages[page_index].phys + mem_offset;
4408 mem->size = object_size;
4430 uint32_t obj_offset)
4432 ocs_dma_t *rval = NULL;
4433 if (obj_offset < tracker->num_objs) {
4452 ocs_log_test(iscsi->
os,
"Failed post RQ buffers - buffers leaked\n");
4459 ocs_sli_port_t *sport;
4462 if (hal->
domain == NULL) {
4467 if (hal->
domain->node_instance_count == 0) {
4471 ocs_log_debug(iscsi->
os,
"Invalidate active connections\n");
4484 ocs_delay_usec(10000);
4487 ocs_log_debug(iscsi->
os,
"Done waiting for connection invalidation\n");
int32_t ocs_scsi_ini_new_sport(ocs_sport_t *sport)
Process creation of a new SPORT.
static ocs_config_ctx_t * ocs_iscsi_ctx_alloc(ocs_iscsi_t *iscsi, ocs_config_ctx_e index)
Allocates an iSCSI API context that provides a synchronous API when using a asynchronous mailbox comm...
structure for storing VLAN id and interface handle together
#define OCS_ISCSI_LOGIN_DEFAULT_TIME_2_WAIT
Stores information needed IP addresses for targets.
static void ocs_iscsi_convert_to_ipsub(ocs_ip_address_subnet_t *ip, ocs_hal_ip_address_subnet_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
Defines the iSCSI command PDU header.
#define ISCSI_RESP_DATAIN
ocs_hal_ip_type_e ip_type
static void ocs_sport_unlock(ocs_sport_t *sport)
#define ISCSI_LUN_ADDR_METHOD_EXTENDED
int32_t ocs_iscsi_remove_ip_from_tbl(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
Remove an IP address from the table.
int32_t ocs_iscsi_send_logout(ocs_cxn_t *cxn, uint8_t immediate, uint8_t reason_code)
Function to send a logout PDU.
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.
ocs_link_state_e
enum identifying the link state.
#define ISCSI_CQE_CODE_RECV_PDU_DSL_ERROR
ocs_iscsi_route_table_entry_t entry[OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX]
static void ocs_iscsi_ctx_general_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback a general API context command.
int32_t ocs_iscsi_tgt_add(ocs_t *ocs, char *name, char *alias)
Adds a target.
int32_t ocs_scsi_recv_tmf(ocs_io_t *tmfio, uint32_t lun, ocs_scsi_tmf_cmd_e cmd, ocs_io_t *abortio, uint32_t flags)
Receive a TMF command IO.
int32_t ocs_scsi_tgt_del_device(ocs_t *ocs)
Tears down the target members of the ocs structure.
static void ocs_iscsi_query_ip_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback for querying IP addresses.
int32_t ocs_iscsi_register_link_state_callback(ocs_t *ocs, ocs_link_state_cb_t cb)
Register to receive link state change notifications.
int32_t ocs_iscsi_isns_esi_listen_start(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Starts an iSNS ESI TCP listen socket.
int32_t ocs_iscsi_recv_login_rsp(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
Function to process a login response PDU.
int32_t ocs_scsi_tgt_new_device(ocs_t *ocs)
Initializes any target fields on the ocs structure.
ocs_io_pool_t * ocs_io_pool_create(ocs_t *ocs, uint32_t num_io, uint32_t num_sgl)
Create a pool of IO objects.
int32_t ocs_get_property(const char *prop_name, char *buffer, uint32_t buffer_len)
#define ISCSI_CQE_CODE_ITT_TTT_WRONG_CXN
int32_t ocs_scsi_ini_new_domain(ocs_domain_t *domain)
Accept new domain notification.
ocs_pdu_process_rtn_e ocs_iscsi_recv_login(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
Function to process a login PDU on a target.
int32_t ocs_iscsi_send_async(ocs_cxn_t *cxn, void *payload, uint32_t payload_len, uint8_t reason, uint64_t lun, uint16_t param1, uint16_t param2, uint16_t param3)
Sends a asynchronous PDU with an optional payload.
#define OCS_SCSI_CMD_HEAD_OF_QUEUE
uint32_t ExpectedDataTransferLength
ocs_pdu_process_rtn_e
iSCSI PDU processing return codes
void ocs_domain_force_free(ocs_domain_t *domain)
Free memory resources of a domain object.
ocs_config_ctx_e
The types of mailbox operations we want to wait for.
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.
void(* ocs_link_state_cb_t)(ocs_t *, ocs_link_state_e)
Template for a function to be called when the link state changes.
uint8_t data_segment_length[3]
ocs_hal_rtn_e ocs_hal_init(ocs_hal_t *hal)
Set up Hardware Abstraction Layer module.
int32_t ocs_iscsi_login_initialize(ocs_iscsi_t *iscsi)
Initialize the login and retry object used within the login module.
void ocs_iscsi_cluster_tgts_free(ocs_iscsi_t *iscsi)
iscsi cluster targets free
int32_t parse_mac_address(const char *src, uint8_t *dest)
Parse a string into a MAC address.
#define ISCSI_LUN_ADDRESS_METHOD_MASK
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)
int32_t ocs_iscsi_mtu_set(ocs_t *ocs, uint8_t is_jumbo)
Sets the TCP MTU size of the iSCSI device.
#define ISCSI_LUN_ADDRESS_METHOD_SHIFT
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.
int32_t ocs_iscsi_find_portal_from_vlan(ocs_t *ocs, uint32_t vlan_id, ocs_hal_portal_t *iface_handle)
Helper function to find respective interface handle of VLAN id.
static int32_t ocs_iscsi_link_event_cb(void *arg, uint8_t isLinkUp)
Function to receive the notification of link events.
#define ISCSI_CQE_CODE_RECV_UNSOL_PDU_ERROR
struct sli4_queue_t::@33::@35 wq
int32_t ocs_iscsi_portal_is_vlan_exists(ocs_t *ocs, uint32_t vlan_id)
Check VLAN for duplicate.
ocs_hal_rtn_e ocs_hal_teardown(ocs_hal_t *hal)
Tear down Hardware Abstraction Layer module.
static ocs_pdu_process_rtn_e ocs_iscsi_recv_tm(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
Function to receive unsolicited task management PDUs.
int32_t ocs_cxn_initialize(ocs_iscsi_t *iscsi)
Initialize the iSCSI connection objects.
static void ocs_iscsi_ctx_post(ocs_config_ctx_t *ctx, int32_t status, uint32_t ext_status)
Updates the status fields and post to the semaphore if it is still in use.
structure wrapping an IP address and subnet together with their type.
static void * ocs_list_get_head(ocs_list_t *list)
Return the first item in the list.
Structure to hold the fields returned on a target data digest error event.
#define OCS_CHAP_MODE_TARGET
#define OCS_IQN_SUFFIX_DEFAULT
#define ISCSI_CQE_CODE_RESIDUAL_UNDERRUN
int32_t ocs_scsi_tgt_new_sport(ocs_sport_t *sport)
Accept a new SLI Port notification.
#define OCS_ISCSI_MAX_LINK_STATE_CALLBACKS
ocs_hal_ip_type_e
enum identifying the types of IP addresses.
static void ocs_iscsi_convert_to_hal_ipsub(ocs_ip_address_subnet_t *ip, ocs_hal_ip_address_subnet_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
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 ISCSI_TASK_REASSIGN
ocs_hal_rtn_e
defines common HAL return statuses.
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.
static void ocs_iscsi_ctx_free(ocs_iscsi_t *iscsi, ocs_config_ctx_e index)
Frees an iSCSI API context that provides a synchronous API when using a asynchronous mailbox command...
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.
Defines the iSCSI task management PDU header.
int32_t ocs_iscsi_portal_find_ip_address(ocs_t *ocs, ocs_hal_portal_t iface_handle, ocs_ip_address_t *ip, ocs_ip_address_t *subnet, uint16_t *tcp_port, int32_t *listening)
Find IP address of interface handle If IP address is found for given interface handle, copy to ip and subnet params.
ocs_iscsi_cluster_tgt_t * ctgt_next
ocs_pdu_process_rtn_e ocs_iscsi_tgt_process_cmd_sn(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code, uint8_t *reject_reason)
Function to process unsolicited PDUs for a target.
void format_mac_address(uint8_t *address, char *buffer, int size)
Format a MAC address into a string.
static void ocs_iscsi_idle_timeout(void *arg)
This function is called to check for idle connections.
int32_t ocs_iscsi_listen_start(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Starts a TCP listen socket.
void ocs_scsi_tgt_del_domain(ocs_domain_t *domain)
Accept a domain lost notification.
static int32_t ocs_iscsi_hal_configure(ocs_iscsi_t *iscsi)
Configure the HAL based on iSCSI compile parameters.
#define CONN_STATE_LOGIN_PROGRESS
void ocs_iscsi_ipsub_combine(ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
Combines an iSCSI IP address and subnet into the combined structure.
ocs_pdu_process_rtn_e ocs_iscsi_recv_text(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t *reject_reason)
Function to process a text PDU.
ocs_hal_ip_address_t subnet
Structure to define what connection event occurred and it's parameters.
void ocs_iscsi_cxn_req_invalidate(ocs_iscsi_t *iscsi)
static void ocs_iscsi_isns_send_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback for the iSNS send.
static int32_t ocs_iscsi_unsolicited_event_cb(void *arg, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code)
Function to receive unsolicited PDUs.
void ocs_hal_cxn_req_invalidate(ocs_list_t *list_cxn)
void ocs_iscsi_login_teardown(ocs_iscsi_t *iscsi)
Releases the login and retry object used within the login module.
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.
ocs_mgmt_functions_t sport_mgmt_functions
int32_t(* ocs_scsi_rsp_io_cb_t)(ocs_io_t *io, ocs_scsi_io_status_e status, ocs_scsi_cmd_resp_t *rsp, uint32_t flags, void *arg)
#define ISCSI_CQE_CODE_RECV_AHS_NOT_SUPPORTED
void ocs_scsi_io_free(ocs_io_t *io)
Free a SCSI IO context.
#define CONN_STATE_NEW_CONN
int32_t ocs_iscsi_send_reject(ocs_cxn_t *cxn, void *hdr, uint32_t hdr_len, uint8_t reason)
Sends a reject PDU for the supplied PDU header.
int32_t ocs_session_initialize(ocs_iscsi_t *iscsi)
Initialize the session management by allocating objects for sessions.
uint32_t ocs_hal_portal_t
#define OCS_SCSI_CMD_DIR_OUT
#define OCS_ISCSI_MAX_ALIAS_SIZE
void ocs_iscsi_convert_to_hal_ip(ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
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
#define ISCSI_ABORT_TASK_SET
uint32_t sli_reg_read(sli4_t *sli, sli4_regname_e reg)
Read the given SLI register.
#define ISCSI_TASK_MGMT_TASK_DOES_NOT_EXIST
void ocs_iscsi_uninitialize(ocs_iscsi_t *iscsi)
Indicate that HAL is not initialized.
#define ISCSI_ORDERED_QUEUE_TAG
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 int32_t ocs_iscsi_cxn_event_data_digest(ocs_iscsi_t *iscsi, ocs_hal_tgt_data_digest_t *tgt_digest)
Function to process a data digest error.
void ocs_scsi_tgt_del_sport(ocs_sport_t *sport)
Accept a SLI Port gone notification.
#define OCS_CHAP_TYPE_INCOMING
void ocs_cxn_teardown(ocs_iscsi_t *iscsi)
Free the iSCSI connection objects.
static ocs_pdu_process_rtn_e ocs_iscsi_recv_cmd(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
Function to receive unsolicited command PDUs.
int32_t ocs_iscsi_route_table_read(ocs_t *ocs, ocs_route_table_t *route_table)
static void ocs_iscsi_ctx_teardown(ocs_iscsi_t *iscsi)
Completes any active iSCSI API context when the device is being shut down.
ocs_domain_t * ocs_domain_alloc(ocs_t *ocs)
Allocate a domain object.
uint8_t * ocs_iscsi_mac_get(ocs_t *ocs)
Gets the MAC address of the iSCSI device.
ocs_link_state_cb_t link_state_callbacks[OCS_ISCSI_MAX_LINK_STATE_CALLBACKS]
#define ocs_list_init(head, type, link)
int32_t ocs_iscsi_send_nop_out(ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
Send NOP-Out from an initiator.
static int32_t ocs_iscsi_cxn_event_cb(void *arg, ocs_hal_cxn_event_t *)
Function to receive connection events.
#define ISCSI_CLEAR_TASK_SET
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.
int32_t ocs_iscsi_chap_user_add(ocs_t *ocs, char *username, char *secret, uint32_t type, uint32_t mode)
Add CHAP user. If CHAP user of same type is already exists, return error.
static void ocs_sport_lock_init(ocs_sport_t *sport)
ocs_ip_type_e ocs_iscsi_convert_to_ip_type(ocs_hal_ip_type_e ip_type)
Convert an HAL IP type to the iSCSI API value.
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.
int32_t ocs_iscsi_listen_stop(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Stops a TCP listen socket.
ocs_hal_portal_t ocs_iscsi_portal_get_default(ocs_t *ocs)
Retrieves the default portal.
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.
int32_t ocs_iscsi_ip_address_remove(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub)
Remove the IP address to the specified interface.
static int32_t ocs_iscsi_cxn_request_logout(ocs_cxn_t *cxn)
Attempts to send an asynchronous message to request the initiator to logout.
#define ocs_list_foreach_safe(list, item, nxt)
Iterate a linked list safely.
static int32_t ocs_iscsi_unsolicited_event_ini(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code)
Function to receive unsolicited PDUs for an initiator.
int32_t ocs_scsi_ini_del_device(ocs_t *ocs)
Tears down initiator members of ocs structure.
#define OCS_SCSI_CMD_UNTAGGED
#define OCS_SCSI_CMD_SIMPLE
int32_t ocs_iscsi_is_ip_in_tbl(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub)
Checks if an IP address/subnet is present in the table.
Defines the iSCSI task management response PDU header.
int32_t ocs_iscsi_ip_address_query(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_type_e ip_type, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_subnet_t *ipsub)
Queries the IP addresses on the default interface.
int32_t ocs_session_tgt_unsol_pdu_recv(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len, uint8_t code)
Function to handle unsolicited PDUs on a target.
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 CONN_STATE_LOGOUT_REQUESTED
void ocs_iscsi_tracker_init(ocs_iscsi_mem_tracker_t *tracker)
Initialize the memory tracker.
ocs_hal_cxn_new_t cxn_new
static void ocs_iscsi_print_module_params(ocs_iscsi_t *iscsi)
This function prints the module parameters to the log for debugging purposes.
ocs_hal_ip_address_t ip_addr
#define ASYNC_EVENT_CONN_CLOSE
ocs_pdu_process_rtn_e ocs_iscsi_recv_nop_out(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
Handle NOP-OUT from an initiator.
int32_t ocs_scsi_tgt_new_domain(ocs_domain_t *domain)
Accept a new domain notification.
ocs_hal_rtn_e ocs_hal_set_ptr(ocs_hal_t *hal, ocs_hal_property_e prop, void *value)
#define OCS_SCSI_CMD_ORDERED
#define io_trace(io, fmt,...)
structure used to signal when a mailbox command callback is complete and passes the status and any ot...
ocs_hal_portal_t iface_handle
int32_t ocs_iscsi_api_initialize(ocs_t *ocs)
Initialize the higher level iSCSI software.
ocs_hal_ip_type_e ip_type
Defines a wrapper for the RQ payload buffers so that we can place it back on the proper queue...
int32_t ocs_scsi_new_target(ocs_node_t *node)
Receive notification of a new SCSI target node.
ocs_pdu_process_rtn_e ocs_iscsi_recv_logout(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
Function to process a logout PDU.
ocs_route_table_t route_table
This structure is used to track the WQEs for iSCSI.
#define ISCSI_CQE_CODE_CMD_DATA_DIFF_CXN
static int32_t ocs_iscsi_ctx_wait(ocs_iscsi_t *iscsi, ocs_config_ctx_e index, int timeout_usec)
Waits on an iSCSI API context until the command completes or the timeout occurs.
#define ISCSI_CQE_CODE_RESIDUAL_OVERRUN
int32_t ocs_iscsi_isns_esi_listen_stop(ocs_t *ocs, ocs_ip_address_t *ip, uint16_t tcp_port)
Stops an iSNS ESI TCP listen socket.
ocs_route_table_entry_t entry[OCS_ISCSI_ROUTE_TABLE_ENTRIES_MAX]
#define ocs_is_initiator_enabled()
static void ocs_iscsi_portal_create_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback for creating an interface/portal.
uint32_t ocs_instance(void *os)
Return the instance index of an opaque ocs structure.
int32_t ocs_iscsi_send_nop_in(ocs_cxn_t *cxn, uint64_t lun, uint32_t itt, uint32_t ttt, char *data_ptr, uint32_t data_len)
Send NOP-In from a target.
Used for returning IP information in return from ocs_hal_portal_ip_get()
#define ISCSI_REJECT_REASON_PROTOCOL_ERR
#define ISCSI_REJECT_REASON_SNACK_REJECT
int32_t ocs_scsi_recv_cmd(ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags)
void ocs_iscsi_rx_buffers_free(ocs_iscsi_t *iscsi, ocs_hal_rq_buffer_t *header, ocs_hal_rq_buffer_t *payload)
Add a receive buffer pair to the Receive Queue, if an error is received, then queue the buffer...
#define ISCSI_TASK_MGMT_FUNCTION_COMPLETE
int32_t ocs_iscsi_portal_del_vlan(ocs_t *ocs, ocs_hal_portal_t iface)
Delete iface handle and VLAN from portal_list.
int32_t ocs_iscsi_initialize(ocs_os_handle_t os, ocs_iscsi_t *iscsi, ocs_hal_t *hal, uint32_t device_instance)
Initialize the iSCSI device by setting up the chip.
#define ISCSI_CQE_CODE_OPCODE_ERROR
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.
int32_t ocs_iscsi_portal_delete(ocs_t *ocs, ocs_hal_portal_t portal)
Removes a previously-created portal.
int32_t ocs_iscsi_teardown(ocs_iscsi_t *iscsi)
Shut down the device.
int32_t ocs_iscsi_portal_read_vlan_ids(ocs_t *ocs, void *arg_out, uint32_t arg_out_length)
Read VLAN IDs to provided buffer.
void ocs_session_all_abort_cmdsn(ocs_iscsi_t *iscsi, uint32_t cmdsn)
Abort a specific IO based on the cmdSN of the abort request.
int32_t ocs_iscsi_gateway_set(ocs_t *ocs, ocs_ip_address_t *gateway)
Sets the IP gateway address.
ocs_hal_rtn_e ocs_hal_set(ocs_hal_t *hal, ocs_hal_property_e prop, uint32_t value)
int32_t ocs_iscsi_mac_set(ocs_t *ocs, uint8_t *mac_address)
Sets the MAC address of the iSCSI device.
static void ocs_list_add_tail(ocs_list_t *list, void *item)
Add an item to the tail of the list.
ocs_dma_t * ocs_iscsi_tracker_calc(ocs_iscsi_mem_tracker_t *tracker, uint32_t obj_offset)
Helper to return the pointers for a specific object in the group.
This structure is used to track the SLI4 queues.
structure wrapping an IP address and subnet together with their type.
static void ocs_iscsi_isns_discover_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback for the iSNS server IP addresses.
ocs_hal_rtn_e ocs_hal_domain_free(ocs_hal_t *hal, ocs_domain_t *domain)
Free a domain object.
int32_t ocs_isns_initialize(ocs_iscsi_t *iscsi)
Initialize the iSNS module.
void format_ip_address(ocs_ip_type_e ip_type, uint8_t *address, char *buffer, int size)
Format an IP address into a string.
structure wrapping an IP address together with it's type.
ocs_iscsi_cluster_sendtargets_t clusttgt
static void ocs_sport_lock_free(ocs_sport_t *sport)
static void ocs_node_lock(ocs_node_t *node)
#define ISCSI_CMD_DATA_OUT
#define ISCSI_RESP_LOGOUT
int32_t ocs_iscsi_portal_remove_ip_addresses(ocs_t *ocs, ocs_hal_portal_t iface_handle)
Check and remove IP addresses of the corresponding interface.
static void ocs_iscsi_ctx_route_table_read_cb(void *ul_arg, int32_t status, uint32_t ext_status, void *params)
This function is the callback a add route table command.
static int32_t ocs_iscsi_recv_tm_cb(ocs_io_t *io, ocs_scsi_io_status_e status, uint32_t flags, void *arg)
Callback function used to free an IO for a rejected task management function.
void ocs_iscsi_ipsub_split(ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *ip, ocs_ip_address_t *subnet)
Splits an iSCSI IP address and subnet from the combined structure.
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.
ocs_hal_unsol_cb_t unsol_ini
#define OCS_SCSI_CMD_DIR_IN
#define ocs_is_target_enabled()
static void * ocs_list_next(ocs_list_t *list, void *item)
Get the next item on the list.
ocs_ip_type_e
enum identifying the types of IP addresses.
#define ISCSI_RESP_REJECT
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.
int32_t ocs_iscsi_recv_logout_rsp(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
Handle logout response from a target.
static int32_t ocs_iscsi_cxn_event_invalid(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, uint32_t code)
Function to process connection invalidation notifications.
#define ISCSI_HEAD_OF_QUEUE_TAG
static void ocs_node_unlock(ocs_node_t *node)
#define ISCSI_TARGET_COLD_RESET
int32_t ocs_scsi_ini_new_device(ocs_t *ocs)
Initializes any initiator fields on the ocs structure.
#define OCS_ISCSI_PAGE_SIZE
int32_t ocs_iscsi_interrupts_required(ocs_os_handle_t os, ocs_hal_t *hal)
Returns the number of interrupts needed for this adapter.
int32_t ocs_iscsi_isns_send(ocs_t *ocs, ocs_ip_address_t *isns_server, uint32_t tcp_port, void *buffer, uint32_t *pkt_len, uint32_t buff_len)
Sends an iSNS packet to a server to test the interface.
Defines the iSCSI data-out PDU header.
ocs_hal_ip_type_e ocs_iscsi_convert_to_hal_ip_type(ocs_ip_type_e ip_type)
Convert an iSCSI IP type to the HAL value.
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.
int32_t ocs_io_pool_free(ocs_io_pool_t *io_pool)
Free IO objects pool.
int32_t ocs_iscsi_ip_address_add(ocs_t *ocs, ocs_hal_portal_t portal, ocs_ip_address_subnet_t *ipsub)
Adds the IP address to the specified interface.
static void ocs_domain_lock(ocs_domain_t *domain)
#define ISCSI_REJECT_REASON_DATA_DIGEST_ERR
int32_t ocs_iscsi_route_table_del_entry(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
Deletes an entry from a routing table.
void ocs_scsi_ini_del_sport(ocs_sport_t *sport)
Process deletion of a SPORT.
#define ISCSI_LUN_ADDR_METHOD_PERIPHERAL
ocs_hal_ip_address_t gateway
int32_t ocs_iscsi_inet_pton4(const char *src, ocs_ip_address_t *ip)
Converts an IPv4 address from a string to the IP structure.
ocs_lock_t link_state_cb_lock
#define OCS_DEFAULT_SGL_COUNT
int32_t ocs_isns_teardown(ocs_iscsi_t *iscsi)
Shutdown the iSNS module.
int32_t ocs_iscsi_isns_discover(ocs_t *ocs, ocs_hal_portal_t portal, uint32_t max_entries, uint32_t *num_ips, ocs_ip_address_t *ip)
Discovers the iSNS through the DHCP service.
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 ocs_iscsi_recv_nop_in(ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len, ocs_hal_rq_buffer_t *data, uint32_t data_len)
Handle NOP-IN from a target.
ocs_hal_cxn_event_e event
#define LOGOUT_REASON_CLOSE_CONN
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.
void ocs_iscsi_unregister_link_state_callback(ocs_t *ocs, ocs_link_state_cb_t cb)
Unregister a link state change callback.
#define ocs_assert(cond,...)
#define ISCSI_UNTAGGED_TAG
#define OCS_MAX_ISCSI_NAME
iSCSI object memory tracker
#define ISCSI_TASK_MGMT_NOT_SUPPORTED
#define CONN_STATE_FULL_FEATURE
ocs_iscsi_tgt_ip_t * ip_info
static uint32_t ocs_iscsi_decode_lun(uint8_t *lu)
Decode a LU Number according to SAM.
#define ISCSI_CQE_CODE_BAD_WQE_INDEX
int32_t ocs_iscsi_inet_pton6(const char *src, ocs_ip_address_t *ip)
Converts an IPv6 address from a string to the IP structure.
void ocs_session_teardown(ocs_iscsi_t *iscsi)
Releases the session objects used within the login module.
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 ISCSI_LUN_ADDR_METHOD_FLAT
int32_t ocs_iscsi_portal_create(ocs_t *ocs, unsigned int vlan_id, ocs_hal_portal_t *portal)
Creates a portal for a VLAN.
void * ocs_hal_get_ptr(ocs_hal_t *hal, ocs_hal_property_e prop)
#define OCS_LOGIN_REQUEST_QUEUED
#define ISCSI_CQE_CODE_HDR_DIGEST_ERROR
ocs_io_t * ocs_scsi_io_alloc(ocs_node_t *node, ocs_scsi_io_role_e role)
allocate a SCSI IO context.
ocs_hal_cxn_invalid_t cxn_invalid
#define ocs_list_foreach(list, item)
Iterate a linked list.
ocs_xport_t * ocs_xport_alloc(ocs_t *ocs)
allocate a transport object
int32_t ocs_scsi_recv_cmd_first_burst(ocs_io_t *io, uint32_t lun, uint8_t *cdb, uint32_t cdb_len, uint32_t flags, ocs_dma_t first_burst_buffers[], uint32_t first_burst_bytes)
Receive an FCP SCSI command with the first burst data.
ocs_ip_address_subnet_t ipsub[32]
struct ocs_iscsi_s * iscsi
structure wrapping an IP address together with it's type.
int32_t ocs_iscsi_portal_add_vlan(ocs_t *ocs, ocs_hal_portal_t iface, uint32_t vlan_id)
Add VLAN and iface handle to portal_list.
int32_t ocs_iscsi_add_ip_to_tbl(ocs_t *ocs, char *desc, ocs_ip_address_subnet_t *ipsub, ocs_hal_portal_t portal)
Adds an IP address to the table.
#define OCS_ISCSI_LOGIN_DEFAULT_TIME_2_RETAIN
int32_t ocs_cxn_new_tgt_connection(ocs_iscsi_t *iscsi, uint32_t conn_hdl)
Function to receive new TCP connections.
int32_t ocs_iscsi_tracker_alloc(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker, uint8_t zero, uint32_t object_size, uint32_t alignment, uint32_t num_objects)
Allocate a group of objects uses pages to minimize waste.
int32_t ocs_cxn_close(ocs_cxn_t *cxn, uint8_t sendRst)
Issues a request to the HAL to close the connection.
int32_t ocs_session_abort_itt(ocs_session_t *session, uint32_t itt)
Abort a specific IO based on the ITT.
void ocs_iscsi_convert_to_ip(ocs_ip_address_t *ip, ocs_hal_ip_address_t *hal_ip)
Convert an iSCSI IP address to the HAL IP address.
#define OCS_CHAP_TYPE_OUTGOING
int32_t ocs_iscsi_send_tmf_resp(ocs_io_t *io, uint8_t response, ocs_scsi_io_cb_t cb, void *arg)
send TMF response data
int32_t ocs_iscsi_route_table_add_entry(ocs_t *ocs, ocs_ip_address_subnet_t *ipsub, ocs_ip_address_t *gateway)
Adds an entry to a routing table.
ocs_hal_tgt_data_digest_t tgt_digest
void ocs_scsi_ini_del_domain(ocs_domain_t *domain)
Accept domain lost notification.
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 void ocs_domain_unlock(ocs_domain_t *domain)
#define ISCSI_CQE_CODE_RECV_SEQ_BURST_ERROR
#define CONN_STATE_CLEANUP
#define ISCSI_CQE_CODE_ITT_TTT_TOO_BIG
void ocs_iscsi_tracker_free(ocs_iscsi_t *iscsi, ocs_iscsi_mem_tracker_t *tracker)
Free the memory associated with a memory tracker.
void ocs_session_abort_cmdsn(ocs_session_t *session, uint32_t cmdsn)
Abort a specific IO based on the cmdSN of the abort request.
#define ISCSI_TARGET_WARM_RESET
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.
static int32_t ocs_iscsi_recv_tm_rsp(ocs_iscsi_t *iscsi, ocs_cxn_t *cxn, ocs_hal_rq_buffer_t *hdr, uint32_t hdr_len)
Function to receive unsolicited task management response PDUs.
ocs_hal_portal_t ocs_hal_portal_get_default(ocs_hal_t *hal)
Return the default portal.
Defines the iSCSI login PDU header.
int32_t ocs_iscsi_api_shutdown(ocs_t *ocs)
Initialize the higher level iSCSI software.