From 69f82abf31a5ad5933cd4704414e9f39106d1144 Mon Sep 17 00:00:00 2001 From: "data-plane-api(Azure Pipelines)" Date: Tue, 24 May 2022 14:27:47 +0000 Subject: [PATCH] udp: Add a udp_packet_packet_writer_config option to UdpListenerConfig (#21241) udp: Add a udp_packet_packet_writer_config option to UdpListenerConfig. Fixes #21200 Risk Level: Low Testing: Existing and additional tests Docs Changes: None Release Notes: Added Platform Specific Features: N/A Signed-off-by: Ryan Hamilton Mirrored from https://github.com/envoyproxy/envoy @ 3a7b26aa3909488a8561a232b82845b8b4cd38bb --- BUILD | 1 + .../listener/v3/udp_listener_config.proto | 11 ++++++++++- envoy/extensions/udp_packet_writer/v3/BUILD | 9 +++++++++ .../v3/udp_default_writer_factory.proto | 19 +++++++++++++++++++ .../v3/udp_gso_batch_writer_factory.proto | 18 ++++++++++++++++++ versioning/BUILD | 1 + 6 files changed, 58 insertions(+), 1 deletion(-) create mode 100644 envoy/extensions/udp_packet_writer/v3/BUILD create mode 100644 envoy/extensions/udp_packet_writer/v3/udp_default_writer_factory.proto create mode 100644 envoy/extensions/udp_packet_writer/v3/udp_gso_batch_writer_factory.proto diff --git a/BUILD b/BUILD index a37b3a90..57a773dd 100644 --- a/BUILD +++ b/BUILD @@ -258,6 +258,7 @@ proto_library( "//envoy/extensions/transport_sockets/tap/v3:pkg", "//envoy/extensions/transport_sockets/tcp_stats/v3:pkg", "//envoy/extensions/transport_sockets/tls/v3:pkg", + "//envoy/extensions/udp_packet_writer/v3:pkg", "//envoy/extensions/upstreams/http/generic/v3:pkg", "//envoy/extensions/upstreams/http/http/v3:pkg", "//envoy/extensions/upstreams/http/tcp/v3:pkg", diff --git a/envoy/config/listener/v3/udp_listener_config.proto b/envoy/config/listener/v3/udp_listener_config.proto index f3f03d23..4e619b1f 100644 --- a/envoy/config/listener/v3/udp_listener_config.proto +++ b/envoy/config/listener/v3/udp_listener_config.proto @@ -2,6 +2,7 @@ syntax = "proto3"; package envoy.config.listener.v3; +import "envoy/config/core/v3/extension.proto"; import "envoy/config/core/v3/udp_socket_config.proto"; import "envoy/config/listener/v3/quic_config.proto"; @@ -17,7 +18,7 @@ option (udpa.annotations.file_status).package_version_status = ACTIVE; // [#protodoc-title: UDP listener config] // Listener :ref:`configuration overview ` -// [#next-free-field: 8] +// [#next-free-field: 9] message UdpListenerConfig { option (udpa.annotations.versioning).previous_message_type = "envoy.api.v2.listener.UdpListenerConfig"; @@ -35,6 +36,14 @@ message UdpListenerConfig { // Configuration for QUIC protocol. If empty, QUIC will not be enabled on this listener. Set // to the default object to enable QUIC without modifying any additional options. QuicProtocolOptions quic_options = 7; + + // Configuration for the UDP packet writer. If empty, HTTP/3 will use GSO if available + // (:ref:`UdpDefaultWriterFactory `) + // or the default kernel sendmsg if not, + // (:ref:`UdpDefaultWriterFactory `) + // and raw UDP will use kernel sendmsg. + // [#extension-category: envoy.udp_packet_writer] + core.v3.TypedExtensionConfig udp_packet_packet_writer_config = 8; } message ActiveRawUdpListenerConfig { diff --git a/envoy/extensions/udp_packet_writer/v3/BUILD b/envoy/extensions/udp_packet_writer/v3/BUILD new file mode 100644 index 00000000..ee92fb65 --- /dev/null +++ b/envoy/extensions/udp_packet_writer/v3/BUILD @@ -0,0 +1,9 @@ +# DO NOT EDIT. This file is generated by tools/proto_format/proto_sync.py. + +load("@envoy_api//bazel:api_build_system.bzl", "api_proto_package") + +licenses(["notice"]) # Apache 2 + +api_proto_package( + deps = ["@com_github_cncf_udpa//udpa/annotations:pkg"], +) diff --git a/envoy/extensions/udp_packet_writer/v3/udp_default_writer_factory.proto b/envoy/extensions/udp_packet_writer/v3/udp_default_writer_factory.proto new file mode 100644 index 00000000..aac0417d --- /dev/null +++ b/envoy/extensions/udp_packet_writer/v3/udp_default_writer_factory.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +package envoy.extensions.udp_packet_writer.v3; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.udp_packet_writer.v3"; +option java_outer_classname = "UdpDefaultWriterFactoryProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/udp_packet_writer/v3;udp_packet_writerv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: UDP packet writer config] +// [#extension: envoy.udp_packet_writer.default] + +// Configuration for the default UDP packet writer factory which simply +// uses the kernel's sendmsg() to send UDP packets. +message UdpDefaultWriterFactory { +} diff --git a/envoy/extensions/udp_packet_writer/v3/udp_gso_batch_writer_factory.proto b/envoy/extensions/udp_packet_writer/v3/udp_gso_batch_writer_factory.proto new file mode 100644 index 00000000..aad5c78e --- /dev/null +++ b/envoy/extensions/udp_packet_writer/v3/udp_gso_batch_writer_factory.proto @@ -0,0 +1,18 @@ +syntax = "proto3"; + +package envoy.extensions.udp_packet_writer.v3; + +import "udpa/annotations/status.proto"; + +option java_package = "io.envoyproxy.envoy.extensions.udp_packet_writer.v3"; +option java_outer_classname = "UdpGsoBatchWriterFactoryProto"; +option java_multiple_files = true; +option go_package = "github.com/envoyproxy/go-control-plane/envoy/extensions/udp_packet_writer/v3;udp_packet_writerv3"; +option (udpa.annotations.file_status).package_version_status = ACTIVE; + +// [#protodoc-title: UDP packet writer config] +// [#extension: envoy.udp_packet_writer.gso] + +// Configuration for the UDP GSO batch packet writer factory. +message UdpGsoBatchWriterFactory { +} diff --git a/versioning/BUILD b/versioning/BUILD index 5f074692..37d96067 100644 --- a/versioning/BUILD +++ b/versioning/BUILD @@ -199,6 +199,7 @@ proto_library( "//envoy/extensions/transport_sockets/tap/v3:pkg", "//envoy/extensions/transport_sockets/tcp_stats/v3:pkg", "//envoy/extensions/transport_sockets/tls/v3:pkg", + "//envoy/extensions/udp_packet_writer/v3:pkg", "//envoy/extensions/upstreams/http/generic/v3:pkg", "//envoy/extensions/upstreams/http/http/v3:pkg", "//envoy/extensions/upstreams/http/tcp/v3:pkg",