diff options
Diffstat (limited to 'usr/src')
14 files changed, 191 insertions, 76 deletions
diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c index 08fefee1fa..0f9e7978fe 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_clock.c @@ -535,6 +535,7 @@ emlxs_timer_check_rings(emlxs_hba_t *hba, uint8_t *flag) emlxs_config_t *cfg = &CFG; int32_t ringno; RING *rp; + uint32_t logit = 0; if (!cfg[CFG_TIMEOUT_ENABLE].current) { return; @@ -552,14 +553,7 @@ emlxs_timer_check_rings(emlxs_hba_t *hba, uint8_t *flag) rp->timeout = hba->timer_tics + 10; if (hba->state >= FC_LINK_UP) { - EMLXS_MSGF(EMLXS_CONTEXT, - &emlxs_ring_watchdog_msg, - "%s host=%d port=%d cnt=%d,%d", - emlxs_ring_xlate(ringno), - rp->fc_cmdidx, - rp->fc_port_cmdidx, - hba->ring_tx_count[ringno], - hba->io_count[ringno]); + logit = 1; } } else { rp->timeout = 0; @@ -567,6 +561,16 @@ emlxs_timer_check_rings(emlxs_hba_t *hba, uint8_t *flag) } mutex_exit(&EMLXS_RINGTX_LOCK); + if (logit) { + EMLXS_MSGF(EMLXS_CONTEXT, + &emlxs_ring_watchdog_msg, + "%s host=%d port=%d cnt=%d,%d", + emlxs_ring_xlate(ringno), + rp->fc_cmdidx, rp->fc_port_cmdidx, + hba->ring_tx_count[ringno], + hba->io_count[ringno]); + } + /* * If ring flag is set, request iocb servicing here to send * any iocb's that may still be queued @@ -1255,14 +1259,6 @@ emlxs_tx_watchdog(emlxs_hba_t *hba) did = SWAP_DATA24_LO(pkt->pkt_cmd_fhdr.d_id); cmd = *((uint32_t *)pkt->pkt_cmd); cmd = SWAP_DATA32(cmd); - - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_txq_watchdog_msg, - "sbp=%p node=%p cmd=%08x did=%x", - sbp, sbp->node, cmd, did); - } else { - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_txq_watchdog_msg, - "sbp=%p node=%p", - sbp, sbp->node); } diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c index dc3b522466..da586a3bb0 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_dhchap.c @@ -7578,12 +7578,14 @@ emlxs_dhc_detach(emlxs_hba_t *hba) extern void -emlxs_dhc_init_sp(emlxs_port_t *port, uint32_t did, SERV_PARM *sp, char *msg) +emlxs_dhc_init_sp(emlxs_port_t *port, uint32_t did, SERV_PARM *sp, char **msg) { emlxs_hba_t *hba = HBA; emlxs_config_t *cfg = &CFG; uint32_t fabric; uint32_t fabric_switch; + emlxs_auth_cfg_t *auth_cfg = NULL; + emlxs_auth_key_t *auth_key = NULL; fabric = ((did & Fabric_DID_MASK) == Fabric_DID_MASK) ? 1 : 0; fabric_switch = ((did == Fabric_DID) ? 1 : 0); @@ -7591,27 +7593,49 @@ emlxs_dhc_init_sp(emlxs_port_t *port, uint32_t did, SERV_PARM *sp, char *msg) /* Return is authentication is not enabled */ if (cfg[CFG_AUTH_ENABLE].current == 0) { sp->cmn.fcsp_support = 0; - (void) sprintf(msg, "fcsp:Disabled"); + bcopy("fcsp:Disabled (0)", (void *) &msg[0], + sizeof ("fcsp:Disabled (0)")); return; } if (port->vpi != 0 && cfg[CFG_AUTH_NPIV].current == 0) { sp->cmn.fcsp_support = 0; - (void) sprintf(msg, "fcsp:Disabled (npiv)"); + bcopy("fcsp:Disabled (npiv)", (void *) &msg[0], + sizeof ("fcsp:Disabled (0)")); return; } if (!fabric_switch && fabric) { sp->cmn.fcsp_support = 0; - (void) sprintf(msg, "fcsp:Disabled (fs)"); + bcopy("fcsp:Disabled (fs)", (void *) &msg[0], + sizeof ("fcsp:Disabled (fs)")); return; } /* Return if fcsp support to this node is not enabled */ if (!fabric_switch && cfg[CFG_AUTH_E2E].current == 0) { sp->cmn.fcsp_support = 0; - (void) sprintf(msg, "fcsp:Disabled (e2e)"); + bcopy("fcsp:Disabled (e2e)", (void *) &msg[0], + sizeof ("fcsp:Disabled (e2e)")); return; } - sp->cmn.fcsp_support = 1; + mutex_enter(&hba->auth_lock); + if (fabric_switch) { + auth_cfg = emlxs_auth_cfg_find(port, + (uint8_t *)emlxs_fabric_wwn); + auth_key = emlxs_auth_key_find(port, + (uint8_t *)emlxs_fabric_wwn); + if ((!auth_cfg) || (!auth_key)) { + sp->cmn.fcsp_support = 0; + bcopy("fcsp:Disabled (1)", (void *) &msg[0], + sizeof ("fcsp:Disabled (1)")); + mutex_exit(&hba->auth_lock); + return; + } + + } + + mutex_exit(&hba->auth_lock); + + sp->cmn.fcsp_support = 1; return; @@ -9296,7 +9320,7 @@ emlxs_dhc_init_auth(emlxs_hba_t *hba, uint8_t *lwwpn, uint8_t *rwwpn) if (!(port->flag & EMLXS_PORT_BOUND)) { continue; } - if (bcmp((uint8_t *)&port->wwpn, lwwpn, 8) != 0) { + if (bcmp((uint8_t *)&port->wwpn, lwwpn, 8) == 0) { break; } } @@ -9309,7 +9333,7 @@ emlxs_dhc_init_auth(emlxs_hba_t *hba, uint8_t *lwwpn, uint8_t *rwwpn) return (DFC_AUTH_WWN_NOT_FOUND); } - if (bcmp(rwwpn, emlxs_fabric_wwn, 8) != 0) { + if (bcmp(rwwpn, emlxs_fabric_wwn, 8) == 0) { /* Scan for fabric node */ if ((ndlp = emlxs_node_find_did(port, Fabric_DID)) == NULL) { EMLXS_MSGF(EMLXS_CONTEXT, @@ -9505,7 +9529,7 @@ emlxs_dhc_add_auth_cfg( /* Port match found */ if (bcmp((uint8_t *)&fcsp_cfg->rwwpn, - emlxs_fabric_wwn, 8) != 0) { + emlxs_fabric_wwn, 8) == 0) { /* Scan for fabric node */ if ((ndlp = emlxs_node_find_did(port, Fabric_DID)) == NULL) { @@ -9843,7 +9867,7 @@ emlxs_dhc_get_auth_status(emlxs_hba_t *hba, dfc_auth_status_t *fcsp_status) return (DFC_AUTH_NOT_CONFIGURED); } if (bcmp((uint8_t *)&fcsp_status->rwwpn, - (uint8_t *)emlxs_fabric_wwn, 8 != 0)) { + (uint8_t *)emlxs_fabric_wwn, 8) == 0) { auth_status = &port->port_dhc.auth_status; auth_time = port->port_dhc.auth_time; ndlp = emlxs_node_find_did(port, Fabric_DID); diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_els.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_els.c index fe191555ff..10c67e52a9 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_els.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_els.c @@ -2724,7 +2724,11 @@ emlxs_ct_handle_unsol_req(emlxs_port_t *port, RING *rp, IOCBQ *iocbq, CtCmd, size, iocb->ulpContext); } - emlxs_log_ct_event(port, (uint8_t *)mp->virt, size, iocb->ulpContext); + if (emlxs_log_ct_event(port, (uint8_t *)mp->virt, size, + iocb->ulpContext)) { + /* Abort the exchange */ + emlxs_abort_ct_exchange(port, iocb->ulpContext); + } return (0); diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_extern.h b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_extern.h index 6b4f4b8587..fc4332de16 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_extern.h +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_extern.h @@ -67,7 +67,7 @@ extern uint32_t emlxs_msg_log_get(emlxs_hba_t *hba, emlxs_log_req_t *req, extern void emlxs_log_dump_event(emlxs_port_t *port, uint8_t *buffer, uint32_t size); extern void emlxs_log_link_event(emlxs_port_t *port); -extern void emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, +extern uint32_t emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, uint32_t size, uint32_t rxid); extern void emlxs_log_rscn_event(emlxs_port_t *port, uint8_t *payload, uint32_t size); @@ -168,7 +168,7 @@ extern void emlxs_dhc_auth_stop(emlxs_port_t *port, emlxs_node_t *node); extern int emlxs_dhc_auth_start(emlxs_port_t *port, emlxs_node_t *node, uint8_t *sbp, uint8_t *ubp); extern void emlxs_dhc_init_sp(emlxs_port_t *port, uint32_t did, SERV_PARM *sp, - char *msg); + char **msg); extern uint32_t emlxs_dhc_verify_login(emlxs_port_t *port, uint32_t sid, SERV_PARM *sp); extern void emlxs_dhc_status(emlxs_port_t *port, emlxs_node_t *ndlp, @@ -386,6 +386,7 @@ extern IOCBQ *emlxs_create_abort_xri_cx(emlxs_port_t *port, NODELIST *ndlp, uint16_t xid, RING *rp, uint8_t class, int32_t flag); extern IOCBQ *emlxs_create_close_xri_cx(emlxs_port_t *port, NODELIST *ndlp, uint16_t xid, RING *rp); +extern void emlxs_abort_ct_exchange(emlxs_port_t *port, uint32_t rxid); extern emlxs_buf_t *emlxs_chipq_get(RING *rp, uint16_t iotag); extern void emlxs_chipq_put(RING *rp, emlxs_buf_t *sbp); diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fc.h b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fc.h index 68ecd101bc..ed7f53fdbf 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fc.h +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fc.h @@ -1354,6 +1354,8 @@ typedef struct emlxs_hba { uint16_t iocb_rsp_size; uint32_t hc_copy; /* local copy of HC register */ + uint32_t io_poll_count; /* Number of poll commands */ + /* in progress */ /* IO Completion management */ uint32_t iodone_count; /* Number of IO's on done queue */ diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fcp.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fcp.c index f4177d3e43..ebeabe5079 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fcp.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_fcp.c @@ -1650,8 +1650,14 @@ emlxs_offline(emlxs_hba_t *hba) /* For safety flush every iotag list */ if (emlxs_iotag_flush(hba)) { /* Pause here for the IO to flush */ - DELAYMS(1000); + delay(drv_usectohz(1000)); + } + + /* Wait for poll command request to settle */ + while (hba->io_poll_count > 0) { + delay(drv_usectohz(2000000)); /* 2 sec */ } + /* Interlock the adapter to take it down */ (void) emlxs_interlock(hba); @@ -3316,6 +3322,28 @@ emlxs_create_close_xri_cx(emlxs_port_t *port, NODELIST *ndlp, } /* emlxs_create_close_xri_cx() */ +void +emlxs_abort_ct_exchange(emlxs_port_t *port, uint32_t rxid) +{ + emlxs_hba_t *hba = HBA; + RING *rp; + IOCBQ *iocbq; + + rp = &hba->ring[FC_CT_RING]; + + /* Create the abort IOCB */ + if (hba->state >= FC_LINK_UP) { + iocbq = emlxs_create_abort_xri_cx(port, NULL, rxid, rp, + CLASS3, ABORT_TYPE_ABTS); + } + else + { + iocbq = emlxs_create_close_xri_cx(port, NULL, rxid, rp); + } + iocbq->port = port; + emlxs_issue_iocb_cmd(hba, rp, iocbq); +} + /* This must be called while holding the EMLXS_FCCTAB_LOCK */ static void diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_hba.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_hba.c index 85ec893539..471eb5a495 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_hba.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_hba.c @@ -4047,8 +4047,8 @@ emlxs_handle_ring_event(emlxs_hba_t *hba, int32_t ring_no, uint32_t ha_copy) * If this is NOT a polled command completion or a * driver allocated pkt, then defer pkt completion. */ - if (!(sbp->pkt_flags & PACKET_POLLED | - PACKET_ALLOCATED)) { + if (!(sbp->pkt_flags & + (PACKET_POLLED | PACKET_ALLOCATED))) { /* Add the IOCB to the local list */ if (!rsp_head) { rsp_head = iocbq; diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mbox.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mbox.c index a458fba6e4..49b57778f0 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mbox.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mbox.c @@ -2062,6 +2062,12 @@ emlxs_handle_mb_event(emlxs_hba_t *hba) case MBX_REG_LOGIN: control = mbox->un.varRegLogin.un.sp.bdeSize; if (control == 0) { +#ifdef NPIV_SUPPORT + /* Special handle for vport PLOGI */ + if (hba->mbox_iocbq == (uint8_t *)1) { + hba->mbox_iocbq = NULL; + } +#endif /* NPIV_SUPPORT */ goto done; } break; @@ -2070,6 +2076,12 @@ emlxs_handle_mb_event(emlxs_hba_t *hba) control = mbox->un.varRegLogin.un.sp64.tus.f. bdeSize; if (control == 0) { +#ifdef NPIV_SUPPORT + /* Special handle for vport PLOGI */ + if (hba->mbox_iocbq == (uint8_t *)1) { + hba->mbox_iocbq = NULL; + } +#endif /* NPIV_SUPPORT */ goto done; } break; @@ -2123,6 +2135,12 @@ emlxs_handle_mb_event(emlxs_hba_t *hba) EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_create_failed_msg, "Limit reached. count=%d", port->node_count); } +#ifdef NPIV_SUPPORT + /* Special handle for vport PLOGI */ + if (hba->mbox_iocbq == (uint8_t *)1) { + hba->mbox_iocbq = NULL; + } +#endif /* NPIV_SUPPORT */ break; case MBX_READ_LA: diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mem.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mem.c index 409b34281d..499495b00f 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mem.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_mem.c @@ -1158,6 +1158,12 @@ emlxs_mem_buf_alloc(emlxs_hba_t *hba) EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_mem_alloc_failed_msg, "MEM_BUF_ALLOC DMA buffer."); + /* Free the matp object */ + bzero(buf_info, sizeof (MBUF_INFO)); + buf_info->size = sizeof (MATCHMAP); + buf_info->virt = (uint32_t *)matp; + emlxs_mem_free(hba, buf_info); + return (0); } bp = (uint8_t *)buf_info->virt; diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_msg.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_msg.c index a66fc9d074..e142593db7 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_msg.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_msg.c @@ -203,6 +203,7 @@ emlxs_msg_log(emlxs_port_t *port, const uint32_t fileno, const uint32_t line, uint32_t last; uint32_t mask; emlxs_msg_t *msg2; + uint32_t rxid; uint32_t i; /* Get the log file for this instance */ @@ -289,6 +290,12 @@ emlxs_msg_log(emlxs_port_t *port, const uint32_t fileno, const uint32_t line, /* Check if this event has not been acquired */ if (log->count > (hba->hba_event.last_id + log->size)) { hba->hba_event.missed++; + + if (entry2->msg->mask == EVT_CT) { + /* Abort exchange */ + rxid = *((uint32_t *)entry2->bp); + emlxs_abort_ct_exchange(port, rxid); + } } } /* Free the old context buffer since we are about to erase it */ @@ -328,6 +335,12 @@ emlxs_msg_log(emlxs_port_t *port, const uint32_t fileno, const uint32_t line, /* Check if this event has not been acquired */ if (log->count > (hba->hba_event.last_id + log->size)) { hba->hba_event.missed++; + + if (entry->msg->mask == EVT_CT) { + /* Abort exchange */ + rxid = *((uint32_t *)entry->bp); + emlxs_abort_ct_exchange(port, rxid); + } } } /* Free the old context buffer since we are about to erase it */ @@ -846,7 +859,7 @@ emlxs_log_rscn_event(emlxs_port_t *port, uint8_t *payload, uint32_t size) } /* emlxs_log_rscn_event() */ -void +uint32_t emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, uint32_t size, uint32_t rxid) { @@ -857,7 +870,7 @@ emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, uint32_t size, /* Check if the event is being requested */ if (!(hba->log_events & EVT_CT)) { - return; + return (1); } if (size > MAX_CT_PAYLOAD) { size = MAX_CT_PAYLOAD; @@ -866,7 +879,7 @@ emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, uint32_t size, /* Save a copy of the payload for the event log */ if (!(bp = (uint8_t *)kmem_alloc(size, KM_NOSLEEP))) { - return; + return (1); } /* * Buffer Format: word[0] = RXID tag for outgoing reply to this CT @@ -880,9 +893,13 @@ emlxs_log_ct_event(emlxs_port_t *port, uint8_t *payload, uint32_t size, EMLXS_MSGF(EMLXS_CONTEXT_BP, bp, size, &emlxs_ct_event, "bp=%p size=%d rxid=%x", bp, size, rxid); + return (0); + +#else + return (1); + #endif /* DFC_SUPPORT */ - return; } /* emlxs_log_ct_event() */ diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_node.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_node.c index 0b586db9cc..4d76ea12e2 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_node.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_node.c @@ -61,14 +61,18 @@ emlxs_node_close(emlxs_port_t *port, NODELIST *ndlp, uint32_t ringno, (ndlp->nlp_tics[ringno] < (tics + hba->timer_tics))) || !(ndlp->nlp_flag[ringno] & NLP_TIMER)) { + + ndlp->nlp_tics[ringno] = hba->timer_tics + tics; + ndlp->nlp_flag[ringno] |= NLP_TIMER; + + mutex_exit(&EMLXS_RINGTX_LOCK); + EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_closed_msg, "node=%p did=%06x %s. timeout=%d updated.", ndlp, ndlp->nlp_DID, emlxs_ring_xlate(ringno), tics); - - ndlp->nlp_tics[ringno] = hba->timer_tics + tics; - ndlp->nlp_flag[ringno] |= NLP_TIMER; + return; } } mutex_exit(&EMLXS_RINGTX_LOCK); @@ -79,16 +83,8 @@ emlxs_node_close(emlxs_port_t *port, NODELIST *ndlp, uint32_t ringno, ndlp->nlp_flag[ringno] |= NLP_CLOSED; if (tics) { - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_closed_msg, - "node=%p did=%06x %s. timeout=%d set.", - ndlp, ndlp->nlp_DID, emlxs_ring_xlate(ringno), tics); - ndlp->nlp_tics[ringno] = hba->timer_tics + tics; ndlp->nlp_flag[ringno] |= NLP_TIMER; - } else { - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_closed_msg, - "node=%p did=%06x %s.", ndlp, ndlp->nlp_DID, - emlxs_ring_xlate(ringno)); } if (ndlp->nlp_next[ringno]) { @@ -126,6 +122,16 @@ emlxs_node_close(emlxs_port_t *port, NODELIST *ndlp, uint32_t ringno, ndlp->nlp_next[ringno] = NULL; } mutex_exit(&EMLXS_RINGTX_LOCK); + if (tics) { + EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_closed_msg, + "node=%p did=%06x %s. timeout=%d set.", + ndlp, ndlp->nlp_DID, emlxs_ring_xlate(ringno), tics); + + } else { + EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_closed_msg, + "node=%p did=%06x %s.", ndlp, ndlp->nlp_DID, + emlxs_ring_xlate(ringno)); + } return; @@ -141,6 +147,7 @@ emlxs_node_open(emlxs_port_t *port, NODELIST * ndlp, uint32_t ringno) NODELIST *nlp; MAILBOXQ *mbox; uint32_t i; + uint32_t logit = 0; /* If node needs servicing, then add it to the ring queues */ mutex_enter(&EMLXS_RINGTX_LOCK); @@ -162,13 +169,7 @@ emlxs_node_open(emlxs_port_t *port, NODELIST * ndlp, uint32_t ringno) if ((ndlp->nlp_flag[ringno] & NLP_TIMER) && ndlp->nlp_tics[ringno] && (ndlp->nlp_tics[ringno] <= hba->timer_tics)) { - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_opened_msg, - "node=%p did=%06x %s. Timeout.", ndlp, ndlp->nlp_DID, - emlxs_ring_xlate(ringno)); - } else { - EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_opened_msg, - "node=%p did=%06x %s.", ndlp, ndlp->nlp_DID, - emlxs_ring_xlate(ringno)); + logit = 1; } /* Clear the timer */ @@ -210,6 +211,12 @@ emlxs_node_open(emlxs_port_t *port, NODELIST * ndlp, uint32_t ringno) } mutex_exit(&EMLXS_RINGTX_LOCK); + if (logit) { + EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_node_opened_msg, + "node=%p did=%06x %s. Timeout.", ndlp, ndlp->nlp_DID, + emlxs_ring_xlate(ringno)); + } + /* If link attention needs to be cleared */ if ((hba->state == FC_LINK_UP) && (ringno == FC_FCP_RING)) { diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_pkt.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_pkt.c index 5bb7976b22..ab6c98ec20 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_pkt.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_pkt.c @@ -362,12 +362,15 @@ emlxs_pkt_alloc(emlxs_port_t *port, uint32_t cmdlen, uint32_t rsplen, } bzero(pkt->pkt_data, datalen); } - if (emlxs_pkt_init((opaque_t)port, pkt, sleep) != FC_SUCCESS) { - goto failed; - } - /* Set the allocated flag */ + sbp = PKT2PRIV(pkt); - sbp->pkt_flags |= PACKET_ALLOCATED; + bzero((void *)sbp, sizeof (emlxs_buf_t)); + + mutex_init(&sbp->mtx, NULL, MUTEX_DRIVER, (void *)hba->intr_arg); + sbp->pkt_flags = PACKET_VALID | PACKET_RETURNED | PACKET_ALLOCATED; + sbp->port = port; + sbp->pkt = pkt; + sbp->iocbq.sbp = sbp; return (pkt); diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c index 1c1bdd4fbe..a1042fde2c 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_solaris.c @@ -1673,8 +1673,14 @@ emlxs_bind_port(dev_info_t *dip, fc_fca_port_info_t *port_info, (void) sprintf(port_info->pi_attrs.firmware_version, "%s (%s)", vpd->fw_version, vpd->fw_label); - (void) strcpy(port_info->pi_attrs.option_rom_version, - vpd->fcode_version); +#ifdef i386 + sprintf(port_info->pi_attrs.option_rom_version, + "Boot:%s", vpd->boot_version); +#else /* sparc */ + sprintf(port_info->pi_attrs.option_rom_version, + "Boot:%s Fcode:%s", + vpd->boot_version, vpd->fcode_version); +#endif /* i386 */ (void) sprintf(port_info->pi_attrs.driver_version, "%s (%s)", emlxs_version, emlxs_revision); @@ -2025,17 +2031,14 @@ emlxs_pkt_init(opaque_t fca_port_handle, fc_packet_t *pkt, int32_t sleep) emlxs_port_t *port = (emlxs_port_t *)fca_port_handle; emlxs_hba_t *hba = HBA; emlxs_buf_t *sbp = (emlxs_buf_t *)pkt->pkt_fca_private; - uint32_t pkt_flags; if (!sbp) { return (FC_FAILURE); } - pkt_flags = sbp->pkt_flags; bzero((void *) sbp, sizeof (emlxs_buf_t)); mutex_init(&sbp->mtx, NULL, MUTEX_DRIVER, (void *) hba->intr_arg); - sbp->pkt_flags = PACKET_VALID | PACKET_RETURNED | - (pkt_flags & PACKET_ALLOCATED); + sbp->pkt_flags = PACKET_VALID | PACKET_RETURNED; sbp->port = port; sbp->pkt = pkt; sbp->iocbq.sbp = sbp; @@ -2503,6 +2506,10 @@ emlxs_poll(emlxs_port_t *port, emlxs_buf_t *sbp) uint32_t att_bit; emlxs_ring_t *rp; + mutex_enter(&EMLXS_PORT_LOCK); + hba->io_poll_count++; + mutex_exit(&EMLXS_PORT_LOCK); + /* Set thread timeout */ timeout = emlxs_timeout(hba, (pkt->pkt_timeout + (4 * hba->fc_ratov) + 60)); @@ -2592,7 +2599,7 @@ emlxs_poll(emlxs_port_t *port, emlxs_buf_t *sbp) timeout = emlxs_timeout(hba, 60); (void) drv_getparm(LBOLT, &time); while ((time < timeout) && sbp->flush_count > 0) { - delay(drv_usectohz(2000000)); + delay(drv_usectohz(500000)); (void) drv_getparm(LBOLT, &time); } @@ -2619,7 +2626,7 @@ emlxs_poll(emlxs_port_t *port, emlxs_buf_t *sbp) timeout = emlxs_timeout(hba, 60); (void) drv_getparm(LBOLT, &time); while ((time < timeout) && sbp->flush_count > 0) { - delay(drv_usectohz(2000000)); + delay(drv_usectohz(500000)); (void) drv_getparm(LBOLT, &time); } @@ -2662,6 +2669,10 @@ done: sbp->pkt_flags |= PACKET_RETURNED; mutex_exit(&sbp->mtx); + mutex_enter(&EMLXS_PORT_LOCK); + hba->io_poll_count--; + mutex_exit(&EMLXS_PORT_LOCK); + /* Make ULP completion callback if required */ if (pkt->pkt_comp) { (*pkt->pkt_comp) (pkt); @@ -3447,10 +3458,10 @@ begin: } if (!found) { + mutex_exit(&EMLXS_RINGTX_LOCK); EMLXS_MSGF(EMLXS_CONTEXT, &emlxs_pkt_abort_failed_msg, "I/O not found in driver. sbp=%p flags=%x", sbp, sbp->pkt_flags); - mutex_exit(&EMLXS_RINGTX_LOCK); goto done; } /* Check if node still needs servicing */ @@ -7696,7 +7707,6 @@ emlxs_send_fcp_status(emlxs_port_t *port, emlxs_buf_t *sbp) } /* emlxs_send_fcp_status() */ #endif /* SFCT_SUPPORT */ - static int32_t emlxs_send_sequence(emlxs_port_t *port, emlxs_buf_t *sbp) { @@ -8238,7 +8248,7 @@ emlxs_send_els(emlxs_port_t *port, emlxs_buf_t *sbp) #ifdef DHCHAP_SUPPORT emlxs_dhc_init_sp(port, did, - (SERV_PARM *)&els_pkt->un.logi, fcsp_msg); + (SERV_PARM *)&els_pkt->un.logi, (char **)&fcsp_msg); #endif /* DHCHAP_SUPPORT */ break; @@ -8615,7 +8625,7 @@ emlxs_send_els_rsp(emlxs_port_t *port, emlxs_buf_t *sbp) #ifdef DHCHAP_SUPPORT emlxs_dhc_init_sp(port, did, - (SERV_PARM *)&els_pkt->un.logi, fcsp_msg); + (SERV_PARM *)&els_pkt->un.logi, (char **)&fcsp_msg); #endif /* DHCHAP_SUPPORT */ } diff --git a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_version.h b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_version.h index bc5b8a9613..17ddbb7d41 100644 --- a/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_version.h +++ b/usr/src/uts/common/io/fibre-channel/fca/emlxs/emlxs_version.h @@ -32,10 +32,10 @@ extern "C" { #endif -#define EMLXS_VERSION "2.31n" -#define EMLXS_DATE_MINUTE "00" /* 00-59 */ -#define EMLXS_DATE_HOUR "13" /* 00-23 */ -#define EMLXS_DATE_DAY "01" /* 00-31 */ +#define EMLXS_VERSION "2.31p" +#define EMLXS_DATE_MINUTE "30" /* 00-59 */ +#define EMLXS_DATE_HOUR "16" /* 00-23 */ +#define EMLXS_DATE_DAY "24" /* 00-31 */ #define EMLXS_DATE_MONTH "10" /* 01-12 */ #define EMLXS_DATE_YEAR "2008" /* YYYY */ @@ -59,4 +59,3 @@ char emlxs_label[] = EMLXS_LABEL; #endif #endif /* _EMLXS_VERSION_H */ - |