summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorken <ken@FreeBSD.org>2017-08-02 20:24:26 +0000
committerken <ken@FreeBSD.org>2017-08-02 20:24:26 +0000
commitf578767e954bb6ef856868c1ec5e70961aebde13 (patch)
treec0789c9974dea008ac73b22f80e3b3ccd98c4de4
parent6ddc088f7330fc8f74e7e25e99e9ec4d76a2dd75 (diff)
downloadFreeBSD-src-f578767e954bb6ef856868c1ec5e70961aebde13.zip
FreeBSD-src-f578767e954bb6ef856868c1ec5e70961aebde13.tar.gz
MFC r321622, r321623:
------------------------------------------------------------------------ r321622 | ken | 2017-07-27 09:33:57 -0600 (Thu, 27 Jul 2017) | 44 lines Fix probing FC targets with hard addressing turned on. This largely reverts FreeBSD SVN change 289937 from October 25th, 2015. The intent of that change was to keep loop IDs persistent across chip reinits. The problem is that the change turned on the PREVLOOP / PREV_ADDRESS bit (bit 7 in Firmware Options 2), which tells the Qlogic chip to not participate in the loop if it can't get the requested loop address. It also turned off soft addressing on 2400 (4Gb) and newer controllers. The isp(4) driver defaults to loop address 0, and the tape drives I have tested default to loop address 0 if hard addressing is turned on. So when hard loop addressing is turned on on the drive, the isp(4) driver just refuses to participate in the loop. The solution is to largely revert that change. I left some elements in place that are related to virtual ports, since they were new. This does work with IBM tape drives with hard and soft addressing turned on. I have tested it with 4Gb, 8Gb, and 16Gb controllers. sys/dev/isp.c: Largely revert FreeBSD SVN change 289937. I left the ispmbox.h changes in place. Don't use the PREV_ADDRESS bit on initialization. It tells the chip to not participate if it can't get the requested loop ID. Do use soft addressing on 2400 and newer chips. Use hard addressing when the user has requested a specific initiator ID. (hint.isp.X.iid=N in /boot/loader.conf) Leave some of the virtual port options from that change in place, but don't turn on the PREV_ADDRESS bit. Reviewed by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------ r321623 | ken | 2017-07-27 09:51:56 -0600 (Thu, 27 Jul 2017) | 6 lines Remove duplicate assignments from r321622. Submitted by: mav Sponsored by: Spectra Logic ------------------------------------------------------------------------
-rw-r--r--sys/dev/isp/isp.c54
1 files changed, 33 insertions, 21 deletions
diff --git a/sys/dev/isp/isp.c b/sys/dev/isp/isp.c
index af6f51e..6741e39 100644
--- a/sys/dev/isp/isp.c
+++ b/sys/dev/isp/isp.c
@@ -1631,6 +1631,7 @@ isp_fibre_init(ispsoftc_t *isp)
fcparam *fcp;
isp_icb_t local, *icbp = &local;
mbreg_t mbs;
+ int ownloopid;
/*
* We only support one channel on non-24XX cards
@@ -1709,12 +1710,19 @@ isp_fibre_init(ispsoftc_t *isp)
}
icbp->icb_retry_delay = fcp->isp_retry_delay;
icbp->icb_retry_count = fcp->isp_retry_count;
- if (fcp->isp_loopid < LOCAL_LOOP_LIM) {
- icbp->icb_hardaddr = fcp->isp_loopid;
- if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
- icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS;
- else
- icbp->icb_fwoptions |= ICBOPT_PREV_ADDRESS;
+ icbp->icb_hardaddr = fcp->isp_loopid;
+ ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0;
+ if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) {
+ icbp->icb_hardaddr = 0;
+ ownloopid = 0;
+ }
+
+ /*
+ * Our life seems so much better with 2200s and later with
+ * the latest f/w if we set Hard Address.
+ */
+ if (ownloopid || ISP_FW_NEWER_THAN(isp, 2, 2, 5)) {
+ icbp->icb_fwoptions |= ICBOPT_HARD_ADDRESS;
}
/*
@@ -1951,6 +1959,7 @@ isp_fibre_init_2400(ispsoftc_t *isp)
isp_icb_2400_t local, *icbp = &local;
mbreg_t mbs;
int chan;
+ int ownloopid = 0;
/*
* Check to see whether all channels have *some* kind of role
@@ -2023,14 +2032,17 @@ isp_fibre_init_2400(ispsoftc_t *isp)
icbp->icb_xchgcnt >>= 1;
}
- if (fcp->isp_loopid < LOCAL_LOOP_LIM) {
- icbp->icb_hardaddr = fcp->isp_loopid;
- if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
- icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS;
- else
- icbp->icb_fwoptions1 |= ICB2400_OPT1_PREV_ADDRESS;
+
+ ownloopid = (isp->isp_confopts & ISP_CFG_OWNLOOPID) != 0;
+ icbp->icb_hardaddr = fcp->isp_loopid;
+ if (icbp->icb_hardaddr >= LOCAL_LOOP_LIM) {
+ icbp->icb_hardaddr = 0;
+ ownloopid = 0;
}
+ if (ownloopid)
+ icbp->icb_fwoptions1 |= ICB2400_OPT1_HARD_ADDRESS;
+
if (isp->isp_confopts & ISP_CFG_NOFCTAPE) {
icbp->icb_fwoptions2 &= ~ICB2400_OPT2_FCTAPE;
}
@@ -2132,6 +2144,9 @@ isp_fibre_init_2400(ispsoftc_t *isp)
break;
}
}
+ if (ownloopid == 0) {
+ icbp->icb_fwoptions3 |= ICB2400_OPT3_SOFTID;
+ }
icbp->icb_logintime = ICB_LOGIN_TOV;
if (fcp->isp_wwnn && fcp->isp_wwpn) {
@@ -2244,13 +2259,12 @@ isp_fibre_init_2400(ispsoftc_t *isp)
pi.vp_port_options |= ICB2400_VPOPT_INI_ENABLE;
if ((fcp2->role & ISP_ROLE_TARGET) == 0)
pi.vp_port_options |= ICB2400_VPOPT_TGT_DISABLE;
- }
- if (fcp2->isp_loopid < LOCAL_LOOP_LIM) {
- pi.vp_port_loopid = fcp2->isp_loopid;
- if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
- pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS;
- else
- pi.vp_port_options |= ICB2400_VPOPT_PREV_ADDRESS;
+ if (fcp2->isp_loopid < LOCAL_LOOP_LIM) {
+ pi.vp_port_loopid = fcp2->isp_loopid;
+ if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
+ pi.vp_port_options |= ICB2400_VPOPT_HARD_ADDRESS;
+ }
+
}
MAKE_NODE_NAME_FROM_WWN(pi.vp_port_portname, fcp2->isp_wwpn);
MAKE_NODE_NAME_FROM_WWN(pi.vp_port_nodename, fcp2->isp_wwnn);
@@ -2329,8 +2343,6 @@ isp_fc_enable_vp(ispsoftc_t *isp, int chan)
vp.vp_mod_ports[0].loopid = fcp->isp_loopid;
if (isp->isp_confopts & ISP_CFG_OWNLOOPID)
vp.vp_mod_ports[0].options |= ICB2400_VPOPT_HARD_ADDRESS;
- else
- vp.vp_mod_ports[0].options |= ICB2400_VPOPT_PREV_ADDRESS;
}
MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwpn, fcp->isp_wwpn);
MAKE_NODE_NAME_FROM_WWN(vp.vp_mod_ports[0].wwnn, fcp->isp_wwnn);
OpenPOWER on IntegriCloud