diff --git a/changelogs/current.yaml b/changelogs/current.yaml index 3ff9eeab0609..5cd07284ac32 100644 --- a/changelogs/current.yaml +++ b/changelogs/current.yaml @@ -47,6 +47,12 @@ minor_behavior_changes: change: | Enable obsolete line folding in BalsaParser (for behavior parity with http-parser, the previously used HTTP/1 parser). +- area: http3 + change: | + Use GRO (Generic Receive Offload) for reading packets from a UDP socket. See + https://www.kernel.org/doc/html/next/networking/segmentation-offloads.html for a description of + GRO. This behavior change can be reverted by setting + ``envoy.reloadable_features.prefer_udp_gro`` to ``false``. bug_fixes: # *Changes expected to improve the state of the world and are unlikely to have negative effects* diff --git a/source/common/quic/envoy_quic_client_connection.cc b/source/common/quic/envoy_quic_client_connection.cc index 9890990091ca..524e87cda27c 100644 --- a/source/common/quic/envoy_quic_client_connection.cc +++ b/source/common/quic/envoy_quic_client_connection.cc @@ -7,6 +7,7 @@ #include "source/common/network/socket_option_factory.h" #include "source/common/network/udp_packet_writer_handler_impl.h" #include "source/common/quic/envoy_quic_utils.h" +#include "source/common/runtime/runtime_features.h" namespace Envoy { namespace Quic { @@ -229,7 +230,9 @@ void EnvoyQuicClientConnection::onFileEvent(uint32_t events, if (connected() && (events & Event::FileReadyType::Read)) { Api::IoErrorPtr err = Network::Utility::readPacketsFromSocket( connection_socket.ioHandle(), *connection_socket.connectionInfoProvider().localAddress(), - *this, dispatcher_.timeSource(), /*prefer_gro=*/false, packets_dropped_); + *this, dispatcher_.timeSource(), + Runtime::runtimeFeatureEnabled("envoy.reloadable_features.prefer_udp_gro"), + packets_dropped_); if (err == nullptr) { // In the case where the path validation fails, the probing socket will be closed and its IO // events are no longer interesting. diff --git a/source/common/runtime/runtime_features.cc b/source/common/runtime/runtime_features.cc index 8ea3e31f731b..31beaa9a188c 100644 --- a/source/common/runtime/runtime_features.cc +++ b/source/common/runtime/runtime_features.cc @@ -75,6 +75,7 @@ RUNTIME_GUARD(envoy_reloadable_features_oauth_make_token_cookie_httponly); RUNTIME_GUARD(envoy_reloadable_features_oauth_use_standard_max_age_value); RUNTIME_GUARD(envoy_reloadable_features_oauth_use_url_encoding); RUNTIME_GUARD(envoy_reloadable_features_original_dst_rely_on_idle_timeout); +RUNTIME_GUARD(envoy_reloadable_features_prefer_udp_gro); RUNTIME_GUARD(envoy_reloadable_features_proxy_status_upstream_request_timeout); RUNTIME_GUARD(envoy_reloadable_features_quic_fix_filter_manager_uaf); // Ignore the automated "remove this flag" issue: we should keep this for 1 year. Confirm with