diff options
author | mav <mav@FreeBSD.org> | 2017-03-29 16:16:39 +0000 |
---|---|---|
committer | mav <mav@FreeBSD.org> | 2017-03-29 16:16:39 +0000 |
commit | 8f3f61d6d7953621ffdc1c7f26c769308c4be615 (patch) | |
tree | 3d2fe09c8f9964edeea0807bc9730fa2a75b855c | |
parent | 07a133a779696dd3b77cf5b0d56c6615073eccd2 (diff) | |
download | FreeBSD-src-8f3f61d6d7953621ffdc1c7f26c769308c4be615.zip FreeBSD-src-8f3f61d6d7953621ffdc1c7f26c769308c4be615.tar.gz |
MFC r315545: Remove hackish code delaying ATIOs to unknown virtual port.
Since we support RQSTYPE_RPT_ID_ACQ, that functionality is only useful
in loop mode, which probably doesn't worth having this hack in 2017.
-rw-r--r-- | sys/dev/isp/isp.c | 6 | ||||
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 41 | ||||
-rw-r--r-- | sys/dev/isp/isp_target.c | 33 | ||||
-rw-r--r-- | sys/dev/isp/ispvar.h | 1 |
4 files changed, 28 insertions, 53 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c index 3b32e8e..03900dc 100644 --- a/sys/dev/isp/isp.c +++ b/sys/dev/isp/isp.c @@ -1323,7 +1323,6 @@ isp_init(ispsoftc_t *isp) } else { isp_scsi_init(isp); } - GET_NANOTIME(&isp->isp_init_time); } static void @@ -2368,7 +2367,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan) __func__, chan, vp.vp_mod_hdr.rqs_flags, vp.vp_mod_status); return (EIO); } - GET_NANOTIME(&isp->isp_init_time); return (0); } @@ -5655,7 +5653,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) * These are broadcast events that have to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); int topo = fcp->isp_topo; @@ -5710,7 +5707,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5750,7 +5746,6 @@ isp_parse_async_fc(ispsoftc_t *isp, uint16_t mbox) * This is a broadcast event that has to be sent across * all active channels. */ - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) @@ -5942,7 +5937,6 @@ isp_handle_other_response(ispsoftc_t *isp, int type, isphdr_t *hp, uint32_t *opt portid = (uint32_t)rid.ridacq_vp_port_hi << 16 | rid.ridacq_vp_port_lo; if (rid.ridacq_format == 0) { - GET_NANOTIME(&isp->isp_init_time); for (chan = 0; chan < isp->isp_nchan; chan++) { fcparam *fcp = FCPARAM(isp, chan); if (fcp->role == ISP_ROLE_NONE) diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index abdc276..2b0a325 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -1817,44 +1817,17 @@ isp_handle_platform_atio7(ispsoftc_t *isp, at7_entry_t *aep) sid = (aep->at_hdr.s_id[0] << 16) | (aep->at_hdr.s_id[1] << 8) | aep->at_hdr.s_id[2]; lun = CAM_EXTLUN_BYTE_SWIZZLE(be64dec(aep->at_cmnd.fcp_cmnd_lun)); - /* - * Find the N-port handle, and Virtual Port Index for this command. - * - * If we can't, we're somewhat in trouble because we can't actually respond w/o that information. - * We also, as a matter of course, need to know the WWN of the initiator too. - */ if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { - /* - * Find the right channel based upon D_ID - */ + /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - NANOTIME_T now; - - /* - * If we don't recognizer our own D_DID, terminate the exchange, unless we're within 2 seconds of startup - * It's a bit tricky here as we need to stash this command *somewhere*. - */ - GET_NANOTIME(&now); - if (NANOTIME_SUB(&now, &isp->isp_init_time) > 2000000000ULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - tptr = get_lun_statep(isp, 0, 0); - if (tptr == NULL) { - tptr = get_lun_statep(isp, 0, CAM_LUN_WILDCARD); - if (tptr == NULL) { - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel and no tptr- dropping", __func__, aep->at_rxid, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); - return; - } - } - isp_prt(isp, ISP_LOGWARN, "%s: [RX_ID 0x%x] D_ID %x not found on any channel- deferring", __func__, aep->at_rxid, did); - goto noresrc; + isp_prt(isp, ISP_LOGWARN, + "%s: [RX_ID 0x%x] D_ID %x not found on any channel", + __func__, aep->at_rxid, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); + return; } - isp_prt(isp, ISP_LOGTDEBUG0, "%s: [RX_ID 0x%x] D_ID 0x%06x found on Chan %d for S_ID 0x%06x", __func__, aep->at_rxid, did, chan, sid); } else { chan = 0; } diff --git a/sys/dev/isp/isp_target.c b/sys/dev/isp/isp_target.c index ac65b12..f7a7efa 100644 --- a/sys/dev/isp/isp_target.c +++ b/sys/dev/isp/isp_target.c @@ -688,8 +688,11 @@ isp_got_tmf_24xx(ispsoftc_t *isp, at7_entry_t *aep) /* Channel has to be derived from D_ID */ isp_find_chan_by_did(isp, did, &chan); if (chan == ISP_NOCHAN) { - isp_prt(isp, ISP_LOGWARN, "%s: D_ID 0x%x not found on any channel", __func__, did); - isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, ECMD_TERMINATE, 0); + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_endcmd(isp, aep, NIL_HANDLE, ISP_NOCHAN, + ECMD_TERMINATE, 0); return; } } else { @@ -891,17 +894,23 @@ isp_handle_abts(ispsoftc_t *isp, abts_t *abts) nt->nt_did = did; nt->nt_nphdl = abts->abts_nphdl; nt->nt_sid = sid; - isp_find_chan_by_did(isp, did, &chan); - if (chan == ISP_NOCHAN) { - nt->nt_tgt = TGT_ANY; - } else { - nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; - if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) { - nt->nt_wwn = lp->port_wwn; - } else { - nt->nt_wwn = INI_ANY; + if (ISP_CAP_MULTI_ID(isp) && isp->isp_nchan > 1) { + /* Channel has to be derived from D_ID */ + isp_find_chan_by_did(isp, did, &chan); + if (chan == ISP_NOCHAN) { + isp_prt(isp, ISP_LOGWARN, + "%s: D_ID 0x%x not found on any channel", + __func__, did); + isp_acknak_abts(isp, abts, ENXIO); + return; } - } + } else + chan = 0; + nt->nt_tgt = FCPARAM(isp, chan)->isp_wwpn; + if (isp_find_pdb_by_handle(isp, chan, abts->abts_nphdl, &lp)) + nt->nt_wwn = lp->port_wwn; + else + nt->nt_wwn = INI_ANY; nt->nt_lun = LUN_ANY; nt->nt_need_ack = 1; nt->nt_tagval = abts->abts_rxid_task; diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h index 3af7a7c..35b91be 100644 --- a/sys/dev/isp/ispvar.h +++ b/sys/dev/isp/ispvar.h @@ -544,7 +544,6 @@ struct ispsoftc { uint32_t isp_rqstoutrp; /* register for REQOUTP */ uint32_t isp_respinrp; /* register for RESINP */ uint32_t isp_respoutrp; /* register for RESOUTP */ - NANOTIME_T isp_init_time; /* time were last initialized */ /* * Volatile state |