Skip to content

Commit

Permalink
mptcp: fix EAGAIN errors in MPTCP BPF tests
Browse files Browse the repository at this point in the history
BPF tests fail sometimes with "bytes != total_bytes" errors:

 test_default:PASS:sched_init:default 0 nsec
 send_data:PASS:pthread_create 0 nsec
 send_data:FAIL:recv 936000 != 10485760 nr_recv:-1 errno:11
 default: 3041 ms
 server:FAIL:send 7579500 != 10485760 nr_sent:-1 errno:11
 send_data:FAIL:pthread_join thread_ret:-11 test_default:PASS: \
				has_bytes_sent addr_1 0 nsec
 test_default:PASS:has_bytes_sent addr_2 0 nsec
 close_netns:PASS:setns 0 nsec

In this case mptcp_recvmsg gets EAGAIN errors. This issue introduces
by commit dfa2f04 ("tcp: get rid of sysctl_tcp_adv_win_scale").
This patch fixes it by adding sk_is_mptcp() check defore update
scaling_ratio in tcp_measure_rcv_mss(). Do not update scaling_ratio if
this is a MPTCP socket.

Fixes: dfa2f04 ("tcp: get rid of sysctl_tcp_adv_win_scale")
Closes: multipath-tcp/mptcp_net-next#487
Signed-off-by: Geliang Tang <[email protected]>
  • Loading branch information
Geliang Tang authored and intel-lab-lkp committed May 2, 2024
1 parent 79cb096 commit 6ff34bb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,10 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
/* Note: divides are still a bit expensive.
* For the moment, only adjust scaling_ratio
* when we update icsk_ack.rcv_mss.
*
* This breaks MPTCP BPF tests, skip it.
*/
if (unlikely(len != icsk->icsk_ack.rcv_mss)) {
if (unlikely(len != icsk->icsk_ack.rcv_mss && !sk_is_mptcp(sk))) {
u64 val = (u64)skb->len << TCP_RMEM_TO_WIN_SCALE;

do_div(val, skb->truesize);
Expand Down

0 comments on commit 6ff34bb

Please sign in to comment.