diff options
author | Linas Vepstas <linas@austin.ibm.com> | 2006-10-30 00:15:59 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-10-31 22:52:48 -0500 |
commit | 5d2efba64b231a1733c4048d1708d77e07f26426 (patch) | |
tree | 2893dd45b9c26cef6cddb5fef0c6f820c5eb534e /include/asm-powerpc/tce.h | |
parent | dd6c89f686bdb2a5de72fab636fc839e5a0add6d (diff) |
[POWERPC] Use 4kB iommu pages even on 64kB-page systems
The 10Gigabit ethernet device drivers appear to be able to chew
up all 256MB of TCE mappings on pSeries systems, as evidenced by
numerous error messages:
iommu_alloc failed, tbl c0000000010d5c48 vaddr c0000000d875eff0 npages 1
Some experimentation indicates that this is essentially because
one 1500 byte ethernet MTU gets mapped as a 64K DMA region when
the large 64K pages are enabled. Thus, it doesn't take much to
exhaust all of the available DMA mappings for a high-speed card.
This patch changes the iommu allocator to work with its own
unique, distinct page size. Although the patch is long, its
actually quite simple: it just #defines a distinct IOMMU_PAGE_SIZE
and then uses this in all the places that matter.
As a side effect, it also dramatically improves network performance
on platforms with H-calls on iommu translation inserts/removes (since
we no longer call it 16 times for a 1500 bytes packet when the iommu HW
is still 4k).
In the future, we might want to make the IOMMU_PAGE_SIZE a variable
in the iommu_table instance, thus allowing support for different HW
page sizes in the iommu itself.
Signed-off-by: Linas Vepstas <linas@austin.ibm.com>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Olof Johansson <olof@lixom.net>
Acked-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'include/asm-powerpc/tce.h')
-rw-r--r-- | include/asm-powerpc/tce.h | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/include/asm-powerpc/tce.h b/include/asm-powerpc/tce.h index c9483adbf599..f663634cccc9 100644 --- a/include/asm-powerpc/tce.h +++ b/include/asm-powerpc/tce.h | |||
@@ -22,6 +22,8 @@ | |||
22 | #define _ASM_POWERPC_TCE_H | 22 | #define _ASM_POWERPC_TCE_H |
23 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
24 | 24 | ||
25 | #include <asm/iommu.h> | ||
26 | |||
25 | /* | 27 | /* |
26 | * Tces come in two formats, one for the virtual bus and a different | 28 | * Tces come in two formats, one for the virtual bus and a different |
27 | * format for PCI | 29 | * format for PCI |
@@ -33,7 +35,6 @@ | |||
33 | 35 | ||
34 | #define TCE_SHIFT 12 | 36 | #define TCE_SHIFT 12 |
35 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) | 37 | #define TCE_PAGE_SIZE (1 << TCE_SHIFT) |
36 | #define TCE_PAGE_FACTOR (PAGE_SHIFT - TCE_SHIFT) | ||
37 | 38 | ||
38 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ | 39 | #define TCE_ENTRY_SIZE 8 /* each TCE is 64 bits */ |
39 | 40 | ||