Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 266891
b: refs/heads/master
c: 33136d1
h: refs/heads/master
i:
  266889: 5e9093a
  266887: fcf190f
v: v3
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Oct 20, 2011
1 parent d147d8f commit 81787ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e9266a02b7e6542355431955075b4e688962fc0a
refs/heads/master: 33136d12be00596a8320d4fe88f95c44f67afbdb
11 changes: 7 additions & 4 deletions trunk/net/core/pktgen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2145,9 +2145,12 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
}

start_time = ktime_now();
if (remaining < 100000)
ndelay(remaining); /* really small just spin */
else {
if (remaining < 100000) {
/* for small delays (<100us), just loop until limit is reached */
do {
end_time = ktime_now();
} while (ktime_lt(end_time, spin_until));
} else {
/* see do_nanosleep */
hrtimer_init_sleeper(&t, current);
do {
Expand All @@ -2162,8 +2165,8 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
hrtimer_cancel(&t.timer);
} while (t.task && pkt_dev->running && !signal_pending(current));
__set_current_state(TASK_RUNNING);
end_time = ktime_now();
}
end_time = ktime_now();

pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
Expand Down

0 comments on commit 81787ac

Please sign in to comment.