bwmap

package
v0.0.0-...-c34bea4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 20, 2022 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package bwmap represents the BPF map used to enforce Pod bandwidth limitations via EDT (Earliest Departure Time) + BPF. +groupName=maps

Index

Constants

View Source
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
)

Variables

View Source
var ThrottleMap = bpf.NewMap(
	MapName,
	bpf.MapTypeHash,
	&EdtId{}, int(unsafe.Sizeof(EdtId{})),
	&EdtInfo{}, int(unsafe.Sizeof(EdtInfo{})),
	MapSize,
	bpf.BPF_F_NO_PREALLOC, 0,
	bpf.ConvertKeyValue,
).WithCache().WithPressureMetric()

Functions

func Delete

func Delete(Id uint16) error

func Update

func Update(Id uint16, Bps uint64) error

Types

type EdtId

type EdtId struct {
	Id uint64 `align:"id"`
}

func (*EdtId) DeepCopyMapKey

func (k *EdtId) DeepCopyMapKey() bpf.MapKey

func (*EdtId) GetKeyPtr

func (k *EdtId) GetKeyPtr() unsafe.Pointer

func (*EdtId) NewValue

func (k *EdtId) NewValue() bpf.MapValue

func (*EdtId) String

func (k *EdtId) String() string

type EdtInfo

type EdtInfo struct {
	Bps             uint64    `align:"bps"`
	TimeLast        uint64    `align:"t_last"`
	TimeHorizonDrop uint64    `align:"t_horizon_drop"`
	Pad             [4]uint64 `align:"pad"`
}

func (*EdtInfo) DeepCopyMapValue

func (v *EdtInfo) DeepCopyMapValue() bpf.MapValue

func (*EdtInfo) GetValuePtr

func (v *EdtInfo) GetValuePtr() unsafe.Pointer

func (*EdtInfo) String

func (v *EdtInfo) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL