diff options
| author | Leandro Lupori <luporl@FreeBSD.org> | 2021-06-21 18:04:43 +0000 |
|---|---|---|
| committer | Leandro Lupori <luporl@FreeBSD.org> | 2021-07-23 11:28:58 +0000 |
| commit | 572e3575dba591f372633a38d76ce7904d1a1b2e (patch) | |
| tree | 7c71b50ed984643ca476e4312a9de82c615fa970 /sys/dev/aacraid/aacraid_var.h | |
| parent | 06887e06864706ee0b550df9815427805b1a5261 (diff) | |
aacraid: reduce max I/O size to avoid DMA issues
Reserve one page for the DMA subsystem, that may need it when the I/O
buffer is not page aligned.
Without this change, writes with the maximum allowed size failed, if:
- physical memory was fragmented, making it necessary to use one DMA
segment for each page
- the buffer to be written was not page aligned, causing the DMA
subsystem to need one extra segment
In the scenario above, the DMA subsystem would run out of segments,
resulting in a write with no SG segments, that would fail.
Reviewed by: imp
Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)
Differential Revision: https://reviews.freebsd.org/D30798
(cherry picked from commit 9c2c6353193b53deb337777c2a06a2648b364f8b)
Diffstat (limited to 'sys/dev/aacraid/aacraid_var.h')
| -rw-r--r-- | sys/dev/aacraid/aacraid_var.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/aacraid/aacraid_var.h b/sys/dev/aacraid/aacraid_var.h index 4fed21b1356b..bbafdafb8840 100644 --- a/sys/dev/aacraid/aacraid_var.h +++ b/sys/dev/aacraid/aacraid_var.h @@ -471,6 +471,14 @@ struct aac_softc }; /* + * Max. I/O size in bytes. + * Reserve one page for the DMA subsystem, that may need it when the + * I/O buffer is not page aligned. + */ +#define AAC_MAXIO_SIZE(sc) MIN(((sc)->aac_max_sectors << 9) - PAGE_SIZE, \ + maxphys) + +/* * Event callback mechanism for the driver */ #define AAC_EVENT_NONE 0x00 |
