Skip to content

Commit

Permalink
[BPF] rate limit logging remaining dirty ifaces
Browse files Browse the repository at this point in the history
  • Loading branch information
tomastigera committed Mar 11, 2024
1 parent 4018834 commit aa688d4
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions felix/dataplane/linux/bpf_ep_mgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ import (
"github.com/projectcalico/calico/felix/logutils"
"github.com/projectcalico/calico/felix/rules"

logutilslc "github.com/projectcalico/calico/libcalico-go/lib/logutils"
"github.com/projectcalico/calico/libcalico-go/lib/set"

"github.com/projectcalico/api/pkg/lib/numorstring"
Expand Down Expand Up @@ -358,7 +359,8 @@ type bpfEndpointManager struct {
v4 *bpfEndpointManagerDataplane
v6 *bpfEndpointManagerDataplane

healthAggregator *health.HealthAggregator
healthAggregator *health.HealthAggregator
updateRateLimitedLog *logutilslc.RateLimitedLogger
}

type bpfEndpointManagerDataplane struct {
Expand Down Expand Up @@ -506,6 +508,11 @@ func newBPFEndpointManager(
})
}

m.updateRateLimitedLog = logutilslc.NewRateLimitedLogger(
logutilslc.OptInterval(30*time.Second),
logutilslc.OptBurst(10),
)

// Calculate allowed XDP attachment modes. Note, in BPF mode untracked ingress policy is
// _only_ implemented by XDP, so we _should_ fall back to XDPGeneric if necessary in order
// to preserve the semantics of untracked ingress policy. (Therefore we are also saying
Expand Down Expand Up @@ -1561,7 +1568,7 @@ func (m *bpfEndpointManager) CompleteDeferredWork() error {
m.reportHealth(true, "")
} else {
m.dirtyIfaceNames.Iter(func(iface string) error {
log.WithField("name", iface).Debug("Interface remains dirty.")
m.updateRateLimitedLog.WithField("name", iface).Debug("Interface remains dirty.")
return nil
})
m.reportHealth(false, "Failed to configure some interfaces.")
Expand Down

0 comments on commit aa688d4

Please sign in to comment.