Skip to content

Commit fc33cc7

Browse files
Eric Dumazetdavem330
authored andcommitted
netem: fix build error on 32bit arches
ERROR: "__udivdi3" [net/sched/sch_netem.ko] undefined! Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Acked-by: Hagen Paul Pfeifer <hagen@jauu.net> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8aa953d commit fc33cc7

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎net/sched/sch_netem.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,10 @@ static psched_tdiff_t tabledist(psched_tdiff_t mu, psched_tdiff_t sigma,
301301

302302
static psched_time_t packet_len_2_sched_time(unsigned int len, u32 rate)
303303
{
304-
return PSCHED_NS2TICKS((u64)len * NSEC_PER_SEC / rate);
304+
u64 ticks = (u64)len * NSEC_PER_SEC;
305+
306+
do_div(ticks, rate);
307+
return PSCHED_NS2TICKS(ticks);
305308
}
306309

307310
/*

0 commit comments

Comments
 (0)