All of lore.kernel.org
 help / color / mirror / Atom feed
From: Maciej Sosnowski <maciej.sosnowski@intel.com>
To: dan.j.williams@intel.com
Cc: shannon.nelson@intel.com, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version
Date: Fri, 18 Jul 2008 17:29:10 +0200	[thread overview]
Message-ID: <20080718152838.21235.78883.stgit@linux.site> (raw)
In-Reply-To: <20080718152541.21235.85961.stgit@linux.site>

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>
---

 drivers/dma/ioat_dma.c |   25 +++++++++++++++++++++++++
 net/core/user_dma.c    |    1 +
 2 files changed, 26 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 2fe3aac..b5ce5be 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -37,6 +37,10 @@ #include "ioatdma.h"
 #include "ioatdma_registers.h"
 #include "ioatdma_hw.h"
 
+#ifdef CONFIG_NET_DMA
+#include <net/tcp.h>
+#endif
+
 #define to_ioat_chan(chan) container_of(chan, struct ioat_dma_chan, common)
 #define to_ioatdma_device(dev) container_of(dev, struct ioatdma_device, common)
 #define to_ioat_desc(lh) container_of(lh, struct ioat_desc_sw, node)
@@ -53,6 +57,14 @@ #define WATCHDOG_DELAY  round_jiffies(ms
 static void ioat_dma_chan_reset_part2(struct work_struct *work);
 static void ioat_dma_chan_watchdog(struct work_struct *work);
 
+#ifdef CONFIG_NET_DMA
+/*
+ * default tcp_dma_copybreak values for different IOAT versions
+ */
+#define IOAT1_DEFAULT_TCP_DMA_COPYBREAK 4096
+#define IOAT2_DEFAULT_TCP_DMA_COPYBREAK 2048
+#endif
+
 /* internal functions */
 static void ioat_dma_start_null_desc(struct ioat_dma_chan *ioat_chan);
 static void ioat_dma_memcpy_cleanup(struct ioat_dma_chan *ioat_chan);
@@ -1582,6 +1594,19 @@ struct ioatdma_device *ioat_dma_probe(st
 	if (err)
 		goto err_self_test;
 
+#ifdef CONFIG_NET_DMA
+	switch (device->version) {
+	case IOAT_VER_1_2:
+		sysctl_tcp_dma_copybreak =
+			IOAT1_DEFAULT_TCP_DMA_COPYBREAK;
+		break;
+	case IOAT_VER_2_0:
+		sysctl_tcp_dma_copybreak =
+			IOAT2_DEFAULT_TCP_DMA_COPYBREAK;
+		break;
+	}
+#endif
+
 	dma_async_device_register(&device->common);
 
 	INIT_DELAYED_WORK(&device->work, ioat_dma_chan_watchdog);
diff --git a/net/core/user_dma.c b/net/core/user_dma.c
index c77aff9..8c6b706 100644
--- a/net/core/user_dma.c
+++ b/net/core/user_dma.c
@@ -34,6 +34,7 @@ #include <net/netdma.h>
 #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.


  parent reply	other threads:[~2008-07-18 15:39 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 ` Maciej Sosnowski [this message]
2008-07-18 18:54   ` [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default value dependant onI/OAT version Dan Williams
2008-07-21 16:13     ` [PATCH v2 3/4] I/OAT: tcp_dma_copybreak default valuedependant " 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=20080718152838.21235.78883.stgit@linux.site \
    --to=maciej.sosnowski@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.