Skip to content

Commit

Permalink
net-tcp_bbr: v3: change u64 to unsigned long for bytes in `bbr_…
Browse files Browse the repository at this point in the history
…tso_segs_generic`

This change addresses a build failure on 32-bit systems due to undefined division symbols:

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!

Since `sk->sk_pacing_rate` is already an `unsigned long`, the `bytes` variable is
updated to `unsigned long` to resolve these division issues and ensure compatibility
across both 32-bit and 64-bit platforms.

Signed-off-by: Chen Minqiang <[email protected]>
  • Loading branch information
ptpt52 committed Sep 27, 2024
1 parent 001a430 commit dcc8b20
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 @@ -481,7 +481,7 @@ static u32 bbr_tso_segs_generic(struct sock *sk, unsigned int mss_now,
{
struct bbr *bbr = inet_csk_ca(sk);
u32 segs, r;
u64 bytes;
unsigned long bytes;

/* Budget a TSO/GSO burst size allowance based on bw (pacing_rate). */
bytes = sk->sk_pacing_rate >> sk->sk_pacing_shift;
Expand Down

0 comments on commit dcc8b20

Please sign in to comment.