mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
* [PATCH mptcp-next v1 0/5] mptcp: add support for TFO, sender side only
@ 2022-09-21 15:25 Benjamin Hesmans
  2022-09-21 15:25 ` [PATCH mptcp-next v1 1/5] mptcp: add TCP_FASTOPEN_CONNECT socket option Benjamin Hesmans
                   ` (4 more replies)
  0 siblings, 5 replies; 12+ messages in thread
From: Benjamin Hesmans @ 2022-09-21 15:25 UTC (permalink / raw)
  To: mptcp; +Cc: Benjamin Hesmans

The series only consider the sender side.

Compared to the previous RFC patches, these ones focus on
the sender side only. It corresponds to the 4 first patches from the RFC
series.

The sending part is less complex and even if it looks like we are
converging for the receive part, there are still discussions on-going
there.

Again, thank you Dmytro for the previous work done. As already discussed
on the ML and meeting, this approach was slightly different from what
Dmytro originally proposed. Here tcp_sendmsg_fastopen() is exported and
re-used and TCP_FASTOPEN_CONNECT is supported. MSG_FASTOPEN was already
handled by Dmytro's patches and it has been added to the series re-using
Dmytro's SoB, hopefully that's still OK for him.

Individual changelogs have been added per patch.


Benjamin Hesmans (4):
  mptcp: add TCP_FASTOPEN_CONNECT socket option
  tcp: export tcp_sendmsg_fastopen
  mptcp: handle defer connect in mptcp_sendmsg
  mptcp: poll allow write call before actual connect

Dmytro Shytyi (1):
  mptcp: add MSG_FASTOPEN support

 include/net/tcp.h    |  2 ++
 net/ipv4/tcp.c       |  5 ++---
 net/mptcp/protocol.c | 32 ++++++++++++++++++++++++++++----
 net/mptcp/sockopt.c  | 19 ++++++++++++++++++-
 4 files changed, 50 insertions(+), 8 deletions(-)

-- 
2.25.1


-- 


Disclaimer: https://www.tessares.net/mail-disclaimer/ 
<https://www.tessares.net/mail-disclaimer/>



^ permalink raw reply	[flat|nested] 12+ messages in thread
* [PATCH mptcp-next v2 4/4] mptcp: poll allow write call before actual connect
@ 2022-09-22 13:56 Benjamin Hesmans
  2022-09-22 14:42 ` mptcp: poll allow write call before actual connect: Tests Results MPTCP CI
  2022-09-22 16:05 ` MPTCP CI
  0 siblings, 2 replies; 12+ messages in thread
From: Benjamin Hesmans @ 2022-09-22 13:56 UTC (permalink / raw)
  To: mptcp; +Cc: Benjamin Hesmans

If fastopen is used, poll must allow a first write that will trigger
the SYN+data

Similar to what is done in tcp_poll().

Signed-off-by: Benjamin Hesmans <benjamin.hesmans@tessares.net>
---

Notes:
    v2:
    - Using __mptcp_nmpc_socket() without lock on msk socket was unsafe.  Instead
      copy the defer_connect from mptcp_stream_connect() and check this flags
      instead. (Paolo's review)

 net/mptcp/protocol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index f5f20910cd83..0eeb8115c9d0 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3616,6 +3616,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 
 do_connect:
 	err = ssock->ops->connect(ssock, uaddr, addr_len, flags);
+	inet_sk(sock->sk)->defer_connect = inet_sk(ssock->sk)->defer_connect;
 	sock->state = ssock->state;
 
 	/* on successful connect, the msk state will be moved to established by
@@ -3754,6 +3755,9 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 	if (state != TCP_SYN_SENT && state != TCP_SYN_RECV) {
 		mask |= mptcp_check_readable(msk);
 		mask |= mptcp_check_writeable(msk);
+	} else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) {
+		/* cf tcp_poll() note about TFO */
+		mask |= EPOLLOUT | EPOLLWRNORM;
 	}
 	if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE)
 		mask |= EPOLLHUP;
-- 
2.25.1


-- 


Disclaimer: https://www.tessares.net/mail-disclaimer/ 
<https://www.tessares.net/mail-disclaimer/>



^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH mptcp-next v3 4/4] mptcp: poll allow write call before actual connect
@ 2022-09-23 12:19 Benjamin Hesmans
  2022-09-23 15:21 ` mptcp: poll allow write call before actual connect: Tests Results MPTCP CI
  0 siblings, 1 reply; 12+ messages in thread
From: Benjamin Hesmans @ 2022-09-23 12:19 UTC (permalink / raw)
  To: mptcp; +Cc: Benjamin Hesmans

If fastopen is used, poll must allow a first write that will trigger
the SYN+data

Similar to what is done in tcp_poll().

Signed-off-by: Benjamin Hesmans <benjamin.hesmans@tessares.net>
---

Notes:
    v2:
    - Using __mptcp_nmpc_socket() without lock on msk socket was unsafe.  Instead
      copy the defer_connect from mptcp_stream_connect() and check this flags
      instead. (Paolo's review)

 net/mptcp/protocol.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index f5f20910cd83..0eeb8115c9d0 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3616,6 +3616,7 @@ static int mptcp_stream_connect(struct socket *sock, struct sockaddr *uaddr,
 
 do_connect:
 	err = ssock->ops->connect(ssock, uaddr, addr_len, flags);
+	inet_sk(sock->sk)->defer_connect = inet_sk(ssock->sk)->defer_connect;
 	sock->state = ssock->state;
 
 	/* on successful connect, the msk state will be moved to established by
@@ -3754,6 +3755,9 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 	if (state != TCP_SYN_SENT && state != TCP_SYN_RECV) {
 		mask |= mptcp_check_readable(msk);
 		mask |= mptcp_check_writeable(msk);
+	} else if (state == TCP_SYN_SENT && inet_sk(sk)->defer_connect) {
+		/* cf tcp_poll() note about TFO */
+		mask |= EPOLLOUT | EPOLLWRNORM;
 	}
 	if (sk->sk_shutdown == SHUTDOWN_MASK || state == TCP_CLOSE)
 		mask |= EPOLLHUP;
-- 
2.25.1


-- 


Disclaimer: https://www.tessares.net/mail-disclaimer/ 
<https://www.tessares.net/mail-disclaimer/>



^ permalink raw reply related	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-09-23 15:21 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-21 15:25 [PATCH mptcp-next v1 0/5] mptcp: add support for TFO, sender side only Benjamin Hesmans
2022-09-21 15:25 ` [PATCH mptcp-next v1 1/5] mptcp: add TCP_FASTOPEN_CONNECT socket option Benjamin Hesmans
2022-09-21 15:25 ` [PATCH mptcp-next v1 2/5] tcp: export tcp_sendmsg_fastopen Benjamin Hesmans
2022-09-21 15:25 ` [PATCH mptcp-next v1 3/5] mptcp: handle defer connect in mptcp_sendmsg Benjamin Hesmans
2022-09-21 17:41   ` Paolo Abeni
2022-09-21 15:25 ` [PATCH mptcp-next v1 4/5] mptcp: add MSG_FASTOPEN support Benjamin Hesmans
2022-09-21 15:25 ` [PATCH mptcp-next v1 5/5] mptcp: poll allow write call before actual connect Benjamin Hesmans
2022-09-21 16:52   ` mptcp: poll allow write call before actual connect: Tests Results MPTCP CI
2022-09-21 17:43   ` [PATCH mptcp-next v1 5/5] mptcp: poll allow write call before actual connect Paolo Abeni
2022-09-22 13:56 [PATCH mptcp-next v2 4/4] " Benjamin Hesmans
2022-09-22 14:42 ` mptcp: poll allow write call before actual connect: Tests Results MPTCP CI
2022-09-22 16:05 ` MPTCP CI
2022-09-23 12:19 [PATCH mptcp-next v3 4/4] mptcp: poll allow write call before actual connect Benjamin Hesmans
2022-09-23 15:21 ` mptcp: poll allow write call before actual connect: Tests Results MPTCP CI

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).