* [patch v2] send.2: Add MSG_FASTOPEN flag
@ 2021-09-17 4:16 Wei Wang
2021-09-20 19:24 ` Alejandro Colomar (man-pages)
0 siblings, 1 reply; 2+ messages in thread
From: Wei Wang @ 2021-09-17 4:16 UTC (permalink / raw)
To: linux-man, Alejandro Colomar, Michael Kerrisk
Cc: netdev, Yuchung Cheng, Eric Dumazet
MSG_FASTOPEN flag is available since Linux 3.7. Add detailed description
in the manpage according to RFC7413.
Signed-off-by: Wei Wang <weiwan@google.com>
Reviewed-by: Yuchung Cheng <ycheng@google.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
---
Change in v2: corrected some format issues
man2/send.2 | 32 ++++++++++++++++++++++++++++++++
1 file changed, 32 insertions(+)
diff --git a/man2/send.2 b/man2/send.2
index fd28fed90..acaa05be9 100644
--- a/man2/send.2
+++ b/man2/send.2
@@ -252,6 +252,38 @@ data on sockets that support this notion (e.g., of type
the underlying protocol must also support
.I out-of-band
data.
+.TP
+.BR MSG_FASTOPEN " (since Linux 3.7)"
+Attempts TCP Fast Open (RFC7413) and sends data in the SYN like a
+combination of
+.BR connect (2)
+and
+.BR write (2),
+by performing an implicit
+.BR connect (2)
+operation.
+It blocks until the data is buffered and the handshake has completed.
+For a non-blocking socket,
+it returns the number of bytes buffered and sent in the SYN packet.
+If the cookie is not available locally,
+it returns
+.BR EINPROGRESS ,
+and sends a SYN with a Fast Open cookie request automatically.
+The caller needs to write the data again when the socket is connected.
+On errors,
+it sets the same
+.I errno
+as
+.BR connect (2)
+if the handshake fails.
+This flag requires enabling TCP Fast Open client support on sysctl
+.IR net.ipv4.tcp_fastopen .
+.IP
+Refer to
+.B TCP_FASTOPEN_CONNECT
+socket option in
+.BR tcp (7)
+for an alternative approach.
.SS sendmsg()
The definition of the
.I msghdr
--
2.33.0.464.g1972c5931b-goog
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [patch v2] send.2: Add MSG_FASTOPEN flag
2021-09-17 4:16 [patch v2] send.2: Add MSG_FASTOPEN flag Wei Wang
@ 2021-09-20 19:24 ` Alejandro Colomar (man-pages)
0 siblings, 0 replies; 2+ messages in thread
From: Alejandro Colomar (man-pages) @ 2021-09-20 19:24 UTC (permalink / raw)
To: Wei Wang, linux-man, Michael Kerrisk; +Cc: netdev, Yuchung Cheng, Eric Dumazet
Hi Wei,
On 9/17/21 6:16 AM, Wei Wang wrote:
> MSG_FASTOPEN flag is available since Linux 3.7. Add detailed description
> in the manpage according to RFC7413.
>
> Signed-off-by: Wei Wang <weiwan@google.com>
> Reviewed-by: Yuchung Cheng <ycheng@google.com>
> Reviewed-by: Eric Dumazet <edumazet@google.com>
Patch applied!
Thanks (and to the reviewers too!),
Alex
> ---
> Change in v2: corrected some format issues
>
> man2/send.2 | 32 ++++++++++++++++++++++++++++++++
> 1 file changed, 32 insertions(+)
>
> diff --git a/man2/send.2 b/man2/send.2
> index fd28fed90..acaa05be9 100644
> --- a/man2/send.2
> +++ b/man2/send.2
> @@ -252,6 +252,38 @@ data on sockets that support this notion (e.g., of type
> the underlying protocol must also support
> .I out-of-band
> data.
> +.TP
> +.BR MSG_FASTOPEN " (since Linux 3.7)"
> +Attempts TCP Fast Open (RFC7413) and sends data in the SYN like a
> +combination of
> +.BR connect (2)
> +and
> +.BR write (2),
> +by performing an implicit
> +.BR connect (2)
> +operation.
> +It blocks until the data is buffered and the handshake has completed.
> +For a non-blocking socket,
> +it returns the number of bytes buffered and sent in the SYN packet.
> +If the cookie is not available locally,
> +it returns
> +.BR EINPROGRESS ,
> +and sends a SYN with a Fast Open cookie request automatically.
> +The caller needs to write the data again when the socket is connected.
> +On errors,
> +it sets the same
> +.I errno
> +as
> +.BR connect (2)
> +if the handshake fails.
> +This flag requires enabling TCP Fast Open client support on sysctl
> +.IR net.ipv4.tcp_fastopen .
> +.IP
> +Refer to
> +.B TCP_FASTOPEN_CONNECT
> +socket option in
> +.BR tcp (7)
> +for an alternative approach.
> .SS sendmsg()
> The definition of the
> .I msghdr
>
--
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-09-21 2:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-17 4:16 [patch v2] send.2: Add MSG_FASTOPEN flag Wei Wang
2021-09-20 19:24 ` Alejandro Colomar (man-pages)
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.