pktgen: restore nanosec delays
Subsystems (2)
PATCH 1/1 pktgen: restore nanosec delays
Commit fd29cf72 (pktgen: convert to use ktime_t) inadvertantly converted "delay" parameter from nanosec to microsec.
---
net/core/pktgen.c +1 -1
@@ -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);
Quoted 11 lines · On Sat, 03 Oct 2009 13:39:18 +0200 Eric Dumazet <[email protected]> wrote:
Commit
fd29cf72(pktgen: convert to usektime_t) inadvertantly converted "delay" parameter from nanosec to microsec.Signed-off-by Eric Dumazet <[email protected]>---
net/core/pktgen.c +0
-0
net/core/pktgen.c static ssize_t pktgen_if_write(struct file *file, · line 967
Quoted 5 lines
net/core/pktgen.c +1
-1@@ -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?
Quoted 9 lines · Stephen Hemminger
Quoted 6 lines · On Sat, 03 Oct 2009 13:39:18 +0200 Eric Dumazet <[email protected]> wrote:
Commit
fd29cf72(pktgen: convert to usektime_t) inadvertantly converted "delay" parameter from nanosec to microsec.Signed-off-by Eric Dumazet <[email protected]>---
Quoted 12 lines
net/core/pktgen.c static ssize_t pktgen_if_write(struct file *file, · line 967
Quoted 10 lines
net/core/pktgen.c +1
-1@@ -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.
From: Eric Dumazet <[email protected]>
Date: Sat, 03 Oct 2009 13:39:18 +0200
Quoted 4 lines
Commit
fd29cf72(pktgen: convert to usektime_t) inadvertantly converted "delay" parameter from nanosec to microsec.Signed-off-by Eric Dumazet <[email protected]>
Applied.