mptcp: copy mptcp receive buffer setting to subflow
Subsystems (2)
Florian Westphal
PATCH 1/1 mptcp: copy mptcp receive buffer setting to subflow
For incoming/outgoing connections, initial window is chosen based om the subflow receive buffer size.
In case mptcp socket has a fixed buffer size, we should copy it to the subflow/tcp socket as well.
---
I'll pass this to netdev@ unless there are objections.
net/mptcp/protocol.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
net/mptcp/protocol.c +10 -0
@@ -89,6 +89,15 @@ static bool __mptcp_can_create_subflow(const struct mptcp_sock *msk)return !msk->first; } +static void sync_rcvbuf (const struct sock *msk,struct sock *ssk) +{ +if (unlikely ((msk->sk_userlocks &SOCK_RCVBUF_LOCK ) && + ssk->sk_rcvbuf != msk->sk_rcvbuf)) { + ssk->sk_userlocks |=SOCK_RCVBUF_LOCK ; +WRITE_ONCE (ssk->sk_rcvbuf, msk->sk_rcvbuf); + } +} +static struct socket *__mptcp_socket_create (struct mptcp_sock *msk,int state) {struct mptcp_subflow_context *subflow;
@@ -107,6 +116,7 @@ static struct socket *__mptcp_socket_create(struct mptcp_sock *msk, int state)if (err)return ERR_PTR (err); +sync_rcvbuf (sk, ssock->sk); msk->first = ssock->sk; msk->subflow = ssock; subflow =mptcp_subflow_ctx (ssock->sk);
Signature · 1 line
2.24.1
Mat Martineau
Quoted 5 lines · Florian Westphal
For incoming/outgoing connections, initial window is chosen based om the subflow receive buffer size.
In case mptcp socket has a fixed buffer size, we should copy it to the subflow/tcp socket as well.
Does this need to be synced later in the connection when SO_RECVBUF is changed? If it does, this patch is not really blocked: copying the value at subflow creation time allows initial window tuning that isn't currently possible.
Mat
Quoted 42 lines
Signed-off-by Florian Westphal <fw(a)strlen.de>---
I'll pass this to netdev@ unless there are objections.
net/mptcp/protocol.c| 10 ++++++++++1 file changed, 10 insertions(+)net/mptcp/protocol.c +10
-0@@ -89,6 +89,15 @@ static bool __mptcp_can_create_subflow(const struct mptcp_sock *msk)return !msk->first; } +static void sync_rcvbuf (const struct sock *msk,struct sock *ssk) +{ +if (unlikely ((msk->sk_userlocks &SOCK_RCVBUF_LOCK ) && + ssk->sk_rcvbuf != msk->sk_rcvbuf)) { + ssk->sk_userlocks |=SOCK_RCVBUF_LOCK ; +WRITE_ONCE (ssk->sk_rcvbuf, msk->sk_rcvbuf); + } +} +static struct socket *__mptcp_socket_create (struct mptcp_sock *msk,int state) {struct mptcp_subflow_context *subflow;@@ -107,6 +116,7 @@ static struct socket *__mptcp_socket_create(struct mptcp_sock *msk, int state)if (err)return ERR_PTR (err); +sync_rcvbuf (sk, ssock->sk); msk->first = ssock->sk; msk->subflow = ssock; subflow =mptcp_subflow_ctx (ssock->sk);Signature · 4 lines
2.24.1 _______________________________________________ mptcp mailing list -- mptcp(a)lists.01.org To unsubscribe send an email to mptcp-leave(a)lists.01.org
--
Mat Martineau
Intel