Author: emaste
Date: Thu Oct 29 13:41:05 2009
New Revision: 198584
URL: http://svn.freebsd.org/changeset/base/198584

Log:
  MFC r195614:
  
    Get correct maxio from the controller and drop the tunable.
    The default (64K) is too pessimistic for "new comm" hardware.
    Also, this is bad because multiple controllers get limited by
    the global tunable.
  
  At this point stable/7 and stable/8 are in sync, modulo KPI changes.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/aac/aac_disk.c

Modified: stable/7/sys/dev/aac/aac_disk.c
==============================================================================
--- stable/7/sys/dev/aac/aac_disk.c     Thu Oct 29 13:28:37 2009        
(r198583)
+++ stable/7/sys/dev/aac/aac_disk.c     Thu Oct 29 13:41:05 2009        
(r198584)
@@ -36,7 +36,6 @@ __FBSDID("$FreeBSD$");
 #include <sys/systm.h>
 #include <sys/kernel.h>
 #include <sys/module.h>
-#include <sys/sysctl.h>
 
 #include <sys/bus.h>
 #include <sys/conf.h>
@@ -83,18 +82,8 @@ static driver_t aac_disk_driver = {
        sizeof(struct aac_disk)
 };
 
-#define AAC_MAXIO      65536
-
 DRIVER_MODULE(aacd, aac, aac_disk_driver, aac_disk_devclass, 0, 0);
 
-/* sysctl tunables */
-static unsigned int aac_iosize_max = AAC_MAXIO;        /* due to limits of the 
card */
-TUNABLE_INT("hw.aac.iosize_max", &aac_iosize_max);
-
-SYSCTL_DECL(_hw_aac);
-SYSCTL_UINT(_hw_aac, OID_AUTO, iosize_max, CTLFLAG_RDTUN, &aac_iosize_max, 0,
-           "Max I/O size per transfer to an array");
-
 /*
  * Handle open from generic layer.
  *
@@ -236,7 +225,7 @@ aac_dump_map_sg64(void *arg, bus_dma_seg
 /*
  * Dump memory out to an array
  *
- * Send out one command at a time with up to AAC_MAXIO of data.
+ * Send out one command at a time with up to maxio of data.
  */
 static int
 aac_disk_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, 
size_t length)
@@ -244,7 +233,7 @@ aac_disk_dump(void *arg, void *virtual, 
        struct aac_disk *ad;
        struct aac_softc *sc;
        struct aac_fib *fib;
-       size_t len;
+       size_t len, maxio;
        int size;
        static bus_dmamap_t dump_datamap;
        static int first = 0;
@@ -272,7 +261,8 @@ aac_disk_dump(void *arg, void *virtual, 
        fib = &sc->aac_common->ac_sync_fib;
 
        while (length > 0) {
-               len = (length > AAC_MAXIO) ? AAC_MAXIO : length;
+               maxio = sc->aac_max_sectors << 9;
+               len = (length > maxio) ? maxio : length;
                if ((sc->flags & AAC_FLAGS_SG_64BIT) == 0) {
                        struct aac_blockwrite *bw;
                        bw = (struct aac_blockwrite *)&fib->data[0];
@@ -408,7 +398,7 @@ aac_disk_attach(device_t dev)
        sc->ad_disk = disk_alloc();
        sc->ad_disk->d_drv1 = sc;
        sc->ad_disk->d_name = "aacd";
-       sc->ad_disk->d_maxsize = aac_iosize_max;
+       sc->ad_disk->d_maxsize = sc->ad_controller->aac_max_sectors << 9;
        sc->ad_disk->d_open = aac_disk_open;
        sc->ad_disk->d_close = aac_disk_close;
        sc->ad_disk->d_strategy = aac_disk_strategy;
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to