NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/41886: missing feature to define timeout values for ST device in kernel config

>Number:         41886
>Category:       kern
>Synopsis:       missing feature to define timeout values for ST device in 
>kernel config
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Thu Aug 13 16:25:00 +0000 2009
>Originator:     Wolfgang Stukenbrock
>Release:        NetBSD 4.0
Dr. Nagler & Company GmbH
System: NetBSD s012 4.0 NetBSD 4.0 (NSW-S012) #9: Fri Mar 13 12:31:52 CET 2009 
wgstuken@s012:/usr/src/sys/arch/amd64/compile/NSW-S012 amd64
Architecture: x86_64
Machine: amd64
        The three timeout values of the st(4) evice driver are defined as fixed 
values in /usr/src/sys/dev/scsipi/stvar.h.
        There is no way th change them via kernel configuration.
        E.g. the timeout for th sd(4) is changeble via kernel configuration by 
defining the option SD_IO_TIMEOUT.

        Now there seems to be at least on tape, where the 3 minutes IO-timeout 
is to short - one of our VXA-320 tapes ...
        It would be nice to have the option to change the timeout for a tape 
device - e.g. in the kernel configuration.

        The fix below defines three new kernel config options to overwrite the 
current default values from stvar.h.

        Of cause - the best way would be to allow different timeouts for each 
tape device in the system and use the current values as default
        during attach. But this requires larger changes to some files and a 
user-level program to set the values.
        For tape devices the mt(1) command is used, but changing timeout 
parameters would be an possibly incompartible extension in this program.

        The best way from my point of view would be to move the timeout 
handling in the SCSI-bus layer and no longer pass timeouts from the device
        drivers to the low-level drivers. The drivers should set the currently 
used values as default values in the SCSI-bus layer during attach.
        The scsictl(8) program should be expanded to show and change them then 
- for each target and perhaps each lun!
        Changable SCSI-timeouts should be a function of the SCSI-bus layer and 
not of the devices build on top of that.

        Neverless this requires much more work as simply allowing to set the 
default values via kernel config.
        I hope some other developers can implement this idea in a future 
version of NetBSD. It would be very great!
        Neverless the patch in this report makes sence even if this gets 
        not relevant - enhancment request ...
        The following two diffs changes /usr/src/sys/dev/scsipi/files.scsipi 
and /usr/src/sys/dev/scsipi/stvar.h.

        I've added a multi-include-barrier to stvar.h too, as found sdvar.h. It 
is of cause not realy needed, but so it is consistent to sdvar.h.

        remark: I haven't changed the names of the definitions currently used. 
It may make sence to use ST_IO_TIMEOUT etc. in order to use
                the same nameing convention as in sdvar.h. Feel free to change 
it, but you need to change it in /usr/src/sys/dev/scsipi/st.c too.

--- files.scsipi        2009/08/13 15:09:08     1.1
+++ files.scsipi        2009/08/13 15:10:02
@@ -7,6 +7,7 @@
 defflag        opt_scsi.h              SCSIVERBOSE ST_ENABLE_EARLYWARN
                                SES_ENABLE_PASSTHROUGH SCSI_OLD_NOINQUIRY
 defparam opt_scsi.h            ST_MOUNT_DELAY SDRETRIES SD_IO_TIMEOUT
+                               ST_IO_TIME ST_CTL_TIME ST_SPC_TIME
 defflag        opt_scsipi_debug.h      SCSIPI_DEBUG
 defparam opt_scsipi_debug.h    SCSIPI_DEBUG_TYPE
--- stvar.h     2009/08/13 15:09:08     1.1
+++ stvar.h     2009/08/13 15:51:11
@@ -56,6 +56,11 @@
  * A lot of rewhacking done by mjacob (
+#include "opt_scsi.h"
 #include "rnd.h"
 #if NRND > 0
 #include <sys/rnd.h>
@@ -64,9 +69,16 @@
 #include <dev/scsipi/scsipi_all.h>
 #include <dev/scsipi/scsiconf.h>
+/* default values for timeout paramters - may be overwritten in kernel config 
+#ifndef        ST_IO_TIME
 #define        ST_IO_TIME      (3 * 60 * 1000)         /* 3 minutes */
+#ifndef        ST_CTL_TIME
 #define        ST_CTL_TIME     (30 * 1000)             /* 30 seconds */
+#ifndef        ST_SPC_TIME
 #define        ST_SPC_TIME     (4 * 60 * 60 * 1000)    /* 4 hours */
 #define        ST_RETRIES      4       /* only on non IO commands */
@@ -190,3 +202,5 @@
 int    stdetach(struct device *, int);
 extern struct cfdriver st_cd;
+#endif /* _DEV_SCSIPI_STVAR_H_ */


Home | Main Index | Thread Index | Old Index