openssl/include/internal
Maxim Mikityanskiy cd715b7e7f Add support for KTLS zerocopy sendfile on Linux
TLS device offload allows to perform zerocopy sendfile transmissions.
FreeBSD provides this feature by default, and Linux 5.19 introduced it
as an opt-in. Zerocopy improves the TX rate significantly, but has a
side effect: if the underlying file is changed while being transmitted,
and a TCP retransmission happens, the receiver may get a TLS record
containing both new and old data, which leads to an authentication
failure and termination of connection. This effect is the reason Linux
makes a copy on sendfile by default.

This commit adds support for TLS zerocopy sendfile on Linux disabled by
default to avoid any unlikely backward compatibility issues on Linux,
although sacrificing consistency in OpenSSL's behavior on Linux and
FreeBSD. A new option called KTLSTxZerocopySendfile is added to enable
the new zerocopy behavior on Linux. This option should be used when the
the application guarantees that the file is not modified during
transmission, or it doesn't care about breaking the connection.

The related documentation is also added in this commit. The unit test
added doesn't test the actual functionality (it would require specific
hardware and a non-local peer), but solely checks that it's possible to
set the new option flag.

Signed-off-by: Maxim Mikityanskiy <maximmi@nvidia.com>
Reviewed-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Boris Pismenny <borisp@nvidia.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Todd Short <todd.short@me.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/18650)
2022-11-24 13:19:37 +01:00
..
__DECC_INCLUDE_EPILOGUE.H
__DECC_INCLUDE_PROLOGUE.H
asn1.h internal/asn1.h: Add missing '#include <openssl/bio.h>' 2022-09-30 22:25:45 +02:00
bio_addr.h QUIC Demuxer and Record Layer (RX Side) 2022-09-02 10:03:55 +02:00
bio_tfo.h
bio.h Add support for KTLS zerocopy sendfile on Linux 2022-11-24 13:19:37 +01:00
common.h Add support for loading root CAs from Windows crypto API 2022-09-14 14:10:18 +01:00
comp.h Add ZSTD compression support (RFC8478bis) 2022-10-18 09:30:21 -04:00
conf.h
constant_time.h
core.h
cryptlib.h crypto: add preemptive threading support 2022-10-17 09:45:39 +01:00
dane.h
deprecated.h
der.h
dso.h
dsoerr.h
e_os.h Cleanup : directly include of internal/nelem.h when required. 2022-11-23 18:08:25 +01:00
endian.h
err.h
event_queue.h
ffc.h
ktls.h Add support for KTLS zerocopy sendfile on Linux 2022-11-24 13:19:37 +01:00
list.h list: add debug sanity checks 2022-11-16 18:02:02 +11:00
namemap.h
nelem.h
numbers.h
o_dir.h
packet.h QUIC Frame Encoding and Decoding Functions 2022-07-29 16:28:37 +10:00
param_build_set.h
passphrase.h
priority_queue.h
property.h
propertyerr.h
provider.h
quic_ackm.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_cc.h Fix 32-bit Windows issues related to QUIC_ACKM / QUIC_CC 2022-10-25 13:25:00 +02:00
quic_cfq.h QUIC CFQ Fixes 2022-11-07 18:18:34 +00:00
quic_demux.h QUIC: use list.h 2022-11-16 18:02:02 +11:00
quic_error.h QUIC Flow Control 2022-09-26 08:01:55 +01:00
quic_fc.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_fifd.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_record_rx_wrap.h QUIC Receive Stream Management 2022-11-14 08:01:57 +00:00
quic_record_rx.h Add deferred datagram limit to QUIC Record Layer RX 2022-09-22 10:01:35 +01:00
quic_record_tx.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_record_util.h QUIC Record Layer (Refactor and TX Side) 2022-09-02 10:03:55 +02:00
quic_rx_depack.h Implement the RX Depacketizer 2022-09-23 17:55:03 +02:00
quic_sf_list.h Plug the QUIC_RSTREAM to the RX depacketizer 2022-11-14 08:01:57 +00:00
quic_ssl.h Plug the QUIC_RSTREAM to the RX depacketizer 2022-11-14 08:01:57 +00:00
quic_statm.h QUIC ACK Manager, Statistics Manager and Congestion Control API 2022-08-24 14:05:46 +01:00
quic_stream_map.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_stream.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_txp.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_txpim.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_types.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_vlint.h
quic_wire_pkt.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
quic_wire.h QUIC TX Packetiser and Streams Mapper 2022-11-24 08:15:20 +00:00
refcount.h
safe_math.h Avoid divide by 0 exception 2022-10-02 20:41:34 +11:00
sha3.h
sizes.h
sm3.h
sockets.h Fix definitions of SHUT_RD and SHUT_WR 2022-10-25 13:25:00 +02:00
sslconf.h
symhacks.h
thread_arch.h crypto: thread: remove ossl_crypto_thread_native_terminate 2022-10-21 19:57:16 +02:00
thread_once.h
thread.h crypto: add preemptive threading support 2022-10-17 09:45:39 +01:00
time.h djgpp: Skip check for negative timeval 2022-11-14 07:47:53 +00:00
tlsgroups.h
tsan_assist.h
uint_set.h uint_set: convert uint_set to use the list data type 2022-11-16 18:02:02 +11:00
unicode.h