From 8cefbec982ae09f024123a66ac5f353ca57f3b09 Mon Sep 17 00:00:00 2001 From: jkim Date: Tue, 8 Dec 2009 05:35:51 +0000 Subject: [PATCH] - Try pre-allocating all FIBs upfront. Previously we tried pre-allocating 128 FIBs first and allocated more later if necessary. Remove now unused definitions from the header file[1]. - Force sequential bus scanning. It seems parallel scanning is in fact slower and causes more harm than good[1]. Adjust a comment to reflect that. PR: kern/141269 Submitted by: Alexander Sack (asack at niksun dot com)[1] Reviewed by: scottl --- sys/dev/aac/aac.c | 2 +- sys/dev/aac/aac_cam.c | 7 +++++-- sys/dev/aac/aacvar.h | 7 ------- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/sys/dev/aac/aac.c b/sys/dev/aac/aac.c index 0bfb3f899977..f0c67cd6bf1b 100644 --- a/sys/dev/aac/aac.c +++ b/sys/dev/aac/aac.c @@ -604,7 +604,7 @@ aac_alloc(struct aac_softc *sc) TAILQ_INIT(&sc->aac_fibmap_tqh); sc->aac_commands = malloc(sc->aac_max_fibs * sizeof(struct aac_command), M_AACBUF, M_WAITOK|M_ZERO); - while (sc->total_fibs < AAC_PREALLOCATE_FIBS) { + while (sc->total_fibs < sc->aac_max_fibs) { if (aac_alloc_commands(sc) != 0) break; } diff --git a/sys/dev/aac/aac_cam.c b/sys/dev/aac/aac_cam.c index 5755f0d611a2..37f7c637c30c 100644 --- a/sys/dev/aac/aac_cam.c +++ b/sys/dev/aac/aac_cam.c @@ -260,8 +260,11 @@ aac_cam_action(struct cam_sim *sim, union ccb *ccb) cpi->hba_inquiry = PI_WIDE_16; cpi->target_sprt = 0; - /* Resetting via the passthrough causes problems. */ - cpi->hba_misc = PIM_NOBUSRESET; + /* + * Resetting via the passthrough or parallel bus scan + * causes problems. + */ + cpi->hba_misc = PIM_NOBUSRESET | PIM_SEQSCAN; cpi->hba_eng_cnt = 0; cpi->max_target = camsc->inf->TargetsPerBus; cpi->max_lun = 8; /* Per the controller spec */ diff --git a/sys/dev/aac/aacvar.h b/sys/dev/aac/aacvar.h index 18b8501cf61c..3f9714d07c68 100644 --- a/sys/dev/aac/aacvar.h +++ b/sys/dev/aac/aacvar.h @@ -56,13 +56,6 @@ */ #define AAC_ADAPTER_FIBS 8 -/* - * FIBs are allocated in page-size chunks and can grow up to the 512 - * limit imposed by the hardware. - */ -#define AAC_PREALLOCATE_FIBS 128 -#define AAC_NUM_MGT_FIB 8 - /* * The controller reports status events in AIFs. We hang on to a number of * these in order to pass them out to user-space management tools.