All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] dmaengine: ioat setting ioat timeout as module parameter
@ 2020-07-01 14:08 leonid.ravich
  2020-07-01 14:25 ` Dave Jiang
                   ` (3 more replies)
  0 siblings, 4 replies; 7+ messages in thread
From: leonid.ravich @ 2020-07-01 14:08 UTC (permalink / raw)
  To: dmaengine
  Cc: lravich, Leonid Ravich, Dan Williams, Vinod Koul, Dave Jiang,
	Alexander.Barabash, linux-kernel

From: Leonid Ravich <Leonid.Ravich@emc.com>

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 <Leonid.Ravich@emc.com>
---
 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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] dmaengine: ioat setting ioat timeout as module parameter
  2020-07-01 14:08 [PATCH] dmaengine: ioat setting ioat timeout as module parameter leonid.ravich
@ 2020-07-01 14:25 ` Dave Jiang
  2020-07-01 18:48 ` [PATCH v2] " leonid.ravich
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 7+ messages in thread
From: Dave Jiang @ 2020-07-01 14:25 UTC (permalink / raw)
  To: leonid.ravich, dmaengine
  Cc: lravich, Dan Williams, Vinod Koul, Alexander.Barabash, linux-kernel



On 7/1/2020 7:08 AM, leonid.ravich@dell.com wrote:
> From: Leonid Ravich <Leonid.Ravich@emc.com>
> 
> 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 <Leonid.Ravich@emc.com>
> ---
>   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;
> 

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter
  2020-07-01 14:08 [PATCH] dmaengine: ioat setting ioat timeout as module parameter leonid.ravich
  2020-07-01 14:25 ` Dave Jiang
@ 2020-07-01 18:48 ` leonid.ravich
  2020-07-01 19:04   ` Dave Jiang
  2020-07-06  5:18   ` Vinod Koul
  2020-07-07 14:44 ` [PATCH] " kernel test robot
  2020-07-07 14:44 ` [RFC PATCH] dmaengine: complition_timeout can be static kernel test robot
  3 siblings, 2 replies; 7+ messages in thread
From: leonid.ravich @ 2020-07-01 18:48 UTC (permalink / raw)
  To: dmaengine
  Cc: lravich, Leonid Ravich, Dan Williams, Vinod Koul, Dave Jiang,
	Alexander.Barabash, linux-kernel

From: Leonid Ravich <Leonid.Ravich@emc.com>

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 <Leonid.Ravich@emc.com>
---
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


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter
  2020-07-01 18:48 ` [PATCH v2] " leonid.ravich
@ 2020-07-01 19:04   ` Dave Jiang
  2020-07-06  5:18   ` Vinod Koul
  1 sibling, 0 replies; 7+ messages in thread
From: Dave Jiang @ 2020-07-01 19:04 UTC (permalink / raw)
  To: leonid.ravich, dmaengine
  Cc: lravich, Dan Williams, Vinod Koul, Alexander.Barabash, linux-kernel



On 7/1/2020 11:48 AM, leonid.ravich@dell.com wrote:
> From: Leonid Ravich <Leonid.Ravich@emc.com>
> 
> 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 <Leonid.Ravich@emc.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH v2] dmaengine: ioat setting ioat timeout as module parameter
  2020-07-01 18:48 ` [PATCH v2] " leonid.ravich
  2020-07-01 19:04   ` Dave Jiang
@ 2020-07-06  5:18   ` Vinod Koul
  1 sibling, 0 replies; 7+ messages in thread
From: Vinod Koul @ 2020-07-06  5:18 UTC (permalink / raw)
  To: leonid.ravich
  Cc: dmaengine, lravich, Dan Williams, Dave Jiang, Alexander.Barabash,
	linux-kernel

On 01-07-20, 21:48, leonid.ravich@dell.com wrote:
> From: Leonid Ravich <Leonid.Ravich@emc.com>
> 
> 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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] dmaengine: ioat setting ioat timeout as module parameter
  2020-07-01 14:08 [PATCH] dmaengine: ioat setting ioat timeout as module parameter leonid.ravich
  2020-07-01 14:25 ` Dave Jiang
  2020-07-01 18:48 ` [PATCH v2] " leonid.ravich
@ 2020-07-07 14:44 ` kernel test robot
  2020-07-07 14:44 ` [RFC PATCH] dmaengine: complition_timeout can be static kernel test robot
  3 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-07-07 14:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 1555 bytes --]

Hi,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.8-rc4]
[cannot apply to next-20200707]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use  as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/leonid-ravich-dell-com/dmaengine-ioat-setting-ioat-timeout-as-module-parameter/20200701-221154
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 7c30b859a947535f2213277e827d7ac7dcff9c84
config: x86_64-randconfig-s022-20200707 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-14) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.2-31-gabbfd661-dirty
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>


sparse warnings: (new ones prefixed by >>)

>> drivers/dma/ioat/dma.c:29:5: sparse: sparse: symbol 'complition_timeout' was not declared. Should it be static?
   drivers/dma/ioat/dma.c:463:5: sparse: sparse: context imbalance in 'ioat_check_space_lock' - different lock contexts for basic block

Please review and possibly fold the followup patch.

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 37569 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [RFC PATCH] dmaengine: complition_timeout can be static
  2020-07-01 14:08 [PATCH] dmaengine: ioat setting ioat timeout as module parameter leonid.ravich
                   ` (2 preceding siblings ...)
  2020-07-07 14:44 ` [PATCH] " kernel test robot
@ 2020-07-07 14:44 ` kernel test robot
  3 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2020-07-07 14:44 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 562 bytes --]


Signed-off-by: kernel test robot <lkp@intel.com>
---
 dma.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/dma/ioat/dma.c b/drivers/dma/ioat/dma.c
index 7621b5be5cf45..0f87bdf92af06 100644
--- a/drivers/dma/ioat/dma.c
+++ b/drivers/dma/ioat/dma.c
@@ -26,7 +26,7 @@
 
 #include "../dmaengine.h"
 
-int complition_timeout = 200;
+static int complition_timeout = 200;
 module_param(complition_timeout, int, 0644);
 MODULE_PARM_DESC(complition_timeout,
 		"set ioat complition timeout [msec] (default 200 [msec])");

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2020-07-07 14:44 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-01 14:08 [PATCH] dmaengine: ioat setting ioat timeout as module parameter leonid.ravich
2020-07-01 14:25 ` Dave Jiang
2020-07-01 18:48 ` [PATCH v2] " leonid.ravich
2020-07-01 19:04   ` Dave Jiang
2020-07-06  5:18   ` Vinod Koul
2020-07-07 14:44 ` [PATCH] " kernel test robot
2020-07-07 14:44 ` [RFC PATCH] dmaengine: complition_timeout can be static kernel test robot

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.