All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH RFC] liquidio: make timeout HZ independent
@ 2016-08-22 15:45 Nicholas Mc Guire
  0 siblings, 0 replies; 3+ messages in thread
From: Nicholas Mc Guire @ 2016-08-22 15:45 UTC (permalink / raw)
  To: Derek Chickles
  Cc: Satanand Burla, Felix Manlunas, Raghu Vatsavayi, netdev,
	linux-kernel, Nicholas Mc Guire

schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by coccinelle script

The below patch sets the timeout to 100ms - it is not clear though if this
is the intent or if it should be longer/shorter as it is not clear
what HZ setting was assumed during design and used for testing.
This needs an ack by someone who knows the driver and can confirm that
100ms is reasonable to wait for draining in-flight packets.

Patch was compile tested with: x86_64_defconfig + CONFIG_LIQUIDIO=m

Patch is against 4.8.0-rc2 (localversion-next is -next-20160822)

 drivers/net/ethernet/cavium/liquidio/lio_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_main.c b/drivers/net/ethernet/cavium/liquidio/lio_main.c
index 20d6942..bdd6c82 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_main.c
@@ -379,7 +379,7 @@ static inline void pcierror_quiesce_device(struct octeon_device *oct)
 	force_io_queues_off(oct);
 
 	/* To allow for in-flight requests */
-	schedule_timeout_uninterruptible(100);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(100));
 
 	if (wait_for_pending_requests(oct))
 		dev_err(&oct->pci_dev->dev, "There were pending requests\n");
-- 
2.1.4

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

* RE: [PATCH RFC] liquidio: make timeout HZ independent
  2016-12-16  6:57 Nicholas Mc Guire
@ 2016-12-16 17:53 ` Chickles, Derek
  0 siblings, 0 replies; 3+ messages in thread
From: Chickles, Derek @ 2016-12-16 17:53 UTC (permalink / raw)
  To: Nicholas Mc Guire
  Cc: Burla, Satananda, Manlunas, Felix, Vatsavayi, Raghu, netdev,
	linux-kernel

> -----Original Message-----
> From: Nicholas Mc Guire [mailto:hofrat@osadl.org]
> Sent: Thursday, December 15, 2016 10:57 PM
> To: Chickles, Derek
> Cc: Burla, Satananda; Manlunas, Felix; Vatsavayi, Raghu;
> netdev@vger.kernel.org; linux-kernel@vger.kernel.org; Nicholas Mc Guire
> Subject: [PATCH RFC] liquidio: make timeout HZ independent
> 
> schedule_timeout_* takes a timeout in jiffies but the code currently is
> passing in a constant which makes this timeout HZ dependent, so pass it
> through msecs_to_jiffies() to fix this up.
> 
> Fixes: commit b0d66369edcd ("liquidio VF error handling")
> Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
> ---
> 
> Problem found by coccinelle spatch
> 
> The current wait time can vary by a factor 10 depending on the HZ
> setting chose, which does not seem reasonable here.
> 
> The below patch sets the timeout to 100ms - it is though not clear
> if this is the intent or if it should be longer/shorter as it is not
> clear what HZ setting was assumed during design and used for testing.
> 
> This needs an ack by someone who knows the device and can confirm that
> 100ms is reasonable to wait for completion of in-flight requests.

Yes, 100ms was the intent here.

Thanks for catching this.

Derek

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

* [PATCH RFC] liquidio: make timeout HZ independent
@ 2016-12-16  6:57 Nicholas Mc Guire
  2016-12-16 17:53 ` Chickles, Derek
  0 siblings, 1 reply; 3+ messages in thread
From: Nicholas Mc Guire @ 2016-12-16  6:57 UTC (permalink / raw)
  To: Derek Chickles
  Cc: Satanand Burla, Felix Manlunas, Raghu Vatsavayi, netdev,
	linux-kernel, Nicholas Mc Guire

schedule_timeout_* takes a timeout in jiffies but the code currently is
passing in a constant which makes this timeout HZ dependent, so pass it
through msecs_to_jiffies() to fix this up.

Fixes: commit b0d66369edcd ("liquidio VF error handling")
Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org>
---

Problem found by coccinelle spatch

The current wait time can vary by a factor 10 depending on the HZ
setting chose, which does not seem reasonable here.

The below patch sets the timeout to 100ms - it is though not clear
if this is the intent or if it should be longer/shorter as it is not
clear what HZ setting was assumed during design and used for testing.

This needs an ack by someone who knows the device and can confirm that
100ms is reasonable to wait for completion of in-flight requests.

Patch was compile tested with: x86_64_defconfig + CONFIG_LIQUIDIO_VF=m

Patch is against 4.9.0 (localversion-next is -next-20161216)

 drivers/net/ethernet/cavium/liquidio/lio_vf_main.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
index 70d96c1..eca469e 100644
--- a/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
+++ b/drivers/net/ethernet/cavium/liquidio/lio_vf_main.c
@@ -189,7 +189,7 @@ static void pcierror_quiesce_device(struct octeon_device *oct)
 	 */
 
 	/* To allow for in-flight requests */
-	schedule_timeout_uninterruptible(100);
+	schedule_timeout_uninterruptible(msecs_to_jiffies(100));
 
 	if (wait_for_pending_requests(oct))
 		dev_err(&oct->pci_dev->dev, "There were pending requests\n");
-- 
2.1.4

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

end of thread, other threads:[~2016-12-17  0:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-08-22 15:45 [PATCH RFC] liquidio: make timeout HZ independent Nicholas Mc Guire
2016-12-16  6:57 Nicholas Mc Guire
2016-12-16 17:53 ` Chickles, Derek

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.