Skip to content

Commit 07a0f0f

Browse files
danielttdavem330
authored andcommitted
pktgen: Fix accuracy of inter-packet delay.
This patch correct a bug in the delay of pktgen. It makes sure the inter-packet interval is accurate. Signed-off-by: Daniel Turull <[email protected]> Signed-off-by: Robert Olsson <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent ae638c4 commit 07a0f0f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/core/pktgen.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2170,7 +2170,7 @@ static void spin(struct pktgen_dev *pkt_dev, ktime_t spin_until)
21702170
end_time = ktime_now();
21712171

21722172
pkt_dev->idle_acc += ktime_to_ns(ktime_sub(end_time, start_time));
2173-
pkt_dev->next_tx = ktime_add_ns(end_time, pkt_dev->delay);
2173+
pkt_dev->next_tx = ktime_add_ns(spin_until, pkt_dev->delay);
21742174
}
21752175

21762176
static inline void set_pkt_overhead(struct pktgen_dev *pkt_dev)

0 commit comments

Comments
 (0)