2020-07-01 14:10:32

by Ravich, Leonid

[permalink] [raw]
Subject: [PATCH] dmaengine: ioat setting ioat timeout as module parameter

From: Leonid Ravich <[email protected]>

DMA transaction time to complition is a function of
PCI bandwidth,transaction size and a queue depth.
So hard coded value for timeouts might be wrong
for some scenarios.

Signed-off-by: Leonid Ravich <[email protected]>
---
drivers/dma/ioat/dma.c | 12 ++++++++++++
drivers/dma/ioat/dma.h | 2 --
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 8ad0ad861c86..7621b5be5cf4 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -26,6 +26,18 @@

#include "../dmaengine.h"

+int complition_timeout = 200;
+module_param(complition_timeout, int, 0644);
+MODULE_PARM_DESC(complition_timeout,
+ "set ioat complition timeout [msec] (default 200 [msec])");
+int idle_timeout = 2000;
+module_param(idle_timeout, int, 0644);
+MODULE_PARM_DESC(idle_timeout,
+ "set ioat idel timeout [msec] (default 2000 [msec])");
+
+#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
+#define COMPLETION_TIMEOUT msecs_to_jiffies(complition_timeout)
+
static char *chanerr_str[] = {
"DMA Transfer Source Address Error",
"DMA Transfer Destination Address Error",
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index e6b622e1ba92..f7f31fdf14cf 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -104,8 +104,6 @@ struct ioatdma_chan {
#define IOAT_RUN 5
#define IOAT_CHAN_ACTIVE 6
struct timer_list timer;
- #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
- #define IDLE_TIMEOUT msecs_to_jiffies(2000)
#define RESET_DELAY msecs_to_jiffies(100)
struct ioatdma_device *ioat_dma;
dma_addr_t completion_dma;
--
2.16.2


2020-07-01 14:26:23

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH] dmaengine: ioat setting ioat timeout as module parameter



On 7/1/2020 7:08 AM, [email protected] wrote:
> From: Leonid Ravich <[email protected]>
>
> DMA transaction time to complition is a function of
completion

> PCI bandwidth,transaction size and a queue depth.
^ space channel depth. ioat doesn't have queues.
> So hard coded value for timeouts might be wrong
> for some scenarios.
>
> Signed-off-by: Leonid Ravich <[email protected]>
> ---
> drivers/dma/ioat/dma.c | 12 ++++++++++++
> drivers/dma/ioat/dma.h | 2 --
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
> index 8ad0ad861c86..7621b5be5cf4 100644
> --- a/drivers/dma/ioat/dma.c
> +++ b/drivers/dma/ioat/dma.c
> @@ -26,6 +26,18 @@
>
> #include "../dmaengine.h"
>
> +int complition_timeout = 200;
> +module_param(complition_timeout, int, 0644);
> +MODULE_PARM_DESC(complition_timeout,
> + "set ioat complition timeout [msec] (default 200 [msec])");

completion_timeout


> +int idle_timeout = 2000;
> +module_param(idle_timeout, int, 0644);
> +MODULE_PARM_DESC(idle_timeout,
> + "set ioat idel timeout [msec] (default 2000 [msec])");
> +
> +#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
> +#define COMPLETION_TIMEOUT msecs_to_jiffies(complition_timeout)
> +
> static char *chanerr_str[] = {
> "DMA Transfer Source Address Error",
> "DMA Transfer Destination Address Error",
> diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
> index e6b622e1ba92..f7f31fdf14cf 100644
> --- a/drivers/dma/ioat/dma.h
> +++ b/drivers/dma/ioat/dma.h
> @@ -104,8 +104,6 @@ struct ioatdma_chan {
> #define IOAT_RUN 5
> #define IOAT_CHAN_ACTIVE 6
> struct timer_list timer;
> - #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
> - #define IDLE_TIMEOUT msecs_to_jiffies(2000)
> #define RESET_DELAY msecs_to_jiffies(100)
> struct ioatdma_device *ioat_dma;
> dma_addr_t completion_dma;
>

2020-07-01 18:50:35

by Ravich, Leonid

[permalink] [raw]
Subject: [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter

From: Leonid Ravich <[email protected]>

DMA transaction time to completion is a function of
PCI bandwidth,transaction size and a queue depth.
So hard coded value for timeouts might be wrong
for some scenarios.

Signed-off-by: Leonid Ravich <[email protected]>
---
Changing in v2
- misspelling of completion
drivers/dma/ioat/dma.c | 12 ++++++++++++
drivers/dma/ioat/dma.h | 2 --
2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 8ad0ad861c86..fd782aee02d9 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -26,6 +26,18 @@

#include "../dmaengine.h"

+int completion_timeout = 200;
+module_param(completion_timeout, int, 0644);
+MODULE_PARM_DESC(completion_timeout,
+ "set ioat completion timeout [msec] (default 200 [msec])");
+int idle_timeout = 2000;
+module_param(idle_timeout, int, 0644);
+MODULE_PARM_DESC(idle_timeout,
+ "set ioat idel timeout [msec] (default 2000 [msec])");
+
+#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
+#define COMPLETION_TIMEOUT msecs_to_jiffies(completion_timeout)
+
static char *chanerr_str[] = {
"DMA Transfer Source Address Error",
"DMA Transfer Destination Address Error",
diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
index e6b622e1ba92..f7f31fdf14cf 100644
--- a/drivers/dma/ioat/dma.h
+++ b/drivers/dma/ioat/dma.h
@@ -104,8 +104,6 @@ struct ioatdma_chan {
#define IOAT_RUN 5
#define IOAT_CHAN_ACTIVE 6
struct timer_list timer;
- #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
- #define IDLE_TIMEOUT msecs_to_jiffies(2000)
#define RESET_DELAY msecs_to_jiffies(100)
struct ioatdma_device *ioat_dma;
dma_addr_t completion_dma;
--
2.16.2

2020-07-01 19:05:15

by Dave Jiang

[permalink] [raw]
Subject: Re: [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter



On 7/1/2020 11:48 AM, [email protected] wrote:
> From: Leonid Ravich <[email protected]>
>
> DMA transaction time to completion is a function of
> PCI bandwidth,transaction size and a queue depth.
> So hard coded value for timeouts might be wrong
> for some scenarios.
>
> Signed-off-by: Leonid Ravich <[email protected]>
Reviewed-by: Dave Jiang <[email protected]>

> ---
> Changing in v2
> - misspelling of completion
> drivers/dma/ioat/dma.c | 12 ++++++++++++
> drivers/dma/ioat/dma.h | 2 --
> 2 files changed, 12 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
> index 8ad0ad861c86..fd782aee02d9 100644
> --- a/drivers/dma/ioat/dma.c
> +++ b/drivers/dma/ioat/dma.c
> @@ -26,6 +26,18 @@
>
> #include "../dmaengine.h"
>
> +int completion_timeout = 200;
> +module_param(completion_timeout, int, 0644);
> +MODULE_PARM_DESC(completion_timeout,
> + "set ioat completion timeout [msec] (default 200 [msec])");
> +int idle_timeout = 2000;
> +module_param(idle_timeout, int, 0644);
> +MODULE_PARM_DESC(idle_timeout,
> + "set ioat idel timeout [msec] (default 2000 [msec])");
> +
> +#define IDLE_TIMEOUT msecs_to_jiffies(idle_timeout)
> +#define COMPLETION_TIMEOUT msecs_to_jiffies(completion_timeout)
> +
> static char *chanerr_str[] = {
> "DMA Transfer Source Address Error",
> "DMA Transfer Destination Address Error",
> diff --git a/drivers/dma/ioat/dma.h b/drivers/dma/ioat/dma.h
> index e6b622e1ba92..f7f31fdf14cf 100644
> --- a/drivers/dma/ioat/dma.h
> +++ b/drivers/dma/ioat/dma.h
> @@ -104,8 +104,6 @@ struct ioatdma_chan {
> #define IOAT_RUN 5
> #define IOAT_CHAN_ACTIVE 6
> struct timer_list timer;
> - #define COMPLETION_TIMEOUT msecs_to_jiffies(100)
> - #define IDLE_TIMEOUT msecs_to_jiffies(2000)
> #define RESET_DELAY msecs_to_jiffies(100)
> struct ioatdma_device *ioat_dma;
> dma_addr_t completion_dma;
>

2020-07-06 05:22:38

by Vinod Koul

[permalink] [raw]
Subject: Re: [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter

On 01-07-20, 21:48, [email protected] wrote:
> From: Leonid Ravich <[email protected]>
>
> DMA transaction time to completion is a function of
> PCI bandwidth,transaction size and a queue depth.

space after , pls

> So hard coded value for timeouts might be wrong
> for some scenarios.

I ahve fixed above and applied

--
~Vinod