Date: Fri, 5 Jan 2007 00:34:30 GMT From: Matt Jacob <mjacob@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 112508 for review Message-ID: <200701050034.l050YUQm067275@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=112508 Change 112508 by mjacob@mjexp on 2007/01/05 00:33:33 Add code to help test multipathing by putting in a sysctl per-MPT instance that will fail commands to the next target_id that matches to this mpt with a SELECTION FAILURE. The default for this code is to be turned off. Affected files ... .. //depot/projects/mjexp/sys/dev/mpt/mpt.c#4 edit .. //depot/projects/mjexp/sys/dev/mpt/mpt.h#4 edit .. //depot/projects/mjexp/sys/dev/mpt/mpt_cam.c#6 edit Differences ... ==== //depot/projects/mjexp/sys/dev/mpt/mpt.c#4 (text+ko) ==== @@ -2000,7 +2000,12 @@ SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, "role", CTLFLAG_RD, &mpt->role, 0, "HBA role"); +#ifdef MPT_TEST_MULTIPATH + SYSCTL_ADD_INT(ctx, SYSCTL_CHILDREN(tree), OID_AUTO, + "failure_id", CTLFLAG_RW, &mpt->failure_id, -1, + "Next Target to Fail"); #endif +#endif } int @@ -2120,6 +2125,9 @@ } STAILQ_INIT(&mpt->trt_wildcard.atios); STAILQ_INIT(&mpt->trt_wildcard.inots); +#ifdef MPT_TEST_MULTIPATH + mpt->failure_id = -1; +#endif mpt->scsi_tgt_handler_id = MPT_HANDLER_ID_NONE; mpt_sysctl_attach(mpt); mpt_lprt(mpt, MPT_PRT_DEBUG, "doorbell req = %s\n", ==== //depot/projects/mjexp/sys/dev/mpt/mpt.h#4 (text+ko) ==== @@ -159,6 +159,7 @@ #define MPT_U64_2_SCALAR(y) ((((uint64_t)y.High) << 32) | (y.Low)) /****************************** Misc Definitions ******************************/ +/* #define MPT_TEST_MULTIPATH 1 */ #define MPT_OK (0) #define MPT_FAIL (0x10000) @@ -535,6 +536,9 @@ u_int role; /* role: none, ini, target, both */ u_int verbose; +#ifdef MPT_TEST_MULTIPATH + int failure_id; +#endif /* * IOC Facts ==== //depot/projects/mjexp/sys/dev/mpt/mpt_cam.c#6 (text+ko) ==== @@ -2907,6 +2907,13 @@ mpt_set_ccb_status(ccb, CAM_REQ_INVALID); break; } +#ifdef MPT_TEST_MULTIPATH + if (mpt->failure_id == ccb->ccb_h.target_id) { + ccb->ccb_h.status &= ~CAM_SIM_QUEUED; + mpt_set_ccb_status(ccb, CAM_SEL_TIMEOUT); + break; + } +#endif ccb->csio.scsi_status = SCSI_STATUS_OK; mpt_start(sim, ccb); return;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200701050034.l050YUQm067275>