From nobody Tue Feb 10 02:49:56 2026 Received: from mga12.intel.com (mga12.intel.com [192.55.52.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 896D24A1E for ; Mon, 26 Sep 2022 23:27:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1664234868; x=1695770868; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3eEN83FGptLBGWVNuc+N6UdQMdtD/faMYXdyfUdW2Ss=; b=eD0zSv4QiT2vaAHIS5CN4wWO2DO/AulY2rflgtuDbPPsHh+BHc9mXKVi 9PFDgM7RGUJt4QMJ/Viw80f5xjR74788JPvJIZdQXMS+2C+Hkmx0+zcJI l0RVpcMhNPh2sV5OAU7vzoA0knTD2w3k3/ki/+bqSL6+jYs3WrevAV57l /3JmpW7gCUkNtTboXS9kPbfVvShHXebPbTk2wZMFp1WkU6xet6Q8IJzBA SQSuWgB21RlhbiRiZZBjStFkZciobvzS4Nb2EkbXFr8NgEw57f+GLsjTC Og4Nef3f3Vx+jaSCMrX5pJ71urY6VmSmmlrUYSRbMJflXQ6MS1tm/CMLv Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="280890879" X-IronPort-AV: E=Sophos;i="5.93,347,1654585200"; d="scan'208";a="280890879" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by fmsmga106.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 16:27:44 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10482"; a="572424288" X-IronPort-AV: E=Sophos;i="5.93,347,1654585200"; d="scan'208";a="572424288" Received: from sankarka-mobl1.amr.corp.intel.com (HELO mjmartin-desk2.intel.com) ([10.209.3.132]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 26 Sep 2022 16:27:44 -0700 From: Mat Martineau To: netdev@vger.kernel.org Cc: Benjamin Hesmans , davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, edumazet@google.com, dmytro@shytyi.net, matthieu.baerts@tessares.net, mptcp@lists.linux.dev, Mat Martineau Subject: [PATCH net-next 4/4] mptcp: poll allow write call before actual connect Date: Mon, 26 Sep 2022 16:27:39 -0700 Message-Id: <20220926232739.76317-5-mathew.j.martineau@linux.intel.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20220926232739.76317-1-mathew.j.martineau@linux.intel.com> References: <20220926232739.76317-1-mathew.j.martineau@linux.intel.com> Precedence: bulk X-Mailing-List: mptcp@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: 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(). Acked-by: Paolo Abeni Reviewed-by: Matthieu Baerts Signed-off-by: Benjamin Hesmans Signed-off-by: Mat Martineau --- net/mptcp/protocol.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/net/mptcp/protocol.c b/net/mptcp/protocol.c index fc753896caa0..16c3a6fc347f 100644 --- a/net/mptcp/protocol.c +++ b/net/mptcp/protocol.c @@ -3548,6 +3548,7 @@ static int mptcp_stream_connect(struct socket *sock, = struct sockaddr *uaddr, =20 do_connect: err =3D ssock->ops->connect(ssock, uaddr, addr_len, flags); + inet_sk(sock->sk)->defer_connect =3D inet_sk(ssock->sk)->defer_connect; sock->state =3D ssock->state; =20 /* on successful connect, the msk state will be moved to established by @@ -3698,6 +3699,9 @@ static __poll_t mptcp_poll(struct file *file, struct = socket *sock, if (state !=3D TCP_SYN_SENT && state !=3D TCP_SYN_RECV) { mask |=3D mptcp_check_readable(msk); mask |=3D mptcp_check_writeable(msk); + } else if (state =3D=3D TCP_SYN_SENT && inet_sk(sk)->defer_connect) { + /* cf tcp_poll() note about TFO */ + mask |=3D EPOLLOUT | EPOLLWRNORM; } if (sk->sk_shutdown =3D=3D SHUTDOWN_MASK || state =3D=3D TCP_CLOSE) mask |=3D EPOLLHUP; --=20 2.37.3