Skip to content

Commit 85c4407

Browse files
authored
net-tcp_bbr: v3: use correct 64-bit division
This commit addresses an issue with integer division on 32-bit system builds, which resulted in undefined symbol errors during the build process. Errors observed: arm: ERROR: modpost: "__aeabi_uldivmod" [net/ipv4/tcp_bbr.ko] undefined! ERROR: modpost: "__aeabi_ldivmod" [net/ipv4/tcp_bbr.ko] undefined! x86, mips, ppc: ERROR: modpost: "__udivdi3" [net/ipv4/tcp_bbr.ko] undefined! ERROR: modpost: "__divdi3" [net/ipv4/tcp_bbr.ko] undefined! The fix ensures proper 64-bit division on affected architectures. Signed-off-by: Chen Minqiang <ptpt52@gmail.com>
1 parent 001a430 commit 85c4407

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_bbr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -497,7 +497,7 @@ static u32 bbr_tso_segs_generic(struct sock *sk, unsigned int mss_now,
497497
}
498498

499499
bytes = min_t(u32, bytes, gso_max_size - 1 - MAX_TCP_HEADER);
500-
segs = max_t(u32, bytes / mss_now,
500+
segs = max_t(u32, div_u64(bytes, mss_now),
501501
sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);
502502
return segs;
503503
}

0 commit comments

Comments
 (0)