Skip to content

Commit

Permalink
net-tcp_bbr: v3: use correct 64-bit division
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
ptpt52 authored Sep 21, 2024
1 parent 001a430 commit 85c4407
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv4/tcp_bbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ static u32 bbr_tso_segs_generic(struct sock *sk, unsigned int mss_now,
}

bytes = min_t(u32, bytes, gso_max_size - 1 - MAX_TCP_HEADER);
segs = max_t(u32, bytes / mss_now,
segs = max_t(u32, div_u64(bytes, mss_now),
sock_net(sk)->ipv4.sysctl_tcp_min_tso_segs);
return segs;
}
Expand Down

0 comments on commit 85c4407

Please sign in to comment.