udp: add explicit config for GRO (#15545)

GRO is now configurable and defaults to disabled for server sockets and
enabled for client sockets.

Fixes https://github.com/envoyproxy/envoy/issues/15418

Signed-off-by: Matt Klein <mklein@lyft.com>

Mirrored from https://github.com/envoyproxy/envoy @ fb9dd7cc3479e244414bf4702bdbca0fdee7840c
pull/624/head
data-plane-api(Azure Pipelines) 4 years ago
parent 9fb2257edb
commit 1a6b0ccc5c
  1. 7
      envoy/config/core/v3/udp_socket_config.proto
  2. 7
      envoy/config/core/v4alpha/udp_socket_config.proto
  3. 5
      envoy/config/listener/v3/udp_listener_config.proto
  4. 5
      envoy/config/listener/v4alpha/udp_listener_config.proto
  5. 4
      envoy/extensions/filters/udp/udp_proxy/v3/udp_proxy.proto

@ -21,4 +21,11 @@ message UdpSocketConfig {
// defaults to 1500 bytes.
google.protobuf.UInt64Value max_rx_datagram_size = 1
[(validate.rules).uint64 = {lt: 65536 gt: 0}];
// Configures whether Generic Receive Offload (GRO)
// <https://en.wikipedia.org/wiki/Large_receive_offload>_ is preferred when reading from the
// UDP socket. The default is context dependent and is documented where UdpSocketConfig is used.
// This option affects performance but not functionality. If GRO is not supported by the operating
// system, non-GRO receive will be used.
google.protobuf.BoolValue prefer_gro = 2;
}

@ -25,4 +25,11 @@ message UdpSocketConfig {
// defaults to 1500 bytes.
google.protobuf.UInt64Value max_rx_datagram_size = 1
[(validate.rules).uint64 = {lt: 65536 gt: 0}];
// Configures whether Generic Receive Offload (GRO)
// <https://en.wikipedia.org/wiki/Large_receive_offload>_ is preferred when reading from the
// UDP socket. The default is context dependent and is documented where UdpSocketConfig is used.
// This option affects performance but not functionality. If GRO is not supported by the operating
// system, non-GRO receive will be used.
google.protobuf.BoolValue prefer_gro = 2;
}

@ -36,7 +36,10 @@ message UdpListenerConfig {
// [#comment:TODO(#12829): Remove this as an extension point.]
core.v3.TypedExtensionConfig listener_config = 4;
// UDP socket configuration for the listener.
// UDP socket configuration for the listener. The default for
// :ref:`prefer_gro <envoy_v3_api_field_config.core.v3.UdpSocketConfig.prefer_gro>` is false for
// listener sockets. If receiving a large amount of datagrams from a small number of sources, it
// may be worthwhile to enable this option after performance testing.
core.v3.UdpSocketConfig downstream_socket_config = 5;
// If the protocol in the listener socket address in :ref:`protocol

@ -36,7 +36,10 @@ message UdpListenerConfig {
// [#comment:TODO(#12829): Remove this as an extension point.]
core.v4alpha.TypedExtensionConfig listener_config = 4;
// UDP socket configuration for the listener.
// UDP socket configuration for the listener. The default for
// :ref:`prefer_gro <envoy_v3_api_field_config.core.v3.UdpSocketConfig.prefer_gro>` is false for
// listener sockets. If receiving a large amount of datagrams from a small number of sources, it
// may be worthwhile to enable this option after performance testing.
core.v4alpha.UdpSocketConfig downstream_socket_config = 5;
// If the protocol in the listener socket address in :ref:`protocol

@ -72,6 +72,8 @@ message UdpProxyConfig {
// limited to 1.
repeated HashPolicy hash_policies = 5 [(validate.rules).repeated = {max_items: 1}];
// UDP socket configuration for upstream sockets.
// UDP socket configuration for upstream sockets. The default for
// :ref:`prefer_gro <envoy_v3_api_field_config.core.v3.UdpSocketConfig.prefer_gro>` is true for upstream
// sockets as the assumption is datagrams will be received from a single source.
config.core.v3.UdpSocketConfig upstream_socket_config = 6;
}

Loading…
Cancel
Save