diff options
author | Matt Jacob <mjacob@FreeBSD.org> | 2001-07-09 19:18:00 +0000 |
---|---|---|
committer | Matt Jacob <mjacob@FreeBSD.org> | 2001-07-09 19:18:00 +0000 |
commit | 5819b85009017eda134ffd2b3315e327ca649f28 (patch) | |
tree | 24bf8d1112e02810246f0515d57608af48ace470 /sys/cam | |
parent | f0cc1c6f812957de27ecb085ec841a6205b88fc6 (diff) | |
download | src-5819b85009017eda134ffd2b3315e327ca649f28.tar.gz src-5819b85009017eda134ffd2b3315e327ca649f28.zip |
Add SYSCTL ints for default normal I/O timeout && retry counts.
This is useful if you want to dynamically move into a Fibre Channel
or Multi-initiator environment that happens to be particularly noisy
and ugly that requires a lot of retries (with shorter I/O timeouts)
for commands destried by LIPs or Bus Resets.
Reviewed by: deafening silence on audit && scsi on the retry counts
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=79483
Diffstat (limited to 'sys/cam')
-rw-r--r-- | sys/cam/scsi/scsi_da.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/sys/cam/scsi/scsi_da.c b/sys/cam/scsi/scsi_da.c index 5c705d5b1890..7301b1a46e63 100644 --- a/sys/cam/scsi/scsi_da.c +++ b/sys/cam/scsi/scsi_da.c @@ -38,6 +38,7 @@ #include <sys/systm.h> #include <sys/kernel.h> #include <sys/bio.h> +#include <sys/sysctl.h> #endif /* _KERNEL */ #include <sys/devicestat.h> @@ -277,6 +278,21 @@ static void dashutdown(void *arg, int howto); #define DA_DEFAULT_TIMEOUT 60 /* Timeout in seconds */ #endif +#ifndef DA_DEFAULT_RETRY +#define DA_DEFAULT_RETRY 4 +#endif + +static int da_retry_count = DA_DEFAULT_RETRY; +static int da_default_timeout = DA_DEFAULT_TIMEOUT; + +SYSCTL_NODE(_kern, OID_AUTO, cam, CTLFLAG_RD, 0, "CAM Subsystem"); +SYSCTL_NODE(_kern_cam, OID_AUTO, da, CTLFLAG_RD, 0, + "CAM Direct Access Disk driver"); +SYSCTL_INT(_kern_cam_da, OID_AUTO, retry_count, CTLFLAG_RW, + &da_retry_count, 0, "Normal I/O retry count"); +SYSCTL_INT(_kern_cam_da, OID_AUTO, default_timeout, CTLFLAG_RW, + &da_default_timeout, 0, "Normal I/O timeout (in seconds)"); + /* * DA_ORDEREDTAG_INTERVAL determines how often, relative * to the default timeout, we check to see whether an ordered @@ -802,7 +818,7 @@ dainit(void) } else { /* - * Schedule a periodic event to occasioanly send an + * Schedule a periodic event to occasionally send an * ordered tag to a device. */ timeout(dasendorderedtag, NULL, @@ -1103,7 +1119,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb) tag_code = MSG_SIMPLE_Q_TAG; } scsi_read_write(&start_ccb->csio, - /*retries*/4, /* retry a few times */ + /*retries*/da_retry_count, dadone, tag_code, bp->bio_cmd == BIO_READ, @@ -1114,7 +1130,7 @@ dastart(struct cam_periph *periph, union ccb *start_ccb) bp->bio_data, bp->bio_bcount, /*sense_len*/SSD_FULL_SIZE, - DA_DEFAULT_TIMEOUT * 1000); + da_default_timeout * 1000); start_ccb->ccb_h.ccb_state = DA_CCB_BUFFER_IO; /* @@ -1535,7 +1551,7 @@ dasendorderedtag(void *arg) } /* Queue us up again */ timeout(dasendorderedtag, NULL, - (DA_DEFAULT_TIMEOUT * hz) / DA_ORDEREDTAG_INTERVAL); + (da_default_timeout * hz) / DA_ORDEREDTAG_INTERVAL); } /* |