Changeset View
Changeset View
Standalone View
Standalone View
head/sys/dev/mps/mps.c
Show First 20 Lines • Show All 412 Lines • ▼ Show 20 Lines | mps_resize_queues(struct mps_softc *sc) | ||||
* user's value and the calculated value as long as the user's | * user's value and the calculated value as long as the user's | ||||
* value is larger than 0. The user's value is in pages. | * value is larger than 0. The user's value is in pages. | ||||
*/ | */ | ||||
sges_per_frame = sc->reqframesz / sizeof(MPI2_SGE_SIMPLE64) - 1; | sges_per_frame = sc->reqframesz / sizeof(MPI2_SGE_SIMPLE64) - 1; | ||||
maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; | maxio = (sges_per_frame * sc->facts->MaxChainDepth + 1) * PAGE_SIZE; | ||||
/* | /* | ||||
* If I/O size limitation requested, then use it and pass up to CAM. | * If I/O size limitation requested, then use it and pass up to CAM. | ||||
* If not, use MAXPHYS as an optimization hint, but report HW limit. | * If not, use maxphys as an optimization hint, but report HW limit. | ||||
*/ | */ | ||||
if (sc->max_io_pages > 0) { | if (sc->max_io_pages > 0) { | ||||
maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); | maxio = min(maxio, sc->max_io_pages * PAGE_SIZE); | ||||
sc->maxio = maxio; | sc->maxio = maxio; | ||||
} else { | } else { | ||||
sc->maxio = maxio; | sc->maxio = maxio; | ||||
maxio = min(maxio, MAXPHYS); | maxio = min(maxio, maxphys); | ||||
} | } | ||||
sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / | sc->num_chains = (maxio / PAGE_SIZE + sges_per_frame - 2) / | ||||
sges_per_frame * reqcr; | sges_per_frame * reqcr; | ||||
if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) | if (sc->max_chains > 0 && sc->max_chains < sc->num_chains) | ||||
sc->num_chains = sc->max_chains; | sc->num_chains = sc->max_chains; | ||||
/* | /* | ||||
▲ Show 20 Lines • Show All 2,799 Lines • Show Last 20 Lines |