udp: write performance improvement via udp_gso (#12219)
Introduces UdpPacketWriter Interface that can be used to perform writes in Batched/PassThrough modes by using QuicGsoBatchWriter implementation from QUICHE extension. **Additional Description:** UDP GSO (Generic Segmentation Offload) was introduced in Linux at version 4.18. It allows batch-writing of multiple messages into a single payload and sending these messages along as a batch in a single sendmsg syscall. Currently, Envoy performs the sending of messages using simple sendmsg implementation in pass-through mode, i.e. no support for batch writing. With this change, UdpListener can use UdpPacketWriter interface as a DefaultWriter or a GsoBatchWriter to perform pass-through or batched writes respectively. Detailed description of the changes can be found in the design document, [here](https://docs.google.com/document/d/16ePbgkfrzQ6v-cOVMSnKDja3dUdZvX-mxT9jw29rx4g/edit?usp=sharing). **Risk Level:** Low, not in use **Testing:** - Added udp_listener_impl_batched_writes_test, to verify that multiple packets of varying sizes are batched/flushed as per gso specifications while using UdpGsoBatchWriter. - Modified existing tests, to verify that UdpDefaultWriter performs writes in pass-through mode. - Ran all tests. All 677 tests passed successfully. ``` **Docs Changes:** None **Release Notes:** None **Fixes:** #11925 Signed-off-by: Yugant <yugant@google.com> Mirrored from https://github.com/envoyproxy/envoy @ 933e267db60961e76549ae6e65ac4872cb78db4dmaster-ci-test
parent
c6d5ae2875
commit
66443ebd3b
6 changed files with 112 additions and 2 deletions
@ -0,0 +1,21 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.listener.v3; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
import "google/protobuf/wrappers.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.config.listener.v3"; |
||||
option java_outer_classname = "UdpDefaultWriterConfigProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
|
||||
// [#protodoc-title: Udp Default Writer Config] |
||||
|
||||
// [#not-implemented-hide:] |
||||
// Configuration specific to the Udp Default Writer. |
||||
message UdpDefaultWriterOptions { |
||||
} |
@ -0,0 +1,21 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.listener.v3; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
import "google/protobuf/wrappers.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.config.listener.v3"; |
||||
option java_outer_classname = "UdpGsoBatchWriterConfigProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = ACTIVE; |
||||
|
||||
// [#protodoc-title: Udp Gso Batch Writer Config] |
||||
|
||||
// [#not-implemented-hide:] |
||||
// Configuration specific to the Udp Gso Batch Writer. |
||||
message UdpGsoBatchWriterOptions { |
||||
} |
@ -0,0 +1,23 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.listener.v4alpha; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
import "google/protobuf/wrappers.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.config.listener.v4alpha"; |
||||
option java_outer_classname = "UdpDefaultWriterConfigProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; |
||||
|
||||
// [#protodoc-title: Udp Default Writer Config] |
||||
|
||||
// [#not-implemented-hide:] |
||||
// Configuration specific to the Udp Default Writer. |
||||
message UdpDefaultWriterOptions { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.config.listener.v3.UdpDefaultWriterOptions"; |
||||
} |
@ -0,0 +1,23 @@ |
||||
syntax = "proto3"; |
||||
|
||||
package envoy.config.listener.v4alpha; |
||||
|
||||
import "google/protobuf/duration.proto"; |
||||
import "google/protobuf/wrappers.proto"; |
||||
|
||||
import "udpa/annotations/status.proto"; |
||||
import "udpa/annotations/versioning.proto"; |
||||
|
||||
option java_package = "io.envoyproxy.envoy.config.listener.v4alpha"; |
||||
option java_outer_classname = "UdpGsoBatchWriterConfigProto"; |
||||
option java_multiple_files = true; |
||||
option (udpa.annotations.file_status).package_version_status = NEXT_MAJOR_VERSION_CANDIDATE; |
||||
|
||||
// [#protodoc-title: Udp Gso Batch Writer Config] |
||||
|
||||
// [#not-implemented-hide:] |
||||
// Configuration specific to the Udp Gso Batch Writer. |
||||
message UdpGsoBatchWriterOptions { |
||||
option (udpa.annotations.versioning).previous_message_type = |
||||
"envoy.config.listener.v3.UdpGsoBatchWriterOptions"; |
||||
} |
Loading…
Reference in new issue