contrib: add qatzstd compressor (#32166)

Signed-off-by: giantcroc <changran.wang@intel.com>

Mirrored from https://github.com/envoyproxy/envoy @ 9e447bfaa2eaf29925bfb279b83e1ad202d1b514
main
update-envoy[bot] 9 months ago
parent 25b95c3bdb
commit 3d806695a0
  1. 1
      BUILD
  2. 9
      contrib/envoy/extensions/compression/qatzstd/compressor/v3alpha/BUILD
  3. 69
      contrib/envoy/extensions/compression/qatzstd/compressor/v3alpha/qatzstd.proto
  4. 1
      versioning/BUILD

@ -73,6 +73,7 @@ proto_library(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//contrib/envoy/extensions/compression/qatzip/compressor/v3alpha:pkg", "//contrib/envoy/extensions/compression/qatzip/compressor/v3alpha:pkg",
"//contrib/envoy/extensions/compression/qatzstd/compressor/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/checksum/v3alpha:pkg", "//contrib/envoy/extensions/filters/http/checksum/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/dynamo/v3:pkg", "//contrib/envoy/extensions/filters/http/dynamo/v3:pkg",
"//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg", "//contrib/envoy/extensions/filters/http/golang/v3alpha:pkg",

@ -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_xds//udpa/annotations:pkg"],
)

@ -0,0 +1,69 @@
syntax = "proto3";
package envoy.extensions.compression.qatzstd.compressor.v3alpha;
import "google/protobuf/wrappers.proto";
import "udpa/annotations/status.proto";
import "validate/validate.proto";
option java_package = "io.envoyproxy.envoy.extensions.compression.qatzstd.compressor.v3alpha";
option java_outer_classname = "QatzstdProto";
option java_multiple_files = true;
option go_package = "github.com/envoyproxy/go-control-plane/contrib/envoy/extensions/compression/qatzstd/compressor/v3alpha";
option (udpa.annotations.file_status).package_version_status = ACTIVE;
// [#protodoc-title: Qatzstd Compressor]
// Qatzstd :ref:`configuration overview <config_qatzstd>`.
// [#extension: envoy.compression.qatzstd.compressor]
// [#next-free-field: 8]
message Qatzstd {
// Reference to http://facebook.github.io/zstd/zstd_manual.html
enum Strategy {
DEFAULT = 0;
FAST = 1;
DFAST = 2;
GREEDY = 3;
LAZY = 4;
LAZY2 = 5;
BTLAZY2 = 6;
BTOPT = 7;
BTULTRA = 8;
BTULTRA2 = 9;
}
// Set compression parameters according to pre-defined compression level table.
// Note that exact compression parameters are dynamically determined,
// depending on both compression level and source content size (when known).
// Value 0 means default, and default level is 3.
//
// Setting a level does not automatically set all other compression parameters
// to default. Setting this will however eventually dynamically impact the compression
// parameters which have not been manually set. The manually set
// ones will 'stick'.
google.protobuf.UInt32Value compression_level = 1 [(validate.rules).uint32 = {lte: 22 gte: 1}];
// A 32-bits checksum of content is written at end of frame. If not set, defaults to false.
bool enable_checksum = 2;
// The higher the value of selected strategy, the more complex it is,
// resulting in stronger and slower compression.
//
// Special: value 0 means "use default strategy".
Strategy strategy = 3 [(validate.rules).enum = {defined_only: true}];
// Value for compressor's next output buffer. If not set, defaults to 4096.
google.protobuf.UInt32Value chunk_size = 5 [(validate.rules).uint32 = {lte: 65536 gte: 4096}];
// Enable QAT to accelerate Zstd compression or not. If not set, defaults to false.
//
// This is useful in the case that users want to enable QAT for a period of time and disable QAT for another period of time,
// they don't have to change the config too much or prepare for another config that has software zstd compressor and just changing the value of this filed.
bool enable_qat_zstd = 6;
// Fallback to software for Qatzstd when input size is less than this value.
// Valid only ``enable_qat_zstd`` is ``true``. 0 means no fallback at all. If not set, defaults to 4000.
google.protobuf.UInt32Value qat_zstd_fallback_threshold = 7
[(validate.rules).uint32 = {lte: 65536 gte: 0}];
}

@ -10,6 +10,7 @@ proto_library(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [ deps = [
"//contrib/envoy/extensions/compression/qatzip/compressor/v3alpha:pkg", "//contrib/envoy/extensions/compression/qatzip/compressor/v3alpha:pkg",
"//contrib/envoy/extensions/compression/qatzstd/compressor/v3alpha:pkg",
"//contrib/envoy/extensions/config/v3alpha:pkg", "//contrib/envoy/extensions/config/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/checksum/v3alpha:pkg", "//contrib/envoy/extensions/filters/http/checksum/v3alpha:pkg",
"//contrib/envoy/extensions/filters/http/dynamo/v3:pkg", "//contrib/envoy/extensions/filters/http/dynamo/v3:pkg",

Loading…
Cancel
Save