Documentation
¶
Index ¶
- Variables
- type Sockmap
- func (*Sockmap) Descriptor() ([]byte, []int)deprecated
- func (x *Sockmap) GetAcceleratedPorts() []*v3.Int64Range
- func (x *Sockmap) GetBpfProgramPath() string
- func (x *Sockmap) GetCgroupPath() string
- func (x *Sockmap) GetRegisterUserSpaceSockets() *wrapperspb.BoolValue
- func (x *Sockmap) GetSockhashMaxEntries() *wrapperspb.UInt32Value
- func (*Sockmap) ProtoMessage()
- func (x *Sockmap) ProtoReflect() protoreflect.Message
- func (x *Sockmap) Reset()
- func (x *Sockmap) String() string
- func (m *Sockmap) Validate() error
- func (m *Sockmap) ValidateAll() error
- type SockmapMultiError
- type SockmapValidationError
Constants ¶
This section is empty.
Variables ¶
var File_envoy_extensions_network_socket_interface_sockmap_v3_sockmap_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Sockmap ¶
type Sockmap struct {
// Filesystem path to the compiled eBPF object that holds the “sock_ops“ and “sk_msg“
// programs and the “sockhash“ map. Envoy does not ship this object. Build it from the
// extension's “sockmap_kern.c“ source, or supply a custom build that exports the
// “envoy_sockops“ and “envoy_sk_msg“ programs and the “envoy_sockhash“ map with a matching
// key layout. If not specified, acceleration is disabled and all sockets use the standard
// datapath.
BpfProgramPath string `protobuf:"bytes,1,opt,name=bpf_program_path,json=bpfProgramPath,proto3" json:"bpf_program_path,omitempty"`
// Path to the cgroup v2 directory the “sock_ops“ program is attached to. While attached, every
// socket that reaches the established state inside this cgroup is added to the “sockhash“,
// which accelerates application-to-proxy hops. If not specified, the “sock_ops“ program
// is not attached and only sockets accepted or connected by Envoy are registered, which still
// accelerates proxy-to-proxy hops on the same host.
CgroupPath string `protobuf:"bytes,2,opt,name=cgroup_path,json=cgroupPath,proto3" json:"cgroup_path,omitempty"`
// Maximum number of entries in the “sockhash“ map. Each accelerated socket consumes one entry.
// If not specified, defaults to “65536“.
SockhashMaxEntries *wrapperspb.UInt32Value `protobuf:"bytes,3,opt,name=sockhash_max_entries,json=sockhashMaxEntries,proto3" json:"sockhash_max_entries,omitempty"`
// Whether sockets accepted or connected by Envoy are registered into the “sockhash“ from user
// space. This is independent of “cgroup_path“ and lets proxy-to-proxy hops be accelerated
// without attaching the “sock_ops“ program. If not specified, defaults to “true“.
RegisterUserSpaceSockets *wrapperspb.BoolValue `` /* 137-byte string literal not displayed */
// Proxy listener port ranges that scope which connections the “sock_ops“ program adds to the
// “sockhash“. Each range is half-open “[start, end)“ with “1 <= start < end <= 65536“, so a
// single port “P“ is “{ start: P, end: P + 1 }“. When set, only a connection whose local or
// peer port falls in one of these ranges is registered, so other same-host connections in the
// cgroup stay on the standard datapath. This applies only when “cgroup_path“ is set. If empty,
// every such connection is registered. At most “128“ ranges are allowed.
AcceleratedPorts []*v3.Int64Range `protobuf:"bytes,5,rep,name=accelerated_ports,json=acceleratedPorts,proto3" json:"accelerated_ports,omitempty"`
// contains filtered or unexported fields
}
Configuration for the “sockmap“ socket interface. It accelerates same-host TCP hops by loading eBPF “sock_ops“ and “sk_msg“ programs that redirect payloads between local sockets through a “BPF_MAP_TYPE_SOCKHASH“, bypassing the kernel TCP/IP stack. Connections whose peer is not on the same host are not present in the map and transparently fall back to TCP/IP.
This interface requires a Linux kernel 4.18 or later and the capabilities to load and attach the eBPF network programs (“CAP_SYS_ADMIN“, or “CAP_BPF“ and “CAP_NET_ADMIN“ on newer kernels). When the programs cannot be loaded or attached, the interface logs the failure and every socket falls back to the standard datapath, so traffic is never interrupted. [#next-free-field: 6]
func (*Sockmap) Descriptor
deprecated
func (*Sockmap) GetAcceleratedPorts ¶
func (x *Sockmap) GetAcceleratedPorts() []*v3.Int64Range
func (*Sockmap) GetBpfProgramPath ¶
func (*Sockmap) GetCgroupPath ¶
func (*Sockmap) GetRegisterUserSpaceSockets ¶
func (x *Sockmap) GetRegisterUserSpaceSockets() *wrapperspb.BoolValue
func (*Sockmap) GetSockhashMaxEntries ¶
func (x *Sockmap) GetSockhashMaxEntries() *wrapperspb.UInt32Value
func (*Sockmap) ProtoMessage ¶
func (*Sockmap) ProtoMessage()
func (*Sockmap) ProtoReflect ¶
func (x *Sockmap) ProtoReflect() protoreflect.Message
func (*Sockmap) Validate ¶
Validate checks the field values on Sockmap with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Sockmap) ValidateAll ¶
ValidateAll checks the field values on Sockmap with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in SockmapMultiError, or nil if none found.
type SockmapMultiError ¶
type SockmapMultiError []error
SockmapMultiError is an error wrapping multiple validation errors returned by Sockmap.ValidateAll() if the designated constraints aren't met.
func (SockmapMultiError) AllErrors ¶
func (m SockmapMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (SockmapMultiError) Error ¶
func (m SockmapMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type SockmapValidationError ¶
type SockmapValidationError struct {
// contains filtered or unexported fields
}
SockmapValidationError is the validation error returned by Sockmap.Validate if the designated constraints aren't met.
func (SockmapValidationError) Cause ¶
func (e SockmapValidationError) Cause() error
Cause function returns cause value.
func (SockmapValidationError) Error ¶
func (e SockmapValidationError) Error() string
Error satisfies the builtin error interface
func (SockmapValidationError) ErrorName ¶
func (e SockmapValidationError) ErrorName() string
ErrorName returns error name.
func (SockmapValidationError) Field ¶
func (e SockmapValidationError) Field() string
Field function returns field value.
func (SockmapValidationError) Key ¶
func (e SockmapValidationError) Key() bool
Key function returns key value.
func (SockmapValidationError) Reason ¶
func (e SockmapValidationError) Reason() string
Reason function returns reason value.