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
Subject: [PATCH 2/2] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version
Date: Fri, 11 Jul 2008 13:37:08 +0200	[thread overview]
Message-ID: <20080711113703.337.72444.stgit@linux.site> (raw)
In-Reply-To: <20080711113553.337.50006.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/dmaengine.c   |    3 +++
 drivers/dma/ioat_dma.c    |   15 +++++++++++++++
 include/linux/dmaengine.h |    2 ++
 3 files changed, 20 insertions(+), 0 deletions(-)

diff --git a/drivers/dma/dmaengine.c b/drivers/dma/dmaengine.c
index 97b329e..d57365a 100644
--- a/drivers/dma/dmaengine.c
+++ b/drivers/dma/dmaengine.c
@@ -70,6 +70,7 @@ #include <linux/percpu.h>
 #include <linux/rcupdate.h>
 #include <linux/mutex.h>
 #include <linux/jiffies.h>
+#include <net/tcp.h>
 
 static DEFINE_MUTEX(dma_list_mutex);
 static LIST_HEAD(dma_device_list);
@@ -402,6 +403,8 @@ int dma_async_device_register(struct dma
 	list_add_tail(&device->global_node, &dma_device_list);
 	mutex_unlock(&dma_list_mutex);
 
+	sysctl_tcp_dma_copybreak = device->tcp_dma_copybreak;
+
 	dma_clients_notify_available();
 
 	return 0;
diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 9c0b90a..42e5bfb 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -53,6 +53,12 @@ #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);
 
+/*
+ * default tcp_dma_copybreak values for different IOAT versions
+ */
+#define IOAT1_DEFAULT_TCP_DMA_COPYBREAK 4096
+#define IOAT2_DEFAULT_TCP_DMA_COPYBREAK 2048
+
 /* 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);
@@ -1571,6 +1577,15 @@ struct ioatdma_device *ioat_dma_probe(st
 	if (err)
 		goto err_self_test;
 
+	switch (device->version) {
+	case IOAT_VER_1_2:
+		device->common.tcp_dma_copybreak = IOAT1_DEFAULT_TCP_DMA_COPYBREAK;
+		break;
+	case IOAT_VER_2_0:
+		device->common.tcp_dma_copybreak = IOAT2_DEFAULT_TCP_DMA_COPYBREAK;
+		break;
+	}
+
 	dma_async_device_register(&device->common);
 
 	INIT_DELAYED_WORK(&device->work, ioat_dma_chan_watchdog);
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index d08a5c5..c09128e 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -251,6 +251,7 @@ struct dma_async_tx_descriptor {
  * @global_node: list_head for global dma_device_list
  * @cap_mask: one or more dma_capability flags
  * @max_xor: maximum number of xor sources, 0 if no capability
+ * @tcp_dma_copybreak: lower limit of TCP socket reads size offloaded by DMA 
  * @refcount: reference count
  * @done: IO completion struct
  * @dev_id: unique device ID
@@ -272,6 +273,7 @@ struct dma_device {
 	struct list_head global_node;
 	dma_cap_mask_t  cap_mask;
 	int max_xor;
+	int tcp_dma_copybreak;
 
 	struct kref refcount;
 	struct completion done;


  parent reply	other threads:[~2008-07-11 11:47 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-07-11 11:36 [PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak Maciej Sosnowski
2008-07-11 11:36 ` [PATCH 1/2] I/OAT: Add watchdog/reset functionality to ioatdma driver Maciej Sosnowski
2008-07-11 20:07   ` Dan Williams
2008-07-18 15:53     ` Sosnowski, Maciej
2008-07-11 11:37 ` Maciej Sosnowski [this message]
2008-07-11 19:20   ` [PATCH 2/2] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version Dan Williams
2008-07-18 15:55     ` Sosnowski, Maciej
  -- strict thread matches above, loose matches on Subject: below --
2008-07-14 13:23 [PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak Maciej Sosnowski
2008-07-14 13:25 ` [PATCH 2/2] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version Maciej Sosnowski
2008-07-14 13:27 [PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak Maciej Sosnowski
2008-07-14 13:28 ` [PATCH 2/2] I/OAT: tcp_dma_copybreak default value dependant on I/OAT version 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=20080711113703.337.72444.stgit@linux.site \
    --to=maciej.sosnowski@intel.com \
    --cc=dan.j.williams@intel.com \
    --cc=linux-kernel@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.