This patch moves last_snd from struct mptcp_sock to struct
mptcp_sched_data.
Signed-off-by: Geliang Tang <geliang.tang@suse.com>
---
include/net/mptcp.h | 1 +
net/mptcp/protocol.c | 14 +++++++-------
net/mptcp/protocol.h | 1 -
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/include/net/mptcp.h b/include/net/mptcp.h
index 4bba29c99172..4fd84768c5a3 100644
--- a/include/net/mptcp.h
+++ b/include/net/mptcp.h
@@ -101,6 +101,7 @@ struct mptcp_out_options {
struct mptcp_sched_data {
bool reinject;
+ struct sock *last_snd;
struct mptcp_subflow_context *contexts[MPTCP_SUBFLOWS_MAX];
};
diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index 763f709fd5f5..59d36b354f6a 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -1619,7 +1619,7 @@ void __mptcp_push_pending(struct sock *sk, unsigned int flags)
continue;
}
do_check_data_fin = true;
- msk->last_snd = ssk;
+ msk->data->last_snd = ssk;
}
}
}
@@ -1660,7 +1660,7 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool
if (ret <= 0)
break;
copied += ret;
- msk->last_snd = ssk;
+ msk->data->last_snd = ssk;
continue;
}
@@ -1673,7 +1673,7 @@ static void __mptcp_subflow_push_pending(struct sock *sk, struct sock *ssk, bool
if (ret <= 0)
keep_pushing = false;
copied += ret;
- msk->last_snd = ssk;
+ msk->data->last_snd = ssk;
}
mptcp_for_each_subflow(msk, subflow) {
@@ -2457,8 +2457,8 @@ static void __mptcp_close_ssk(struct sock *sk, struct sock *ssk,
WRITE_ONCE(msk->first, NULL);
out:
- if (ssk == msk->last_snd)
- msk->last_snd = NULL;
+ if (ssk == msk->data->last_snd)
+ msk->data->last_snd = NULL;
if (need_push)
__mptcp_push_pending(sk, 0);
@@ -2640,7 +2640,7 @@ static void __mptcp_retrans(struct sock *sk)
release_sock(ssk);
- msk->last_snd = ssk;
+ msk->data->last_snd = ssk;
}
}
dfrag->already_sent = max(dfrag->already_sent, len);
@@ -3142,7 +3142,7 @@ static int mptcp_disconnect(struct sock *sk, int flags)
* subflow
*/
mptcp_destroy_common(msk, MPTCP_CF_FASTCLOSE);
- msk->last_snd = NULL;
+ msk->data->last_snd = NULL;
WRITE_ONCE(msk->flags, 0);
msk->cb_flags = 0;
msk->push_pending = 0;
diff --git a/net/mptcp/protocol.h b/net/mptcp/protocol.h
index 09a5e23adca1..21d59b0875e7 100644
--- a/net/mptcp/protocol.h
+++ b/net/mptcp/protocol.h
@@ -266,7 +266,6 @@ struct mptcp_sock {
atomic64_t rcv_wnd_sent;
u64 rcv_data_fin_seq;
int rmem_fwd_alloc;
- struct sock *last_snd;
int snd_burst;
int old_wspace;
u64 recovery_snd_nxt; /* in recovery mode accept up to this seq;
--
2.35.3