Date: Thu, 28 Sep 2006 18:03:28 -0700 (PDT) From: mjacob@freebsd.org To: Ade Lovett <ade@freebsd.org> Cc: scsi@freebsd.org Subject: Re: hysteresis for CAM_RESRC_UNAVAIL Message-ID: <20060928180213.A2682@ns1.feral.com> In-Reply-To: <026A0839-92B8-42CC-A42D-BB1658923180@freebsd.org> References: <20060926085839.Q98053@ns1.feral.com> <4519A603.8080108@samsco.org> <92A8EEB3-28FD-45A2-8099-AD0942820C4B@FreeBSD.org> <20060926193731.G5448@ns1.feral.com> <D065D6AF-93EC-432A-A3B4-3F90D1645DE0@freebsd.org> <20060926201700.I5664@ns1.feral.com> <026A0839-92B8-42CC-A42D-BB1658923180@freebsd.org>
index | next in thread | previous in thread | raw e-mail
[-- Attachment #1 --]
On Tue, 26 Sep 2006, Ade Lovett wrote:
>
> On Sep 26, 2006, at 20:18 , mjacob@freebsd.org wrote:
>> I'll redo this with a tunable and send out again. Should I include BUSY
>> status as well?
See attached.
[-- Attachment #2 --]
Index: cam_periph.c
===================================================================
RCS file: /home/ncvs/src/sys/cam/cam_periph.c,v
retrieving revision 1.62
diff -u -r1.62 cam_periph.c
--- cam_periph.c 24 May 2006 15:22:21 -0000 1.62
+++ cam_periph.c 29 Sep 2006 01:03:01 -0000
@@ -86,6 +86,14 @@
MALLOC_DEFINE(M_CAMPERIPH, "CAM periph", "CAM peripheral buffers");
+static int periph_selto_delay = 1000;
+TUNABLE_INT("kern.cam.periph_selto_delay", &periph_selto_delay);
+static int periph_noresrc_delay = 500;
+TUNABLE_INT("kern.cam.periph_noresrc_delay", &periph_noresrc_delay);
+static int periph_busy_delay = 500;
+TUNABLE_INT("kern.cam.periph_busy_delay", &periph_busy_delay);
+
+
void
periphdriver_register(void *data)
{
@@ -1544,7 +1552,7 @@
int error, printed = 0;
int openings;
u_int32_t relsim_flags;
- u_int32_t timeout;
+ u_int32_t timeout = 0;
action_string = NULL;
status = ccb->ccb_h.status;
@@ -1636,11 +1644,11 @@
}
/*
- * Wait a second to give the device
+ * Wait a biit to give the device
* time to recover before we try again.
*/
relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT;
- timeout = 1000;
+ timeout = periph_selto_delay;
break;
}
}
@@ -1699,8 +1707,16 @@
}
break;
case CAM_RESRC_UNAVAIL:
+ /* Wait a bit for the resource shortage to abate. */
+ timeout = periph_noresrc_delay;
+ /* FALLTHROUGH */
case CAM_BUSY:
- /* timeout??? */
+ if (timeout == 0) {
+ /* Wait a bit for the busy condition to abate. */
+ timeout = periph_busy_delay;
+ }
+ relsim_flags = RELSIM_RELEASE_AFTER_TIMEOUT;
+ /* FALLTHROUGH */
default:
/* decrement the number of retries */
if (ccb->ccb_h.retry_count > 0) {
help
Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060928180213.A2682>
