Skip to content

Commit

Permalink
mptcp: fix the max value of scaling_ratio
Browse files Browse the repository at this point in the history
BPF tests fail sometimes (a probability of approximately 1%) with
"bytes != total_bytes" errors:

 test_burst:PASS:open_and_load:burst 0 nsec
 test_bpf_sched:PASS:Scheduler name too long 0 nsec
 test_bpf_sched:PASS:burst 0 nsec
 create_netns:PASS:ip netns add mptcp_ns 0 nsec
 create_netns:PASS:ip -net mptcp_ns link set dev lo up 0 nsec
 sched_init:PASS:create_netns 0 nsec
 endpoint_init:PASS:ip -net mptcp_ns link add veth1 type veth peer name
 endpoint_init:PASS:ip -net mptcp_ns addr add 10.0.1.1/24 dev veth1 0 nsec
 endpoint_init:PASS:ip -net mptcp_ns link set dev veth1 up 0 nsec
 endpoint_init:PASS:ip -net mptcp_ns addr add 10.0.1.2/24 dev veth2 0 nsec
 endpoint_init:PASS:ip -net mptcp_ns link set dev veth2 up 0 nsec
 endpoint_init:PASS:ip -net mptcp_ns mptcp endpoint add 10.0.1.2 subflow
 sched_init:PASS:endpoint_init 0 nsec
 test_bpf_sched:PASS:burst 0 nsec
 send_data_and_verify:PASS:burst 0 nsec
 send_data_and_verify:PASS:burst 0 nsec
 (network_helpers.c:613: errno: Resource temporarily unavailable) \
                                        send 5608500 expected 10485760
 (network_helpers.c:661: errno: None) recv 2755984 expected 10485760
 (network_helpers.c:669: errno: None) Failed in thread_ret -11
 send_data_and_verify:FAIL:send_recv_data unexpected error: -4 (errno 0)
 multipath-tcp#162/9   mptcp/burst:FAIL
 multipath-tcp#162     mptcp:FAIL

In this case, mptcp_recvmsg() gets EAGAIN errors. This issue introduces
by commit b8dc6d6 ("mptcp: fix rcv buffer auto-tuning"). The max
value of scaling_ratio should be TCP_DEFAULT_SCALING_RATIO (128), not
U8_MAX (255). Otherwise, scaling_ratio is assigned to a too high value.

Fixes: b8dc6d6 ("mptcp: fix rcv buffer auto-tuning")
Closes: multipath-tcp#487
Signed-off-by: Geliang Tang <tanggeliang@kylinos.cn>
  • Loading branch information
Geliang Tang committed May 29, 2024
1 parent 66a8e61 commit c23ddaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1987,9 +1987,9 @@ static int __mptcp_recvmsg_mskq(struct mptcp_sock *msk,
*/
static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
{
u8 scaling_ratio = TCP_DEFAULT_SCALING_RATIO;
struct mptcp_subflow_context *subflow;
struct sock *sk = (struct sock *)msk;
u8 scaling_ratio = U8_MAX;
u32 time, advmss = 1;
u64 rtt_us, mstamp;

Expand Down

0 comments on commit c23ddaf

Please sign in to comment.