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

Re: Adaptec scsi driver OBSD 3.3 question



2-5 seconds? Let's think about that.

Let's say our hypothetical SCSI card has a single drive attached to it.

According to the spec a Selection Time Out (STO) asserts busy for at
least 250ms. An STO happens when the initiator asserts BUSY, SELECT and
ATTENTION with an unused target id. This happens for example when the OS
issues an INQUIRY command to ALL target ID's during boot. So in our
little example we have 1 drive and thus 14 STO's. That makes it roughly
3.5 seconds.
An INQUIRY is an "expensive" command because the drive needs to collect
a whole bunch of data. In normal circumstances the drive will disconnect
from the bus; collect the data; reconnect to the initiator and return
the data. Depending on the drive this can take up to a few hundred mili
seconds (the newer U320 models can really take a while). This also
assumes that everything actually is functioning as it should. So just
executing the scan takes lets say 4 seconds. With your numbers you only
have a 1 second window of opportunity for something to get corrected.
That is not a whole lot in SCSI land where smart devices go off and "do
something". This assumes also no LUN support and does not mention all
the OS administrative commands it issues during boot(READ CAPICITY,
READ(10) etc).

Attached is a SCSI trace of me powering on a box with a drive attached
to a SCSI card.
You'll see several INQUIRY's (0x12) but only the last one in the
sequence is relevant for this discussion. (ok, so I powered up the box
and went into the BIOS; regular POST causes all kinds of crap on the
bus). This is also a very old drive (I believe 95-ish) that does not
take as long on an INQUIRY as newer ones. It is interesting to note that
a STO takes quite a bit longer than 250ms because of setup time and bus
free time.

Protocol Phase Analysis
   File name: OINK.DTT
Marker range: Beg of File to End of File
Session name: None
Session desc: None
 Session ids: iids:7 tid(lun)[devtype]:0(0-7)[0]
Sess filters: None
Session date: 3-May-03  11:09:38 - 11:10:29
NNNNN = Phase Event Number (1st event is 0)
SS.mmm_uuu_nnn = Difference Time (Secs.milli_micro_nano)
NNNNN SS.mmm_uuu_nnn
    0 35.400_197_524 Bus Free
    1         67_460 Bus Reset
    2  4.480_724_888 Bus Free
    3          2_400  Arb
    4          1_360  Arbwin 7
    5          2_048 +Select 7,0
    6          1_672 +Sel/Resel End
    7          6_388 +MsgOut C0 Identify
    8         11_204  CMD - Inquiry     
                       12 00 00 00 20 00
    9         13_308  MsgIn  04 Disconnect
   10      3_912_228 Bus Free
   11          3_192  Arb
   12          1_800  Arbwin 0
   13          1_596  Resel  7,0
   14          0_500  Sel/Resel End
   15          6_140  MsgIn  80 Identify
   16         14_056  DataIn (N)
                       00 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
   17        569_120  DEnd  32 Bytes
   18          2_396  Status 00 Good
   19          1_900  MsgIn  00 Cmd Complete
   20      1_004_680 Bus Free
   21          2_400  Arb
   22          1_360  Arbwin 7
   23          2_252 +Select 7,0
   24          1_652 +Sel/Resel End
   25          6_392 +MsgOut C1 Identify
   26         11_208  CMD - Inquiry     
                       12 00 00 00 20 00
   27         13_304  MsgIn  04 Disconnect
   28      3_845_436 Bus Free
   29          3_192  Arb
   30          1_800  Arbwin 0
   31          1_592  Resel  7,0
   32          0_504  Sel/Resel End
   33          5_736  MsgIn  81 Identify
   34         13_500  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
   35        570_476  DEnd  32 Bytes
   36          2_396  Status 00 Good
   37          1_900  MsgIn  00 Cmd Complete
   38        962_792 Bus Free
   39          2_400  Arb
   40          1_360  Arbwin 7
   41          2_100 +Select 7,0
   42          1_700 +Sel/Resel End
   43          6_392 +MsgOut C2 Identify
   44         11_204  CMD - Inquiry     
                       12 00 00 00 20 00
   45         13_308  MsgIn  04 Disconnect
   46      3_861_832 Bus Free
   47          3_192  Arb
   48          1_800  Arbwin 0
   49          1_592  Resel  7,0
   50          0_504  Sel/Resel End
   51         12_740  MsgIn  82 Identify
   52         13_456  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
   53        563_120  DEnd  32 Bytes
   54          2_396  Status 00 Good
   55          1_900  MsgIn  00 Cmd Complete
   56        946_292 Bus Free
   57          2_400  Arb
   58          1_360  Arbwin 7
   59          2_200 +Select 7,0
   60          1_704 +Sel/Resel End
   61          6_388 +MsgOut C3 Identify
   62         11_204  CMD - Inquiry     
                       12 00 00 00 20 00
   63         13_308  MsgIn  04 Disconnect
   64      3_906_624 Bus Free
   65          3_192  Arb
   66          1_800  Arbwin 0
   67          1_596  Resel  7,0
   68          0_504  Sel/Resel End
   69          6_140  MsgIn  83 Identify
   70         13_944  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
   71        588_828  DEnd  32 Bytes
   72          2_400  Status 00 Good
   73          7_900  MsgIn  00 Cmd Complete
   74        964_800 Bus Free
   75          2_404  Arb
   76          1_356  Arbwin 7
   77          2_104 +Select 7,0
   78          1_680 +Sel/Resel End
   79          6_392 +MsgOut C4 Identify
   80         11_204  CMD - Inquiry     
                       12 00 00 00 20 00
   81         13_108  MsgIn  04 Disconnect
   82      3_886_028 Bus Free
   83          3_192  Arb
   84          1_800  Arbwin 0
   85          1_592  Resel  7,0
   86          0_504  Sel/Resel End
   87          5_888  MsgIn  84 Identify
   88         19_104  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
   89        564_324  DEnd  32 Bytes
   90          2_400  Status 00 Good
   91          1_900  MsgIn  00 Cmd Complete
   92        951_312 Bus Free
   93          2_400  Arb
   94          1_360  Arbwin 7
   95          2_204 +Select 7,0
   96          1_676 +Sel/Resel End
   97          6_384 +MsgOut C5 Identify
   98         11_004  CMD - Inquiry     
                       12 00 00 00 20 00
   99         13_108  MsgIn  04 Disconnect
  100      3_851_628 Bus Free
  101          3_200  Arb
  102          1_800  Arbwin 0
  103          1_596  Resel  7,0
  104          0_500  Sel/Resel End
  105          5_940  MsgIn  85 Identify
  106         14_000  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
  107        569_772  DEnd  32 Bytes
  108          2_400  Status 00 Good
  109          1_900  MsgIn  00 Cmd Complete
  110        957_016 Bus Free
  111          2_400  Arb
  112          1_360  Arbwin 7
  113          2_100 +Select 7,0
  114          1_672 +Sel/Resel End
  115          6_392 +MsgOut C6 Identify
  116         11_204  CMD - Inquiry     
                       12 00 00 00 20 00
  117         13_316  MsgIn  04 Disconnect
  118      3_846_032 Bus Free
  119          3_188  Arb
  120          1_796  Arbwin 0
  121          1_592  Resel  7,0
  122          0_504  Sel/Resel End
  123          6_340  MsgIn  86 Identify
  124         14_004  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
  125        568_776  DEnd  32 Bytes
  126          3_000  Status 00 Good
  127          1_900  MsgIn  00 Cmd Complete
  128        962_216 Bus Free
  129          2_400  Arb
  130          1_360  Arbwin 7
  131          2_100 +Select 7,0
  132          1_672 +Sel/Resel End
  133          6_392 +MsgOut C7 Identify
  134         11_008  CMD - Inquiry     
                       12 00 00 00 20 00
  135         13_100  MsgIn  04 Disconnect
  136      3_859_836 Bus Free
  137          3_192  Arb
  138          1_800  Arbwin 0
  139          1_592  Resel  7,0
  140          0_504  Sel/Resel End
  141          6_084  MsgIn  87 Identify
  142         20_560  DataIn (N)
                       7F 00 02 02 8F 00 01 3E .......>
                       53 45 41 47 41 54 45 20 SEAGATE 
                       53 54 33 32 35 35 30 57 ST32550W
                       20 20 20 20 20 20 20 20         
                      (32 Bytes)
  143        562_872  DEnd  32 Bytes
  144          2_400  Status 00 Good
  145          1_900  MsgIn  00 Cmd Complete
  146        952_120 Bus Free
  147          2_400  Arb
  148          1_360  Arbwin 7
  149    262_450_744 +Select 7,1
  150        976_040 Bus Free
  151          2_400  Arb
  152          1_360  Arbwin 7
  153    262_450_748 +Select 7,2
  154        993_840 Bus Free
  155          2_400  Arb
  156          1_360  Arbwin 7
  157    262_450_748 +Select 7,3
  158        978_840 Bus Free
  159          2_400  Arb
  160          1_360  Arbwin 7
  161    262_450_752 +Select 7,4
  162      1_007_436 Bus Free
  163          2_404  Arb
  164          1_360  Arbwin 7
  165    262_450_748 +Select 7,5
  166        994_840 Bus Free
  167          2_400  Arb
  168          1_360  Arbwin 7
  169    262_450_752 +Select 7,6
  170      1_572_936 Bus Free
  171          2_404  Arb
  172          1_360  Arbwin 7
  173    262_450_752 +Select 7,8
  174        980_336 Bus Free
  175          2_400  Arb
  176          1_360  Arbwin 7
  177    262_450_756 +Select 7,9
  178        978_036 Bus Free
  179          2_400  Arb
  180          1_360  Arbwin 7
  181    262_450_760 +Select 7,10
  182        993_936 Bus Free
  183          2_400  Arb
  184          1_360  Arbwin 7
  185    262_450_756 +Select 7,11
  186        978_840 Bus Free
  187          2_400  Arb
  188          1_360  Arbwin 7
  189    262_450_756 +Select 7,12
  190        978_236 Bus Free
  191          2_400  Arb
  192          1_360  Arbwin 7
  193    262_450_760 +Select 7,13
  194        993_136 Bus Free
  195          2_404  Arb
  196          1_360  Arbwin 7
  197    262_450_760 +Select 7,14
  198        977_936 Bus Free
  199          2_400  Arb
  200          1_360  Arbwin 7
  201    262_450_756 +Select 7,15
  202          0_000 Bus Free

> -----Original Message-----
> From: owner-tech@openbsd.org [mailto:owner-tech@openbsd.org] 
> On Behalf Of J.D. Bronson
> Sent: Saturday, May 03, 2003 08:43
> To: tech@openbsd.org
> Subject: Adaptec scsi driver OBSD 3.3 question
> 
> 
> I currently have an Intel motherboard that has onboard:
> ahc0 at pci0 dev 12 function 0 "Adaptec AIC-7896/7 U2" rev 
> 0x00: irq 11
> ahc0: aic7896/97: Ultra2 Wide Channel A, SCSI Id=7, 32/255 SCBs
> 
> While looking for something else,
> 
> I noticed this in ahc_pci.c : ====================================
> /*
>   * XXX memory-mapped is busted on some i386 on-board chips.
>   * for i386, we don't even try it.  Also, suppress the damn
>   * PCI bus errors messages on i386.  They are not fatal, and are
>   * usually caused by some other device on the PCI bus.  But some
>   * ahc cards won't work without ACKing them.  So just ACK and go!
>   * XXX- smurph
>   */
> #ifndef i386
> #define AHC_ALLOW_MEMIO
> #define AHC_SHOW_PCI_ERRORS
> #endif
> 
> ======================================
> 
> Since I have used MEMIO on this board under FBSD 4.8 with no 
> ill effects, 
> what is involved in setting up the Adaptec driver to use 
> AHC_ALLOW_MEMIO 
> under i386?
> 
> Second, is there any way to lessen the SCSI device timout 
> during boot (the 
> part where the OS probes the channels for drives?)
> 
> We used to need 10secs or so along time ago, but now 2-5 
> seconds would be 
> sufficient. I know this may sound petty, but I am only asking.
> 
> Under my last OS, this was settable in the kernel config file.
> 
> 
> Thanks for any tips/pointers. I will accept flames as well, 
> since I may be 
> asking stupid things here :(
> 
> 
> Jeff