From 468347b29dffc444aff5c705fe0e8082045d7c6f Mon Sep 17 00:00:00 2001 From: Geliang Tang Date: Fri, 29 Nov 2024 09:29:03 +0800 Subject: [PATCH] TODO Signed-off-by: Geliang Tang --- net/mptcp/bpf.c | 5 ++++- net/mptcp/protocol.c | 1 + tools/testing/selftests/bpf/network_helpers.c | 8 ++++---- tools/testing/selftests/bpf/progs/mptcp_bpf_bytes.c | 3 +++ 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/net/mptcp/bpf.c b/net/mptcp/bpf.c index 7ef85d1c78b0a..13e7b8cd152ab 100644 --- a/net/mptcp/bpf.c +++ b/net/mptcp/bpf.c @@ -293,7 +293,10 @@ static const struct bpf_func_proto bpf_mptcp_ssk_cast_proto = { .func = bpf_mptcp_ssk_cast, .gpl_only = false, .ret_type = RET_PTR_TO_BTF_ID_OR_NULL, - .arg1_type = ARG_ANYTHING, + //ARG_CONST_SIZE_OR_ZERO, + //.arg1_type = ARG_PTR_TO_CTX, + //.arg1_type = ARG_PTR_TO_STACK, + .arg1_type = ARG_PTR_TO_BTF_ID, .ret_btf_id = &btf_sock_ids[BTF_SOCK_TYPE_SOCK], }; diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index e319bb2cbe4c7..9ca1fc35350fe 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -2277,6 +2277,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 8ba676ecac474..eb31b49b6d7bc 100644 --- a/tools/testing/selftests/bpf/network_helpers.c +++ b/tools/testing/selftests/bpf/network_helpers.c @@ -652,8 +652,8 @@ static void *send_recv_server(void *arg) if (nr_sent == -1 && errno == EINTR) continue; if (nr_sent == -1) { - if (errno == EAGAIN) - continue; + //if (errno == EAGAIN) + // continue; err = -errno; break; } @@ -703,8 +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; + //if (errno == EAGAIN) + // continue; err = -errno; break; } 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;