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
This commit is contained in:
parent
1b82a02868
commit
cc88f49f47
@ -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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
Loading…
x
Reference in New Issue
Block a user