Documentation ¶
Overview ¶
Package bwmap represents the BPF map used to enforce Pod bandwidth limitations via EDT (Earliest Departure Time) + BPF. +groupName=maps
Index ¶
Constants ¶
const ( MapName = "cilium_throttle" // Flow aggregate is per Pod, so same size as Endpoint map. MapSize = lxcmap.MaxEntries // DefaultDropHorizon represents maximum allowed departure // time delta in future. Given applications can set SO_TXTIME // from user space this is a limit to prevent buggy applications // to fill the FQ qdisc. DefaultDropHorizon = 2 * time.Second )
const EdtTableName = "bandwidth-edts"
Variables ¶
var Cell = cell.Module( "bwmap", "Manages the endpoint bandwidth limit BPF map", cell.Provide( NewEdtTable, statedb.RWTable[Edt].ToTable, newThrottleMap, ), cell.Invoke( statedb.RegisterTable[Edt], registerReconciler, bpf.RegisterTablePressureMetricsJob[Edt, throttleMap], ), )
Cell manages the cilium_throttle BPF map for implementing per-endpoint bandwidth management. The cell provides RWTable[Edt] to which per endpoint bandwidth limits can be inserted. Use NewEdt to create the object. The table can be inspected with "cilium-dbg statedb bandwidth-edts". A reconciler is registered that reconciles the table with the cilium_throttle map.
Functions ¶
func ThrottleMap ¶
ThrottleMap constructs the cilium_throttle map. Direct use of this outside of this package is solely for cilium-dbg.
Types ¶
type Edt ¶ added in v1.16.0
type Edt struct { // EndpointID is the identity of the endpoint being throttled. EndpointID uint16 // BytesPerSecond is the bandwidth limit for the endpoint. BytesPerSecond uint64 // TimeHorizonDrop is the maximum allowed departure time nanoseconds // delta in future. TimeHorizonDrop uint64 // Status is the BPF map reconciliation status of this throttle entry. Status reconciler.Status }
Edt is defines the "earliest departure time" pacing for a specific Cilium endpoint. This structure is stored in Table[Edt] and reconciled to the cilium_throttle BPF map.
Edt is stored by value as it's relatively tiny.
func (Edt) BinaryKey ¶ added in v1.16.0
func (e Edt) BinaryKey() encoding.BinaryMarshaler
func (Edt) BinaryValue ¶ added in v1.16.0
func (e Edt) BinaryValue() encoding.BinaryMarshaler