summaryrefslogtreecommitdiffstats
path: root/sys/dev/aac
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-07-11 08:10:18 +0000
committerjkim <jkim@FreeBSD.org>2009-07-11 08:10:18 +0000
commitba5583d31888cb78136b114790fce49c792c14d0 (patch)
tree3442dff5b017790b60f87f0f7d38a2489fa92764 /sys/dev/aac
parente5921a6fae9164c5f8ad6bb718db42f3f7a9e455 (diff)
downloadFreeBSD-src-ba5583d31888cb78136b114790fce49c792c14d0.zip
FreeBSD-src-ba5583d31888cb78136b114790fce49c792c14d0.tar.gz
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. Reviewed by: scottl Approved by: re (kensmith)
Diffstat (limited to 'sys/dev/aac')
-rw-r--r--sys/dev/aac/aac_disk.c20
1 files changed, 5 insertions, 15 deletions
diff --git a/sys/dev/aac/aac_disk.c b/sys/dev/aac/aac_disk.c
index 2e7dbac..4a1a82b 100644
--- a/sys/dev/aac/aac_disk.c
+++ b/sys/dev/aac/aac_disk.c
@@ -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_segment_t *segs, int nsegs, int error)
/*
* 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, vm_offset_t physical, off_t offset, size
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, vm_offset_t physical, off_t offset, size
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;
OpenPOWER on IntegriCloud