Source-Changes-HG archive

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

[src/tls-maxphys]: src/sys/dev/pci Areca controller maximum-transfer size lim...



details:   https://anonhg.NetBSD.org/src/rev/01e44260d943
branches:  tls-maxphys
changeset: 852964:01e44260d943
user:      tls <tls%NetBSD.org@localhost>
date:      Sun Dec 02 05:46:03 2012 +0000

description:
Areca controller maximum-transfer size limits -- looked up in FreeBSD
driver.

Actually exporting the per-volume transfer size for this driver will
be quite hard; the controller firmware shows the host the configured
volumes when the host probes the controller's "scsibus", and we can't
really associate them with particular RAID volumes until later.  I think
we will have to intercept the SCSI inquiry commands -- yuck.

diffstat:

 sys/dev/pci/arcmsr.c    |  13 +++++++------
 sys/dev/pci/arcmsrvar.h |   5 ++++-
 2 files changed, 11 insertions(+), 7 deletions(-)

diffs (61 lines):

diff -r 38ab42595402 -r 01e44260d943 sys/dev/pci/arcmsr.c
--- a/sys/dev/pci/arcmsr.c      Tue Nov 20 02:57:26 2012 +0000
+++ b/sys/dev/pci/arcmsr.c      Sun Dec 02 05:46:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arcmsr.c,v 1.30 2011/06/20 22:03:16 pgoyette Exp $ */
+/*     $NetBSD: arcmsr.c,v 1.30.12.1 2012/12/02 05:46:03 tls Exp $ */
 /*     $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
 
 /*
@@ -21,7 +21,7 @@
 #include "bio.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.30 2011/06/20 22:03:16 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arcmsr.c,v 1.30.12.1 2012/12/02 05:46:03 tls Exp $");
 
 #include <sys/param.h>
 #include <sys/buf.h>
@@ -259,8 +259,8 @@
 static void
 arc_minphys(struct buf *bp)
 {
-       if (bp->b_bcount > MAXPHYS)
-               bp->b_bcount = MAXPHYS;
+       if (bp->b_bcount > ARC_MAX_XFER)
+               bp->b_bcount = ARC_MAX_XFER;
        minphys(bp);
 }
 
@@ -2091,8 +2091,9 @@
        for (i = 0; i < sc->sc_req_count; i++) {
                ccb = &sc->sc_ccbs[i];
 
-               if (bus_dmamap_create(sc->sc_dmat, MAXPHYS, ARC_SGL_MAXLEN,
-                   MAXPHYS, 0, 0, &ccb->ccb_dmamap) != 0) {
+               if (bus_dmamap_create(sc->sc_dmat, ARC_MAX_XFER,
+                                     ARC_SGL_MAXLEN, ARC_MAX_XFER,
+                                     0, 0, &ccb->ccb_dmamap) != 0) {
                        aprint_error_dev(self,
                            "unable to create dmamap for ccb %d\n", i);
                        goto free_maps;
diff -r 38ab42595402 -r 01e44260d943 sys/dev/pci/arcmsrvar.h
--- a/sys/dev/pci/arcmsrvar.h   Tue Nov 20 02:57:26 2012 +0000
+++ b/sys/dev/pci/arcmsrvar.h   Sun Dec 02 05:46:03 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arcmsrvar.h,v 1.14 2011/06/20 13:26:58 pgoyette Exp $ */
+/*     $NetBSD: arcmsrvar.h,v 1.14.12.1 2012/12/02 05:46:03 tls Exp $ */
 /*     Derived from $OpenBSD: arc.c,v 1.68 2007/10/27 03:28:27 dlg Exp $ */
 
 /*
@@ -127,7 +127,10 @@
 #define ARC_MAX_TARGET         16
 #define ARC_MAX_LUN            8
 #define ARC_MAX_IOCMDLEN       512
+#define ARC_MAX_XFER_BLOCKS    4096
 #define ARC_BLOCKSIZE          512
+#define ARC_MAX_XFER           (MIN(MACHINE_MAXPHYS, \
+                                ARC_MAX_XFER_BLOCKS * ARC_BLOCKSIZE))
 
 /* 
  * the firmware deals with up to 256 or 512 byte command frames.



Home | Main Index | Thread Index | Old Index