netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] pktgen: restore nanosec delays
@ 2009-10-03 11:39 Eric Dumazet
  2009-10-04  4:16 ` Stephen Hemminger
  2009-10-05  4:09 ` David Miller
  0 siblings, 2 replies; 4+ messages in thread
From: Eric Dumazet @ 2009-10-03 11:39 UTC (permalink / raw)
  To: David S. Miller; +Cc: Stephen Hemminger, Linux Netdev List

Commit fd29cf72 (pktgen: convert to use ktime_t)
inadvertantly converted "delay" parameter from nanosec to microsec.

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---

diff --git a/net/core/pktgen.c b/net/core/pktgen.c
index b694552..227ba31 100644
--- a/net/core/pktgen.c
+++ b/net/core/pktgen.c
@@ -964,7 +964,7 @@ static ssize_t pktgen_if_write(struct file *file,
 		if (value == 0x7FFFFFFF)
 			pkt_dev->delay = ULLONG_MAX;
 		else
-			pkt_dev->delay = (u64)value * NSEC_PER_USEC;
+			pkt_dev->delay = (u64)value;
 
 		sprintf(pg_result, "OK: delay=%llu",
 			(unsigned long long) pkt_dev->delay);

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

* Re: [PATCH] pktgen: restore nanosec delays
  2009-10-03 11:39 [PATCH] pktgen: restore nanosec delays Eric Dumazet
@ 2009-10-04  4:16 ` Stephen Hemminger
  2009-10-04  6:45   ` Eric Dumazet
  2009-10-05  4:09 ` David Miller
  1 sibling, 1 reply; 4+ messages in thread
From: Stephen Hemminger @ 2009-10-04  4:16 UTC (permalink / raw)
  To: Eric Dumazet; +Cc: David S. Miller, Linux Netdev List

On Sat, 03 Oct 2009 13:39:18 +0200
Eric Dumazet <eric.dumazet@gmail.com> wrote:

> Commit fd29cf72 (pktgen: convert to use ktime_t)
> inadvertantly converted "delay" parameter from nanosec to microsec.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
> ---
> 
> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
> index b694552..227ba31 100644
> --- a/net/core/pktgen.c
> +++ b/net/core/pktgen.c
> @@ -964,7 +964,7 @@ static ssize_t pktgen_if_write(struct file *file,
>  		if (value == 0x7FFFFFFF)
>  			pkt_dev->delay = ULLONG_MAX;
>  		else
> -			pkt_dev->delay = (u64)value * NSEC_PER_USEC;
> +			pkt_dev->delay = (u64)value;

Is the cast really necessary?

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

* Re: [PATCH] pktgen: restore nanosec delays
  2009-10-04  4:16 ` Stephen Hemminger
@ 2009-10-04  6:45   ` Eric Dumazet
  0 siblings, 0 replies; 4+ messages in thread
From: Eric Dumazet @ 2009-10-04  6:45 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: David S. Miller, Linux Netdev List

Stephen Hemminger a écrit :
> On Sat, 03 Oct 2009 13:39:18 +0200
> Eric Dumazet <eric.dumazet@gmail.com> wrote:
> 
>> Commit fd29cf72 (pktgen: convert to use ktime_t)
>> inadvertantly converted "delay" parameter from nanosec to microsec.
>>
>> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
>> ---
>>
>> diff --git a/net/core/pktgen.c b/net/core/pktgen.c
>> index b694552..227ba31 100644
>> --- a/net/core/pktgen.c
>> +++ b/net/core/pktgen.c
>> @@ -964,7 +964,7 @@ static ssize_t pktgen_if_write(struct file *file,
>>  		if (value == 0x7FFFFFFF)
>>  			pkt_dev->delay = ULLONG_MAX;
>>  		else
>> -			pkt_dev->delay = (u64)value * NSEC_PER_USEC;
>> +			pkt_dev->delay = (u64)value;
> 
> Is the cast really necessary?

It reminds us 'value' is 32 bits, but it's not necessary, as C compiler
can silently do the cast.


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

* Re: [PATCH] pktgen: restore nanosec delays
  2009-10-03 11:39 [PATCH] pktgen: restore nanosec delays Eric Dumazet
  2009-10-04  4:16 ` Stephen Hemminger
@ 2009-10-05  4:09 ` David Miller
  1 sibling, 0 replies; 4+ messages in thread
From: David Miller @ 2009-10-05  4:09 UTC (permalink / raw)
  To: eric.dumazet; +Cc: shemminger, netdev

From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Sat, 03 Oct 2009 13:39:18 +0200

> Commit fd29cf72 (pktgen: convert to use ktime_t)
> inadvertantly converted "delay" parameter from nanosec to microsec.
> 
> Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>

Applied.

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

end of thread, other threads:[~2009-10-05  4:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-10-03 11:39 [PATCH] pktgen: restore nanosec delays Eric Dumazet
2009-10-04  4:16 ` Stephen Hemminger
2009-10-04  6:45   ` Eric Dumazet
2009-10-05  4:09 ` David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).