From 8d07b3f87145284d5287e1e7771abe39f2e51758 Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Wed, 27 Nov 2024 15:27:00 +0800 Subject: [PATCH] EAGAIN fix Signed-off-by: Geliang Tang --- net/mptcp/protocol.c | 1 + 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 | 3 +++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index e6faa49026dae..52aeeca292b7b 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2272,6 +2272,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 26fff876a1b26..9497582c43d85 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 cf925f52c29ec..800b961187e8e 100644 --- a/tools/testing/selftests/bpf/prog_tests/mptcp.c +++ b/tools/testing/selftests/bpf/prog_tests/mptcp.c @@ -1200,7 +1200,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 7708e64ad68ef..47783327c1453 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;