Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/scsipi If the controller supports more than 256 comm...



details:   https://anonhg.NetBSD.org/src/rev/41e47b9f197e
branches:  trunk
changeset: 781132:41e47b9f197e
user:      bouyer <bouyer%NetBSD.org@localhost>
date:      Tue Aug 21 14:19:02 2012 +0000

description:
If the controller supports more than 256 commands per target,
clamp it to 256 (maximum number of tags in SCSI). Newer controllers
(such as mpii(4), and mfi(4) when fixed to announce tagged queuing support)
support more than 256 outstanding commands and don't use the scsi tag,
but at this time scsipi will always allocate a tag, and panic if a periph
tries to send more than 256 commands.

diffstat:

 sys/dev/scsipi/scsiconf.c |  20 ++++++++++++++++++--
 1 files changed, 18 insertions(+), 2 deletions(-)

diffs (41 lines):

diff -r 41222c2971e5 -r 41e47b9f197e sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Tue Aug 21 09:06:02 2012 +0000
+++ b/sys/dev/scsipi/scsiconf.c Tue Aug 21 14:19:02 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsiconf.c,v 1.268 2012/05/13 01:03:13 jakllsch Exp $  */
+/*     $NetBSD: scsiconf.c,v 1.269 2012/08/21 14:19:02 bouyer Exp $    */
 
 /*-
  * Copyright (c) 1998, 1999, 2004 The NetBSD Foundation, Inc.
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.268 2012/05/13 01:03:13 jakllsch Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.269 2012/08/21 14:19:02 bouyer Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -213,6 +213,22 @@
            chan->chan_nluns,
            chan->chan_nluns == 1 ? "" : "s");
 
+       /*
+        * XXX 
+        * newer adapters support more than 256 outstanding commands
+        * per periph and don't use the tag (they eventually allocate one
+        * internally). Right now scsipi always allocate a tag and
+        * is limited to 256 tags, per scsi specs.
+        * this should be revisited
+        */
+       if (chan->chan_flags & SCSIPI_CHAN_OPENINGS) {
+               if (chan->chan_max_periph > 256)
+                       chan->chan_max_periph = 256;
+       } else {
+               if (chan->chan_adapter->adapt_max_periph > 256)
+                       chan->chan_adapter->adapt_max_periph = 256;
+       }
+
        if (scsipi_adapter_addref(chan->chan_adapter))
                return;
 



Home | Main Index | Thread Index | Old Index