From: Dan Williams <dan.j.williams@intel.com>
To: "Sosnowski, Maciej" <maciej.sosnowski@intel.com>
Cc: "Nelson, Shannon" <shannon.nelson@intel.com>,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default value dependant onI/OAT version
Date: Fri, 18 Jul 2008 11:54:14 -0700 [thread overview]
Message-ID: <1216407254.18755.4.camel@dwillia2-linux.ch.intel.com> (raw)
In-Reply-To: <20080718152838.21235.78883.stgit@linux.site>
On Fri, 2008-07-18 at 08:29 -0700, Sosnowski, Maciej wrote:
> 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.
>
> Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
Let's kill some ifdef's... how about the following instead?
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 171cad6..1c0dafc 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -1330,6 +1330,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);
return device;
diff --git a/drivers/dma/ioatdma.h b/drivers/dma/ioatdma.h
index f2c7fed..23e3196 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.04"
@@ -121,6 +122,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 0ad1cd5..de76050 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.
next prev parent reply other threads:[~2008-07-18 18:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-18 15:27 [PATCH v2 0/4] I/OAT: watchdog/reset, tcp_dma_copybreak and I/OAT ver.3 support Maciej Sosnowski
2008-07-18 15:27 ` [PATCH v2 1/4] I/OAT: Add watchdog/reset functionality to ioatdma driver Maciej Sosnowski
2008-07-18 15:28 ` [PATCH v2 2/4] I/OAT: Increase sleep time in ioat_dma_self_test Maciej Sosnowski
2008-07-18 15:29 ` [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version Maciej Sosnowski
2008-07-18 18:54 ` Dan Williams [this message]
2008-07-21 16:13 ` [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default valuedependant onI/OAT version Sosnowski, Maciej
2008-07-18 15:29 ` [PATCH v2 4/4] I/OAT: I/OAT version 3.0 support Maciej Sosnowski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1216407254.18755.4.camel@dwillia2-linux.ch.intel.com \
--to=dan.j.williams@intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=maciej.sosnowski@intel.com \
--cc=netdev@vger.kernel.org \
--cc=shannon.nelson@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).