diff options
-rw-r--r-- | drivers/dma/ioat_dma.c | 2 | ||||
-rw-r--r-- | drivers/dma/ioatdma.h | 15 | ||||
-rw-r--r-- | net/core/user_dma.c | 1 |
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, | |||
1581 | if (err) | 1581 | if (err) |
1582 | goto err_self_test; | 1582 | goto err_self_test; |
1583 | 1583 | ||
1584 | ioat_set_tcp_copy_break(device); | ||
1585 | |||
1584 | dma_async_device_register(&device->common); | 1586 | dma_async_device_register(&device->common); |
1585 | 1587 | ||
1586 | INIT_DELAYED_WORK(&device->work, ioat_dma_chan_watchdog); | 1588 | 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 @@ | |||
27 | #include <linux/dmapool.h> | 27 | #include <linux/dmapool.h> |
28 | #include <linux/cache.h> | 28 | #include <linux/cache.h> |
29 | #include <linux/pci_ids.h> | 29 | #include <linux/pci_ids.h> |
30 | #include <net/tcp.h> | ||
30 | 31 | ||
31 | #define IOAT_DMA_VERSION "2.18" | 32 | #define IOAT_DMA_VERSION "2.18" |
32 | 33 | ||
@@ -129,6 +130,20 @@ struct ioat_desc_sw { | |||
129 | struct dma_async_tx_descriptor async_tx; | 130 | struct dma_async_tx_descriptor async_tx; |
130 | }; | 131 | }; |
131 | 132 | ||
133 | static inline void ioat_set_tcp_copy_break(struct ioatdma_device *dev) | ||
134 | { | ||
135 | #ifdef CONFIG_NET_DMA | ||
136 | switch (dev->version) { | ||
137 | case IOAT_VER_1_2: | ||
138 | sysctl_tcp_dma_copybreak = 4096; | ||
139 | break; | ||
140 | case IOAT_VER_2_0: | ||
141 | sysctl_tcp_dma_copybreak = 2048; | ||
142 | break; | ||
143 | } | ||
144 | #endif | ||
145 | } | ||
146 | |||
132 | #if defined(CONFIG_INTEL_IOATDMA) || defined(CONFIG_INTEL_IOATDMA_MODULE) | 147 | #if defined(CONFIG_INTEL_IOATDMA) || defined(CONFIG_INTEL_IOATDMA_MODULE) |
133 | struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev, | 148 | struct ioatdma_device *ioat_dma_probe(struct pci_dev *pdev, |
134 | void __iomem *iobase); | 149 | 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 @@ | |||
34 | #define NET_DMA_DEFAULT_COPYBREAK 4096 | 34 | #define NET_DMA_DEFAULT_COPYBREAK 4096 |
35 | 35 | ||
36 | int sysctl_tcp_dma_copybreak = NET_DMA_DEFAULT_COPYBREAK; | 36 | int sysctl_tcp_dma_copybreak = NET_DMA_DEFAULT_COPYBREAK; |
37 | EXPORT_SYMBOL(sysctl_tcp_dma_copybreak); | ||
37 | 38 | ||
38 | /** | 39 | /** |
39 | * dma_skb_copy_datagram_iovec - Copy a datagram to an iovec. | 40 | * dma_skb_copy_datagram_iovec - Copy a datagram to an iovec. |