Skip to contentSkip to conversation

sparc: Make sparc64 use scalable lib/iommu-common.c functions

PATCH Superseded Sowmini Varadhan 1 participant 1 message Mar 3, 2015 SPARC + UltraSPARC (sparc/sparc64)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore
#0 lore raw

PATCH v2 2/2 sparc: Make sparc64 use scalable lib/iommu-common.c functions

In iperf experiments running linux as the Tx side (TCP client) with 10 threads results in a severe performance drop when TSO is disabled, indicating a weakness in the software that can be avoided by using the scalable IOMMU arena DMA allocation.

Baseline numbers before this patch:
with default settings (TSO enabled) : 9-9.5 Gbps
Disable TSO using ethtool- drops badly: 2-3 Gbps.

After this patch, iperf client with 10 threads, can give a throughput of at least 8.5 Gbps, even when TSO is disabled.

---
 arch/sparc/include/asm/iommu_64.h |   19 ++++
 arch/sparc/kernel/pci_impl.h      |    7 +-
 arch/sparc/kernel/pci_sun4v.c     |  217 +++++++++++++++++--------------------
 3 files changed, 127 insertions(+), 116 deletions(-)
arch/sparc/include/asm/iommu_64.h +19 -0
index 2b9321a..cb327d9 100644
@@ -16,6 +16,7 @@
 #define IOPTE_WRITE   0x0000000000000002UL
 
 #define IOMMU_NUM_CTXS	4096
+#include <linux/iommu-common.h>
 
 struct iommu_arena {
 	unsigned long	*map;
@@ -43,6 +44,24 @@ struct iommu {
 	u32			dma_addr_mask;
 };
 
+struct iommu_sparc {
+	struct iommu_table	tbl;
+	u32			dma_addr_mask;
+	void			(*flush_all)(struct iommu *);
+	iopte_t			*page_table;
+	unsigned long		iommu_control;
+	unsigned long		iommu_tsbbase;
+	unsigned long		iommu_flush;
+	unsigned long		iommu_flushinv;
+	unsigned long		iommu_tags;
+	unsigned long		iommu_ctxflush;
+	unsigned long		write_complete_reg;
+	unsigned long		dummy_page;
+	unsigned long		dummy_page_pa;
+	unsigned long		ctx_lowest_free;
+	DECLARE_BITMAP(ctx_bitmap, IOMMU_NUM_CTXS);
+};
+
 struct strbuf {
 	int			strbuf_enabled;
 	unsigned long		strbuf_control;
arch/sparc/kernel/pci_impl.h +6 -1
index 75803c7..f800a1d 100644
@@ -142,7 +142,12 @@ struct pci_pbm_info {
 	struct strbuf			stc;
 
 	/* IOMMU state, potentially shared by both PBM segments. */
-	struct iommu			*iommu;
+#ifdef notyet
+	struct iommu_sparc			*iommu;
+#else
+	/* change only pci_sun4v and DMA to use new iommu_table for now */
+	void					*iommu;
+#endif
 
 	/* Now things for the actual PCI bus probes. */
 	unsigned int			pci_first_busno;
arch/sparc/kernel/pci_sun4v.c +102 -115

440 lines not on this page · raw message

Signature · 1 line
1.7.1