[PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak

Previous thread: [PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak by Maciej Sosnowski on Monday, July 14, 2008 - 9:23 am. (8 messages)

Next thread: [git pull] x86 changes for v2.6.27 by Ingo Molnar on Monday, July 14, 2008 - 9:50 am. (13 messages)
To: <dan.j.williams@...>
Cc: <shannon.nelson@...>, <linux-kernel@...>, <netdev@...>
Date: Monday, July 14, 2008 - 9:27 am

I am resending these patches also to netdev list.

It has been a while since last ioatdma update.
Here are two patches that are a result of
ioatdma sustaining and performance tuning efforts
for both I/OAT versions 1.2 and 2.0.

This patches apply to kernel 2.6.26-rc9.

Maciej Sosnowski (2):
I/OAT: Add watchdog/reset functionality to ioatdma driver
I/OAT: tcp_dma_copybreak default value dependant on I/OAT version

drivers/dma/dmaengine.c | 3
drivers/dma/ioat_dma.c | 273 +++++++++++++++++++++++++++++++++++-
drivers/dma/ioatdma.h | 10 +
include/linux/dmaengine.h | 2
4 files changed, 281 insertions(+), 7 deletions(-)

--
Maciej
--

To: <dan.j.williams@...>
Cc: <shannon.nelson@...>, <linux-kernel@...>, <netdev@...>
Date: Monday, July 14, 2008 - 9:28 am

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

To: <dan.j.williams@...>
Cc: <shannon.nelson@...>, <linux-kernel@...>, <netdev@...>
Date: Monday, July 14, 2008 - 9:28 am

Due to occasional DMA channel hangs observed for I/OAT versions 1.2 and 2.0
a watchdog has been introduced to check every 2 seconds
if all channels progress normally.
If stuck channel is detected, driver resets it.
The reset is done in two parts. The second part is scheduled
by the first one to reinitialize the channel after the restart.

Sleep time in self_test has been increased to 10ms
since in some cases 1ms appeared not to be enough.

Signed-off-by: Maciej Sosnowski <maciej.sosnowski@intel.com>
---

drivers/dma/ioat_dma.c | 258 +++++++++++++++++++++++++++++++++++++++++++++++-
drivers/dma/ioatdma.h | 10 ++
2 files changed, 261 insertions(+), 7 deletions(-)

diff --git a/drivers/dma/ioat_dma.c b/drivers/dma/ioat_dma.c
index 318e8a2..9c0b90a 100644
--- a/drivers/dma/ioat_dma.c
+++ b/drivers/dma/ioat_dma.c
@@ -32,6 +32,7 @@ #include <linux/interrupt.h>
#include <linux/dmaengine.h>
#include <linux/delay.h>
#include <linux/dma-mapping.h>
+#include <linux/workqueue.h>
#include "ioatdma.h"
#include "ioatdma_registers.h"
#include "ioatdma_hw.h"
@@ -41,11 +42,17 @@ #define to_ioatdma_device(dev) container
#define to_ioat_desc(lh) container_of(lh, struct ioat_desc_sw, node)
#define tx_to_ioat_desc(tx) container_of(tx, struct ioat_desc_sw, async_tx)

+#define chan_num(ch) ((int)((ch)->reg_base - (ch)->device->reg_base) / 0x80)
static int ioat_pending_level = 4;
module_param(ioat_pending_level, int, 0644);
MODULE_PARM_DESC(ioat_pending_level,
"high-water mark for pushing ioat descriptors (default: 4)");

+#define RESET_DELAY msecs_to_jiffies(100)
+#define WATCHDOG_DELAY round_jiffies(msecs_to_jiffies(2000))
+static void ioat_dma_chan_reset_part2(struct work_struct *work);
+static void ioat_dma_chan_watchdog(struct work_struct *work);
+
/* 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);
@@...

Previous thread: [PATCH 0/2] I/OAT: watchdog/reset and tcp_dma_copybreak by Maciej Sosnowski on Monday, July 14, 2008 - 9:23 am. (8 messages)

Next thread: [git pull] x86 changes for v2.6.27 by Ingo Molnar on Monday, July 14, 2008 - 9:50 am. (13 messages)