Skip to contentSkip to conversation

docs: tls: document the TLS_TX_ZEROCOPY_RO

PATCH Applied Jakub Kicinski 3 participants 3 messages Jun 10, 2022 – Jun 14, 2022

Subsystems (4)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH 1/1 docs: tls: document the TLS_TX_ZEROCOPY_RO

Add missing documentation for the TLS_TX_ZEROCOPY_RO opt-in.

---
CC: [email protected]
CC: [email protected]

---
 Documentation/networking/tls.rst | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)
Documentation/networking/tls.rst +25 -0
index 8cb2cd4e2a80..be8e10c14b05 100644
@@ -214,6 +214,31 @@ of calling send directly after a handshake using gnutls.
 Since it doesn't implement a full record layer, control
 messages are not supported.
 
+Optional optimizations
+----------------------
+
+There are certain condition-specific optimizations the TLS ULP can make,
+if requested. Those optimizations are either not universally beneficial
+or may impact correctness, hence they require an opt-in.
+All options are set per-socket using setsockopt(), and their
+state can be checked using getsockopt() and via socket diag (``ss``).
+
+TLS_TX_ZEROCOPY_RO
+~~~~~~~~~~~~~~~~~~
+
+For device offload only. Allow sendfile() data to be transmitted directly
+to the NIC without making an in-kernel copy. This allows true zero-copy
+behavior when device offload is enabled.
+
+The application must make sure that the data is not modified between being
+submitted and transmission completing. In other words this is mostly
+applicable if the data sent on a socket via sendfile() is read-only.
+
+Modifying the data may result in different versions of the data being used
+for the original TCP transmission and TCP retransmissions. To the receiver
+this will look like TLS records had been tampered with and will result
+in record authentication failures.
+
 Statistics
 ==========
 
Signature · 1 line
2.36.1
Acked-by on v1 1/1
#1 lore raw
Quoted 36 lines · Jakub Kicinski

Add missing documentation for the TLS_TX_ZEROCOPY_RO opt-in.

---
CC: [email protected]
CC: [email protected]

---
  Documentation/networking/tls.rst | 25 +++++++++++++++++++++++++
  1 file changed, 25 insertions(+)
Documentation/networking/tls.rst +18 -0
index 8cb2cd4e2a80..be8e10c14b05 100644
@@ -214,6 +214,31 @@ of calling send directly after a handshake using gnutls.
  Since it doesn't implement a full record layer, control
  messages are not supported.
 
+Optional optimizations
+----------------------
+
+There are certain condition-specific optimizations the TLS ULP can make,
+if requested. Those optimizations are either not universally beneficial
+or may impact correctness, hence they require an opt-in.
+All options are set per-socket using setsockopt(), and their
+state can be checked using getsockopt() and via socket diag (``ss``).
+
+TLS_TX_ZEROCOPY_RO
+~~~~~~~~~~~~~~~~~~
+
+For device offload only. Allow sendfile() data to be transmitted directly
+to the NIC without making an in-kernel copy. This allows true zero-copy
+behavior when device offload is enabled.
+
+The application must make sure that the data is not modified between being
+submitted and transmission completing. In other words this is mostly

Documentation/networking/tls.rst of calling send directly after a handshake using gnutls. · line 244

Quoted 10 lines
Documentation/networking/tls.rst +7 -0
+applicable if the data sent on a socket via sendfile() is read-only.
+
+Modifying the data may result in different versions of the data being used
+for the original TCP transmission and TCP retransmissions. To the receiver
+this will look like TLS records had been tampered with and will result
+in record authentication failures.
+
  Statistics
  ==========
 
#2 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Paolo Abeni <[email protected]>:

Quoted 8 lines · On Fri, 10 Jun 2022 11:02:12 -0700 you wrote:

Add missing documentation for the TLS_TX_ZEROCOPY_RO opt-in.

---
CC: [email protected]
CC: [email protected]

[...]

Here is the summary with links:
- [net] docs: tls: document the TLS_TX_ZEROCOPY_RO

    https://git.kernel.org/netdev/net-next/c/7e5e8ec7dbd8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html