From bf32f937c123bba5e687a8cced73bcd18a7b8b6d Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Wed, 23 Oct 2024 10:01:36 +0800 Subject: [PATCH] fix Signed-off-by: Geliang Tang --- net/mptcp/protocol.c | 5 +++-- tools/testing/selftests/bpf/network_helpers.c | 4 ++++ tools/testing/selftests/bpf/prog_tests/mptcp.c | 2 +- tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c | 7 +++++-- tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c | 1 + 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index 88159b90bbf7..28e9f0f3649e 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -1754,7 +1754,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) /* ensure fitting the notsent_lowat() constraint */ copy_limit = mptcp_send_limit(sk); if (!copy_limit) { - pr_info("%s call wait_for_memory timeo=%ld\n", __func__, timeo); + //pr_info("%s call wait_for_memory timeo=%ld\n", __func__, timeo); goto wait_for_memory; } @@ -1817,7 +1817,7 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len) set_bit(SOCK_NOSPACE, &sk->sk_socket->flags); __mptcp_push_pending(sk, msg->msg_flags); ret = sk_stream_wait_memory(sk, &timeo); - pr_info("%s sk_stream_wait_memory ret=%d timeo=%ld\n", __func__, ret, timeo); + //pr_info("%s sk_stream_wait_memory ret=%d timeo=%ld\n", __func__, ret, timeo); if (ret) goto do_error; } @@ -2170,6 +2170,7 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len, if (!timeo) { copied = -EAGAIN; + pr_info("%s return EAGAIN\n", __func__); break; } diff --git a/tools/testing/selftests/bpf/network_helpers.c b/tools/testing/selftests/bpf/network_helpers.c index 26fff876a1b2..9497582c43d8 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -652,6 +652,8 @@ static void *send_recv_server(void *arg) if (nr_sent == -1 && errno == EINTR) continue; if (nr_sent == -1) { + //if (errno == EAGAIN) + // continue; err = -errno; break; } @@ -701,6 +703,8 @@ int send_recv_data(int lfd, int fd, uint32_t total_bytes, int timeout_ms) if (nr_recv == -1 && errno == EINTR) continue; if (nr_recv == -1) { + //if (errno == EAGAIN) + // continue; err = -errno; break; } diff --git a/tools/testing/selftests/bpf/prog_tests/mptcp.c b/tools/testing/selftests/bpf/prog_tests/mptcp.c index c652e3f38f44..482c13cc4a18 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -1221,7 +1221,7 @@ static void send_data_and_verify(char *sched, bool addr1, bool addr2) if (!ASSERT_OK_FD(server_fd, "start_mptcp_server")) goto skel_destroy; - client_fd = connect_to_fd(server_fd, 0); + client_fd = connect_to_fd(server_fd, 30000); if (!ASSERT_OK_FD(client_fd, "connect_to_fd")) goto close_server; diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c index 85821774bd5e..12ef5accf1f7 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c @@ -21,6 +21,9 @@ int BPF_PROG(trace_mptcp_sched_get_send, struct mptcp_sock *msk) if (!msk->pm.server_side) return 0; + bytes_sent_1 = 0; + bytes_sent_2 = 0; + mptcp_for_each_subflow(msk, subflow) { struct tcp_sock *tp; struct sock *ssk; @@ -30,10 +33,10 @@ int BPF_PROG(trace_mptcp_sched_get_send, struct mptcp_sock *msk) tp = bpf_core_cast(ssk, struct tcp_sock); if (subflow->subflow_id == 1) { - bpf_printk("bytes 1: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows); + //bpf_printk("bytes 1: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows); bytes_sent_1 += tp->bytes_sent; } else if (subflow->subflow_id == 2) { - bpf_printk("bytes 2: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows); + //bpf_printk("bytes 2: sent %lu received %lu subflows %u", tp->bytes_sent, tp->bytes_received, msk->pm.subflows); bytes_sent_2 += tp->bytes_sent; } } diff --git a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c index dd2710e1208e..11f334f469dd 100644 --- a/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c +++ b/tools/testing/selftests/bpf/progs/mptcp_bpf_rr.c @@ -61,6 +61,7 @@ int BPF_PROG(bpf_rr_get_send, struct mptcp_sock *msk) out: mptcp_subflow_set_scheduled(next, true); + //bpf_printk("rr subflow=%u/%u", next->subflow_id, msk->pm.subflows + 1); ptr->last_snd = mptcp_subflow_tcp_sock(next); return 0; }