From patchwork Thu Mar 13 14:45:50 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Harris X-Patchwork-Id: 14015221 X-Patchwork-Delegate: kuba@kernel.org Received: from mx.wizmail.org (mx.wizmail.org [85.158.153.28]) (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 19B3C42AA6 for ; Thu, 13 Mar 2025 14:46:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.158.153.28 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741877202; cv=none; b=UL66lcssEC6+IffVxINVZ4Rf5C914EGwt+cCha0buVut+tHB7j1vg38cyi/vUfIsc01tVh4nY8lGhSMzJddbyXrHPuWtuy4qziPWVYlaNpNZHDy7NsykBixcE+YmJCq/Ho2ktbU6xO4OnJPSQDJUWxTNQBKtwmcD8M2XPYTlxVQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741877202; c=relaxed/simple; bh=Fsc+vMz8I3RqN5mlBV6YHe57SmdMQaJpXVW3XHPoT0k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WqsSRBEdV4x9LCgKyac3JTurH+WBD82o9tsw7zvrUO67ExHhkYq+ZF5G0Ha0FxsaxsNhXAhDjBID3lwoGJskM4PnWpaKbstqdIrdnfhUmRYo+qzVbn40EsASf6p9SO1O/qTdi+aWWGVaIdynsrBzYkFQyEOBWjiRA8V5jbU3V1I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exim.org; spf=fail smtp.mailfrom=exim.org; dkim=permerror (0-bit key) header.d=wizmail.org header.i=@wizmail.org header.b=RGpANJYa; dkim=pass (2048-bit key) header.d=wizmail.org header.i=@wizmail.org header.b=gYEBeokD; arc=none smtp.client-ip=85.158.153.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exim.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=exim.org Authentication-Results: smtp.subspace.kernel.org; dkim=permerror (0-bit key) header.d=wizmail.org header.i=@wizmail.org header.b="RGpANJYa"; dkim=pass (2048-bit key) header.d=wizmail.org header.i=@wizmail.org header.b="gYEBeokD" DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org; s=e202001; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive: Autocrypt; bh=F23AVpItGdOUEfO2vSwM2bznFZqro9XqN8NxL85gzL8=; b=RGpANJYaGtpLyC8 qpErP2nqmkCIEQyjkdcV+CJ1N7iAxUeLkBaHz3NKyeziN4Pw6ucp4d31oiaQRO4TTDvQOBQ==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org ; s=r202001; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive: Autocrypt; bh=F23AVpItGdOUEfO2vSwM2bznFZqro9XqN8NxL85gzL8=; b=gYEBeokDdIOKi6g 0e7ct++STf+KZLLQUeeR9cdGESiUFPCnDIKgCs8nbTTTmU6gly5buTq3iN6Ckf2anHJBfQzl2N8sl +vwfsLhaklC3OKG7T87yYFK7BzUdGozzLNzDlac1Fyt0HoC4GpYWVEaYCyBgGjhnpOtbbNc7vkXko rUCDH8RvfZ6xZzNa3WUuUfQI7M1GLYE/OuN1XEa1krLe9UqttNECezKU3tSCGBa53qfm7EQq8BBzg jHxNtYky9Yp0R5+2+d+bijHJV7H3UkAPimcNNridOAqD4+ZnAHJA1Bv2ct4shBvUc5gKlamxcZal+ yvBSnQ8BcbvhJJd0rcw==; Authentication-Results: wizmail.org; iprev=pass (hellmouth.gulag.org.uk) smtp.remote-ip=85.158.153.62; auth=pass (PLAIN) smtp.auth=jgh@wizmail.org Received: from hellmouth.gulag.org.uk ([85.158.153.62] helo=macbook.dom.ain) by wizmail.org (Exim 4.98.114) (TLS1.3) tls TLS_AES_256_GCM_SHA384 with esmtpsa id 1tsjpU-00000002LY6-1fTi (return-path ); Thu, 13 Mar 2025 14:46:36 +0000 From: Jeremy Harris To: netdev@vger.kernel.org Cc: Jeremy Harris Subject: [RFC PATCH net-next 1/2] TCP: note received valid-cookie Fast Open option Date: Thu, 13 Mar 2025 14:45:50 +0000 Message-ID: <93b4b95893b9cdd1afc06f22db7f9389a9c906e5.1741877016.git.jgh@exim.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pcms-Received-Sender: hellmouth.gulag.org.uk ([85.158.153.62] helo=macbook.dom.ain) with esmtpsa X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Signed-off-by: Jeremy Harris --- include/linux/tcp.h | 3 ++- net/ipv4/tcp_fastopen.c | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 159b2c59e..c32c8ba59 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h @@ -382,7 +382,8 @@ struct tcp_sock { syn_fastopen:1, /* SYN includes Fast Open option */ syn_fastopen_exp:1,/* SYN includes Fast Open exp. option */ syn_fastopen_ch:1, /* Active TFO re-enabling probe */ - syn_data_acked:1;/* data in SYN is acked by SYN-ACK */ + syn_data_acked:1,/* data in SYN is acked by SYN-ACK */ + syn_fastopen_in:1; /* Received SYN includes Fast Open option */ u8 keepalive_probes; /* num of allowed keep alive probes */ u32 tcp_tx_delay; /* delay (in usec) added to TX packets */ diff --git a/net/ipv4/tcp_fastopen.c b/net/ipv4/tcp_fastopen.c index 1a6b1bc54..004d0024c 100644 --- a/net/ipv4/tcp_fastopen.c +++ b/net/ipv4/tcp_fastopen.c @@ -401,6 +401,7 @@ struct sock *tcp_try_fastopen(struct sock *sk, struct sk_buff *skb, } NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPFASTOPENPASSIVE); + tcp_sk(child)->syn_fastopen_in = 1; return child; } NET_INC_STATS(sock_net(sk), From patchwork Thu Mar 13 14:45:51 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeremy Harris X-Patchwork-Id: 14015219 X-Patchwork-Delegate: kuba@kernel.org Received: from smtp.wizmail.org (smtp.wizmail.org [85.158.153.28]) (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 4C50623BD13 for ; Thu, 13 Mar 2025 14:46:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=85.158.153.28 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741877200; cv=none; b=FOjTOQueIRJNufWSFp3m3KNjYEkCRwD2NZNjxv4Ns1LAUIxfOXNrUySI5Y0qTyykm/71n0yCGl5JpwR6u7tymQ27IE7etGLXXKH0wKDAw5MoYDfG1YdX4gyiTOolz4c6kQF5JlH4MM96EGuYsYIUVNeNN/cqGmB0Wf3DvPdjmEY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741877200; c=relaxed/simple; bh=I1IeQ3eOXuWo1Koz+4tC5CMTNtvDWBowb/FldwOpw5Q=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=qEyh2SZSNybN+adJm5DyPruTM3LwuIi0tqu9EQ7m4fzZ7mPKdtiR7Qo9XurlkN3SB5f3jLgeRkuYvwdF2Xl9LbdaExlf7eWHJouIAFTOzuL3NTneAtkwd1EYxcGLBaNFkfm4KBsYSLlCggX5K/6lJuSbwSFYGL6QFfYa0VJ0yVE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exim.org; spf=fail smtp.mailfrom=exim.org; dkim=permerror (0-bit key) header.d=wizmail.org header.i=@wizmail.org header.b=BM1Mm/Y3; dkim=pass (2048-bit key) header.d=wizmail.org header.i=@wizmail.org header.b=IUP/1JAD; arc=none smtp.client-ip=85.158.153.28 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=exim.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=exim.org Authentication-Results: smtp.subspace.kernel.org; dkim=permerror (0-bit key) header.d=wizmail.org header.i=@wizmail.org header.b="BM1Mm/Y3"; dkim=pass (2048-bit key) header.d=wizmail.org header.i=@wizmail.org header.b="IUP/1JAD" DKIM-Signature: v=1; a=ed25519-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org; s=e202001; h=Content-Transfer-Encoding:MIME-Version:References :In-Reply-To:Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive: Autocrypt; bh=tPvGIJIyPV9aObwYTmTs464VPbIIZSjvl5woqjoKk4w=; b=BM1Mm/Y3lpDG2un 313hi3KkxH0BYFEaXXQp53laVSc0vJ7mS7eP2W+MIWQriX+JfJiq0UE9UeU52xlf1hFWGBw==; DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=wizmail.org ; s=r202001; h=Content-Transfer-Encoding:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:From:Sender:Reply-To:Subject:Date: Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive: Autocrypt; bh=tPvGIJIyPV9aObwYTmTs464VPbIIZSjvl5woqjoKk4w=; b=IUP/1JADWrul2sI RCIuxdYlJv3zfS7Qi/XG7FdSMkm9TDtXVIDNbPO7L+V23N4GDYc0VJZHEQ1O771rcoKsvctqJ+5ak nXtRzo/WGIDTlswsXn8Ic1+vUMYECD7h/wXMvsHXYoT4dWXNO8vy1GRVSkMAlrNZC2t7zE+Weu6aY uAPEt0jbUTgf0DyMucanMD6PubRDesu7C8Xn19IGmhsJuirb2mCGAk25QLsO07tn8XWHETYZkci7z CwGpHPWouEXA4n6jYMIn6mpEmiyxPpiL1lU2KZnsglPR2gnw4rx9l86QSquBitvBnTGbUmQ+jLAEJ HDRXYGUTDI9yD99Bnbg==; Authentication-Results: wizmail.org; iprev=pass (hellmouth.gulag.org.uk) smtp.remote-ip=85.158.153.62; auth=pass (PLAIN) smtp.auth=jgh@wizmail.org Received: from hellmouth.gulag.org.uk ([85.158.153.62] helo=macbook.dom.ain) by www.wizmail.org (Exim 4.98.114) (TLS1.3) tls TLS_AES_256_GCM_SHA384 with esmtpsa id 1tsjpU-00000002LY6-2HXc (return-path ); Thu, 13 Mar 2025 14:46:36 +0000 From: Jeremy Harris To: netdev@vger.kernel.org Cc: Jeremy Harris Subject: [RFC PATCH net-next 2/2] TCP: pass accepted-TFO indication through getsockopt Date: Thu, 13 Mar 2025 14:45:51 +0000 Message-ID: <3e9b638ad6846aff954a590dd87f764684a4ec8f.1741877016.git.jgh@exim.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: References: Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Pcms-Received-Sender: hellmouth.gulag.org.uk ([85.158.153.62] helo=macbook.dom.ain) with esmtpsa X-Patchwork-Delegate: kuba@kernel.org X-Patchwork-State: RFC Signed-off-by: Jeremy Harris --- include/uapi/linux/tcp.h | 1 + net/ipv4/tcp.c | 2 ++ 2 files changed, 3 insertions(+) diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index 32a27b4a5..e958a145d 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h @@ -179,6 +179,7 @@ enum tcp_fastopen_client_fail { #define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */ #define TCPI_OPT_SYN_DATA 32 /* SYN-ACK acked data in SYN sent or rcvd */ #define TCPI_OPT_USEC_TS 64 /* usec timestamps */ +#define TCPI_OPT_TFO_SEEN 128 /* we accepted a Fast Open option on SYN */ /* * Sender's congestion state indicating normal or abnormal situations diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 46951e749..407bdfb12 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4146,6 +4146,8 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) info->tcpi_options |= TCPI_OPT_SYN_DATA; if (tp->tcp_usec_ts) info->tcpi_options |= TCPI_OPT_USEC_TS; + if (tp->syn_fastopen_in) + info->tcpi_options |= TCPI_OPT_TFO_SEEN; info->tcpi_rto = jiffies_to_usecs(icsk->icsk_rto); info->tcpi_ato = jiffies_to_usecs(min_t(u32, icsk->icsk_ack.ato,