Skip to content

Commit

Permalink
Add Kernel Misc Probe
Browse files Browse the repository at this point in the history
Add kernel misc feature probe which include kernel BPF large instruction
support information. It allows Cilium features to probe kernel large instruction
support.

Signed-off-by: Vincent Li <vincent.mc.li@gmail.com>
  • Loading branch information
vincentmli committed Oct 14, 2021
1 parent 322433d commit 9768b8c
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions pkg/datapath/linux/probes/probes.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,17 @@ type MapTypes struct {
HaveStackMapType bool `json:"have_stack_map_type"`
}

// Kernel misc configurations kernel large 1M instructions support
type Misc struct {
HaveLargeInsnLimit bool `json:"have_large_insn_limit"`
}

// Features contains BPF feature checks returned by bpftool.
type Features struct {
SystemConfig `json:"system_config"`
MapTypes `json:"map_types"`
Helpers map[string][]string `json:"helpers"`
Misc `json:"misc"`
}

// ProbeManager is a manager of BPF feature checks.
Expand Down Expand Up @@ -306,6 +312,11 @@ func (p *ProbeManager) GetMapTypes() *MapTypes {
return &p.features.MapTypes
}

// GetMisc returns information about kernel misc.
func (p *ProbeManager) GetMisc() Misc {
return p.features.Misc
}

// GetHelpers returns information about available BPF helpers for the given
// program type.
// If program type is not found, returns nil.
Expand Down

0 comments on commit 9768b8c

Please sign in to comment.