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, provide, ), cell.Invoke( configure, start, bpf.MaybeTablePressureMetrics[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 shell -- db/show bandwidth-edts". A reconciler is registered that reconciles the table with the cilium_throttle map.
var (
// EDTByID queries the EDT table by endpoint ID and direction.
EDTByID = edtIDIndex.Query
)
Functions ¶
Types ¶
type Edt ¶ added in v1.16.0
type Edt struct {
EdtIDKey
// BytesPerSecond is the bandwidth limit for the endpoint.
BytesPerSecond uint64
Prio uint32
// 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