Skip to content

Commit

Permalink
Revert "mptcp: kmemleak"
Browse files Browse the repository at this point in the history
This reverts commit a62555b.
  • Loading branch information
Geliang Tang committed May 11, 2024
1 parent a62555b commit 7b513da
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 13 deletions.
1 change: 0 additions & 1 deletion net/ipv4/tcp_input.c
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,6 @@ static void tcp_measure_rcv_mss(struct sock *sk, const struct sk_buff *skb)
do_div(val, skb->truesize);
tcp_sk(sk)->scaling_ratio = val ? val : 1;
}
pr_info("sk=%p scaling_ratio=%u\n", sk, tcp_sk(sk)->scaling_ratio);
icsk->icsk_ack.rcv_mss = min_t(unsigned int, len,
tcp_sk(sk)->advmss);
/* Account for possibly-removed options */
Expand Down
14 changes: 2 additions & 12 deletions net/mptcp/protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1891,14 +1891,11 @@ static int mptcp_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
continue;

wait_for_memory:
pr_info("%s wait_for_memory", __func__);
set_bit(SOCK_NOSPACE, &sk->sk_socket->flags);
__mptcp_push_pending(sk, msg->msg_flags);
ret = sk_stream_wait_memory(sk, &timeo);
if (ret) {
pr_info("%s goto do_error ret=%d\n", __func__, ret);
if (ret)
goto do_error;
}
}

if (copied)
Expand Down Expand Up @@ -1979,9 +1976,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 All @@ -2005,11 +2002,9 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
rtt_us = 0;
mptcp_for_each_subflow(msk, subflow) {
const struct tcp_sock *tp;
struct sock *ssk;
u64 sf_rtt_us;
u32 sf_advmss;

ssk = mptcp_subflow_tcp_sock(subflow);
tp = tcp_sk(mptcp_subflow_tcp_sock(subflow));

sf_rtt_us = READ_ONCE(tp->rcv_rtt_est.rtt_us);
Expand All @@ -2018,12 +2013,10 @@ static void mptcp_rcv_space_adjust(struct mptcp_sock *msk, int copied)
rtt_us = max(sf_rtt_us, rtt_us);
advmss = max(sf_advmss, advmss);
scaling_ratio = min(tp->scaling_ratio, scaling_ratio);
pr_info("ssk=%p scaling_ratio=%u, tp->scaling_ratio=%u state=%u\n", ssk, scaling_ratio, tp->scaling_ratio, inet_sk_state_load(ssk));
}

msk->rcvq_space.rtt_us = rtt_us;
msk->scaling_ratio = scaling_ratio;
pr_info("msk->scaling_ratio=%u\n", msk->scaling_ratio);
if (time < (rtt_us >> 3) || rtt_us == 0)
return;

Expand Down Expand Up @@ -2238,7 +2231,6 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
}

if (!timeo) {
pr_info("%s EAGAIN", __func__);
copied = -EAGAIN;
break;
}
Expand Down Expand Up @@ -2272,8 +2264,6 @@ static int mptcp_recvmsg(struct sock *sk, struct msghdr *msg, size_t len,
mptcp_rcv_space_adjust(msk, copied);

release_sock(sk);
if (copied == -EAGAIN)
pr_info("%s return EAGAIN", __func__);
return copied;
}

Expand Down

0 comments on commit 7b513da

Please sign in to comment.