mptcp.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Benjamin Hesmans <benjamin.hesmans@tessares.net>
To: mptcp@lists.linux.dev
Cc: Benjamin Hesmans <benjamin.hesmans@tessares.net>
Subject: [PATCH RFC mptcp-next 04/10] mptcp: poll allow write call before actual connect
Date: Thu,  8 Sep 2022 15:38:23 +0200	[thread overview]
Message-ID: <20220908133829.3410092-5-benjamin.hesmans@tessares.net> (raw)
In-Reply-To: <20220908133829.3410092-1-benjamin.hesmans@tessares.net>

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>
---
 net/mptcp/protocol.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c
index ad81824bdbfe..c249ce632c5f 100644
--- a/net/mptcp/protocol.c
+++ b/net/mptcp/protocol.c
@@ -3676,10 +3676,12 @@ static __poll_t mptcp_poll(struct file *file, struct socket *sock,
 {
 	struct sock *sk = sock->sk;
 	struct mptcp_sock *msk;
+	struct socket *ssock;
 	__poll_t mask = 0;
 	int state;
 
 	msk = mptcp_sk(sk);
+	ssock = __mptcp_nmpc_socket(msk);
 	sock_poll_wait(file, sock, wait);
 
 	state = inet_sk_state_load(sk);
@@ -3694,6 +3696,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 (ssock && state == TCP_SYN_SENT && inet_sk(ssock->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/>



  parent reply	other threads:[~2022-09-08 13:38 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-09-08 13:38 [PATCH RFC mptcp-next 00/10] Implement TCP_FASTOPEN_CONNECT for mptcp Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 01/10] mptcp: add TCP_FASTOPEN_CONNECT socket option Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 02/10] tcp: export tcp_sendmsg_fastopen Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 03/10] mptcp: handle defer connect in mptcp_sendmsg Benjamin Hesmans
2022-09-08 13:38 ` Benjamin Hesmans [this message]
2022-09-08 13:38 ` [PATCH RFC mptcp-next 05/10] mptcp: delay mptcp data_ack calculation Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 06/10] mptcp: allow delayed " Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 07/10] mptcp: TFO receive: bypass mapping check Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 08/10] mptcp: allow data that can not be DATA_ACKed Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 09/10] mptcp: force data_ready Benjamin Hesmans
2022-09-08 13:38 ` [PATCH RFC mptcp-next 10/10] mptcp: test TFO Benjamin Hesmans
2022-09-08 14:10   ` mptcp: test TFO: Build Failure MPTCP CI
2022-09-08 15:40   ` mptcp: test TFO: Tests Results MPTCP CI

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220908133829.3410092-5-benjamin.hesmans@tessares.net \
    --to=benjamin.hesmans@tessares.net \
    --cc=mptcp@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).