summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaciej Sosnowski <maciej.sosnowski@intel.com>2008-07-22 17:30:57 -0700
committerDan Williams <dan.j.williams@intel.com>2008-07-22 17:30:57 -0700
commit16a37acaaf4aaa631ba3f83710ed6cdb1a597520 (patch)
tree5826c763c70dc6b798c0d12216a80f4596dec284
parent09177e85d6a0bffac8b55afd28ed8b82bd873f0b (diff)
downloadlinux-stable-16a37acaaf4aaa631ba3f83710ed6cdb1a597520.tar.gz
linux-stable-16a37acaaf4aaa631ba3f83710ed6cdb1a597520.tar.bz2
linux-stable-16a37acaaf4aaa631ba3f83710ed6cdb1a597520.zip
I/OAT: tcp_dma_copybreak default value dependent on I/OAT version
I/OAT DMA performance tuning showed different optimal values of tcp_dma_copybreak for different I/OAT versions (4096 for 1.2 and 2048 for 2.0). This patch lets ioatdma driver set tcp_dma_copybreak value according to these results. [dan.j.williams@intel.com: remove some ifdefs] Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com> Signed-off-by: Dan Williams <dan.j.williams@intel.com>
-rw-r--r--drivers/dma/ioat_dma.c2
-rw-r--r--drivers/dma/ioatdma.h15
-rw-r--r--net/core/user_dma.c1
3 files changed, 18 insertions, 0 deletions
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index da572968a7db..ece5a0e3a335 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -1581,6 +1581,8 @@ struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
if (err)
goto err_self_test;
+ ioat_set_tcp_copy_break(device);
+
dma_async_device_register(&device->common);
INIT_DELAYED_WORK(&device->work, ioat_dma_chan_watchdog);
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h
index c6ec933f9895..685adb62aa5a 100644
--- a/drivers/dma/ioatdma.h
+++ b/drivers/dma/ioatdma.h
@@ -27,6 +27,7 @@
#include <linux/dmapool.h>
#include <linux/cache.h>
#include <linux/pci_ids.h>
+#include <net/tcp.h>
#define IOAT_DMA_VERSION "2.18"
@@ -129,6 +130,20 @@ struct ioat_desc_sw {
struct dma_async_tx_descriptor async_tx;
};
+static inline void ioat_set_tcp_copy_break(struct ioatdma_device *dev)
+{
+ #ifdef CONFIG_NET_DMA
+ switch (dev->version) {
+ case IOAT_VER_1_2:
+ sysctl_tcp_dma_copybreak = 4096;
+ break;
+ case IOAT_VER_2_0:
+ sysctl_tcp_dma_copybreak = 2048;
+ break;
+ }
+ #endif
+}
+
#if defined(CONFIG_INTEL_IOATDMA) || defined(CONFIG_INTEL_IOATDMA_MODULE)
struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev,
void __iomem *iobase);
diff --git a/net/core/user_dma.c b/net/core/user_dma.c
index 0ad1cd57bc39..de760504f6fe 100644
--- a/net/core/user_dma.c
+++ b/net/core/user_dma.c
@@ -34,6 +34,7 @@
#define NET_DMA_DEFAULT_COPYBREAK 4096
int sysctl_tcp_dma_copybreak = NET_DMA_DEFAULT_COPYBREAK;
+EXPORT_SYMBOL(sysctl_tcp_dma_copybreak);
/**
* dma_skb_copy_datagram_iovec - Copy a datagram to an iovec.