NetBSD Problem Report #43257

From Wolfgang.Stukenbrock@nagler-company.com  Wed May  5 11:56:34 2010
Return-Path: <Wolfgang.Stukenbrock@nagler-company.com>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by www.NetBSD.org (Postfix) with ESMTP id 8520B63B8FE
	for <gnats-bugs@gnats.NetBSD.org>; Wed,  5 May 2010 11:56:34 +0000 (UTC)
Message-Id: <20100505115631.17F5B4EAA1A@s012.nagler-company.com>
Date: Wed,  5 May 2010 13:56:31 +0200 (CEST)
From: Wolfgang.Stukenbrock@nagler-company.com
Reply-To: Wolfgang.Stukenbrock@nagler-company.com
To: gnats-bugs@gnats.NetBSD.org
Subject: default SCSI-tape timeing parameters not selectable by kernel config
X-Send-Pr-Version: 3.95

>Number:         43257
>Category:       kern
>Synopsis:       default SCSI-tape timeing parameters not selectable by kernel config
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Wed May 05 12:00:01 +0000 2010
>Last-Modified:  Thu May 13 18:30:02 +0000 2010
>Originator:     W. Stukenbrock
>Release:        NetBSD 5.0.2
>Organization:
Dr. Nagler & Company GmbH

>Environment:


System: NetBSD s012 4.0 NetBSD 4.0 (NSW-S012) #11: Fri Mar 26 15:01:49 CET 2010 root@s012:/usr/src/sys/arch/amd64/compile/NSW-S012 amd64
Architecture: x86_64
Machine: amd64
>Description:
	The timeing parameter ST_IO_TIME, ST_CTL_TIME and ST_SPC_TIME are defined in /usr/src/sys/dev/scsipi/stvar.h
	and cannot be changed by kernel config.
	For some Tape devices the defined values are too small, so timeouts happens in non-error situations.
>How-To-Repeat:
	not relevant
>Fix:
	The following patch will make ST_IO_TIME, ST_CTL_TIME and ST_SPC_TIME configurable in the
	kernel config. The previous values are kept as default.
	The files /usr/src/sys/dev/scsipi/stvar.h and /usr/src/sys/dev/scsipi/files.scsipi are affected.

--- stvar.h     2010/05/05 11:45:52     1.1
+++ stvar.h     2010/05/05 11:49:02
@@ -57,9 +57,18 @@
 #include <dev/scsipi/scsipi_all.h>
 #include <dev/scsipi/scsiconf.h>

+#include "opt_scsi.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 */
+#endif
+#ifndef ST_CTL_TIME
 #define        ST_CTL_TIME     (30 * 1000)             /* 30 seconds */
+#endif
+#ifndef ST_SPC_TIME
 #define        ST_SPC_TIME     (4 * 60 * 60 * 1000)    /* 4 hours */
+#endif

 #define        ST_RETRIES      4       /* only on non IO commands */


--- files.scsipi        2010/05/05 11:45:52     1.1
+++ files.scsipi        2010/05/05 11:46:26
@@ -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

>Audit-Trail:
From: Andrew Doran <ad@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/43257: default SCSI-tape timeing parameters not
	selectable by kernel config
Date: Wed, 5 May 2010 12:27:50 +0000

 Thanks for the patch.  On the approach: these should be tuneable via sysctl
 and not kernel options.

From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/43257: default SCSI-tape timeing parameters not
	selectable by kernel config
Date: Thu, 13 May 2010 06:30:53 +0000

 On Wed, May 05, 2010 at 12:30:04PM +0000, Andrew Doran wrote:
  >  Thanks for the patch.  On the approach: these should be tuneable via sysctl
  >  and not kernel options.

 Shouldn't they be device properties?

 -- 
 David A. Holland
 dholland@netbsd.org

From: Andrew Doran <ad@NetBSD.org>
To: gnats-bugs@NetBSD.org
Cc: kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, Wolfgang.Stukenbrock@nagler-company.com
Subject: Re: kern/43257: default SCSI-tape timeing parameters not
	selectable by kernel config
Date: Thu, 13 May 2010 09:48:22 +0000

 On Thu, May 13, 2010 at 06:35:02AM +0000, David Holland wrote:
 > The following reply was made to PR kern/43257; it has been noted by GNATS.
 > 
 > From: David Holland <dholland-bugs@netbsd.org>
 > To: gnats-bugs@NetBSD.org
 > Cc: 
 > Subject: Re: kern/43257: default SCSI-tape timeing parameters not
 > 	selectable by kernel config
 > Date: Thu, 13 May 2010 06:30:53 +0000
 > 
 >  On Wed, May 05, 2010 at 12:30:04PM +0000, Andrew Doran wrote:
 >   >  Thanks for the patch.  On the approach: these should be tuneable via sysctl
 >   >  and not kernel options.
 >  
 >  Shouldn't they be device properties?

 If the user can set them without recompiling the kernel, sure that
 would work too.

From: Wolfgang.Stukenbrock@nagler-company.com
To: "Andrew Doran" <ad@netbsd.org>
Cc: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org,
        netbsd-bugs@netbsd.org, Wolfgang.Stukenbrock@nagler-company.com
Subject: Re: kern/43257: default SCSI-tape timeing parameters not
	selectable by kernel config
Date: Thu, 13 May 2010 12:22:39 +0200

 Hi, again.

 If the parameters are settable during startup via sysctl.conf that would be
 nice and may obsolete the ability to change the "global" kernal defaults.
 But I think it does not hurt to make the kernel-defaults selecatable =20
 too as done at many other places too. (And that will enable the admin =20
 to work around tape-problems immediatly without other "still =20
 outstanding" kernel changes.)

 Neverless it would be very smart to have these parameters available on =20
 a per device basis. These parameters are of cause tape-device dependent.
 Accedently I have currently no idea how to integrate this.
 It is no sollution - my oppinion - to make them selectable via ioctl =20
 or something like this, because no "normal" backup-system would ever =20
 use them or have a usable stub to set them.
 It does not realy hurt to have such a feature, but it introduces some =20
 semantic problems:
 - when does a reset to the "default" values occure?
 -- on every close? -> need to set them after every open again - not usefull
 -- only with a special ioctl? -> possible unexpected side effects =20
 between different applications - may be problematic
 -- after disconnect/reconnect of the device - e.g. after Timeouts?

 The best way would be to use something like the sysctl interface for =20
 that - again my opinion.

 If it would be possible to distinguish between "global" defaults for =20
 all devices and device-specific defaults in the sysctl interface that =20
 should be sollution for this problem.
 Sun has such a feature by selecting the device in a first call and =20
 accessing it in additional calls, but this is problematic and if two =20
 processes try to use it at the same time, wrong information gets =20
 retrieved an/or set ...
 I don't know much about the possibilities of the sysctl-interface in =20
 NetBSD in respect of accessing device specific parameters. The set of =20
 devices will change over time due to connect/disconnect of devices =20
 (eg. USB or after "scsictl scan").
 I'm not shure if it would be a good idea to remember setting for =20
 device nodes accross disconnect/connect sequences. On the other hand, =20
 we will loose the setup for special devices after disconnect/connect =20
 if we drop them ...
 An other way may be to have different sets of default parameters =20
 depending on the device identification. But that requires more changes =20
 in the st-driver I think. And there must be an interface to control =20
 this during startup. (It makes no sence to have more than one set of =20
 default parameters compiled into the kernel. And to compile all setups =20
 statically into the kernel is not very user-friendly ...)

 Best reguards,

 W. Stukenbrock

 Zitat von "Andrew Doran" <ad@netbsd.org>:

 > On Thu, May 13, 2010 at 06:35:02AM +0000, David Holland wrote:
 >> The following reply was made to PR kern/43257; it has been noted by GNATS=
 .
 >>
 >> From: David Holland <dholland-bugs@netbsd.org>
 >> To: gnats-bugs@NetBSD.org
 >> Cc:
 >> Subject: Re: kern/43257: default SCSI-tape timeing parameters not
 >> =09selectable by kernel config
 >> Date: Thu, 13 May 2010 06:30:53 +0000
 >>
 >>  On Wed, May 05, 2010 at 12:30:04PM +0000, Andrew Doran wrote:
 >>   >  Thanks for the patch.  On the approach: these should be =20
 >> tuneable via sysctl
 >>   >  and not kernel options.
 >>
 >>  Shouldn't they be device properties?
 >
 > If the user can set them without recompiling the kernel, sure that
 > would work too.
 >
 >


From: David Holland <dholland-bugs@netbsd.org>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: kern/43257: default SCSI-tape timeing parameters not
	selectable by kernel config
Date: Thu, 13 May 2010 18:28:22 +0000

 On Thu, May 13, 2010 at 10:25:02AM +0000, Wolfgang.Stukenbrock@nagler-company.com wrote:
  >  I don't know much about the possibilities of the sysctl-interface in
  >  NetBSD in respect of accessing device specific parameters. The set of
  >  devices will change over time due to connect/disconnect of devices
  >  (eg. USB or after "scsictl scan").

 me either, for the time being at least.

 I think the right way is one set of sysctls for the defaults and one
 for each attached st. However... realistically, how many people have
 multiple different tape devices in the same box? Probably one set of
 settings is good enough...

  >  I'm not shure if it would be a good idea to remember setting for
  >  device nodes accross disconnect/connect sequences. On the other hand,
  >  we will loose the setup for special devices after disconnect/connect
  >  if we drop them ...

 I doubt that can be done safely; if a new st appears, there's not
 likely to be any easy way to tell if it's the same one that
 disappeared a few minutes ago or not; also, one reason someone might
 unplug and reinsert a device is to reset things, so I'm not sure it
 would even be desirable.

 -- 
 David A. Holland
 dholland@netbsd.org

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.