Skip to content

Commit

Permalink
set additional map size to max all the time
Browse files Browse the repository at this point in the history
Signed-off-by: Mohamed Mahmoud <[email protected]>
  • Loading branch information
msherif1234 committed Jan 15, 2025
1 parent 670f6b9 commit e3a6a54
Showing 1 changed file with 1 addition and 12 deletions.
13 changes: 1 addition & 12 deletions pkg/tracer/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,11 +132,7 @@ func NewFlowFetcher(cfg *FlowFetcherConfig) (*FlowFetcher, error) {

// Resize maps according to user-provided configuration
spec.Maps[aggregatedFlowsMap].MaxEntries = uint32(cfg.CacheMaxSize)
if isEBPFFeaturesEnabled(cfg) {
spec.Maps[additionalFlowMetrics].MaxEntries = uint32(cfg.CacheMaxSize)
} else {
spec.Maps[additionalFlowMetrics].MaxEntries = 1
}
spec.Maps[additionalFlowMetrics].MaxEntries = uint32(cfg.CacheMaxSize)
// remove pinning from all maps
maps2Name := []string{"aggregated_flows", "additional_flow_metrics", "direct_flows", "dns_flows", "filter_map", "global_counters", "packet_record"}
for _, m := range maps2Name {
Expand Down Expand Up @@ -368,13 +364,6 @@ func NewFlowFetcher(cfg *FlowFetcherConfig) (*FlowFetcher, error) {
}, nil
}

func isEBPFFeaturesEnabled(cfg *FlowFetcherConfig) bool {
if cfg.EnableNetworkEventsMonitoring || cfg.EnableRTT || cfg.EnablePktDrops || cfg.EnableDNSTracker || cfg.EnablePktTranslation {
return true
}
return false
}

func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error {
ilog := log.WithField("iface", iface)
if iface.NetNS != netns.None() {
Expand Down

0 comments on commit e3a6a54

Please sign in to comment.