Skip to content

Commit

Permalink
I/OAT: tcp_dma_copybreak default value dependent on I/OAT version
Browse files Browse the repository at this point in the history
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.

[[email protected]: remove some ifdefs]
Signed-off-by: Maciej Sosnowski <[email protected]>
Signed-off-by: Dan Williams <[email protected]>
  • Loading branch information
Maciej Sosnowski authored and djbw committed Jul 23, 2008
1 parent 09177e8 commit 16a37ac
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/dma/ioat_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
15 changes: 15 additions & 0 deletions drivers/dma/ioatdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down Expand Up @@ -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);
Expand Down
1 change: 1 addition & 0 deletions net/core/user_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 16a37ac

Please sign in to comment.