Skip to content

Commit

Permalink
Merge pull request projectcalico#8597 from tomastigera/tomas-bpf-dirt…
Browse files Browse the repository at this point in the history
…y-ifaces

[BPF] log if ifaces remain dirty when we report not ready
  • Loading branch information
tomastigera authored Mar 22, 2024
2 parents 4efd1bf + aa688d4 commit 95fed7d
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion 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 @@ -1560,6 +1567,10 @@ func (m *bpfEndpointManager) CompleteDeferredWork() error {
}
m.reportHealth(true, "")
} else {
m.dirtyIfaceNames.Iter(func(iface string) error {
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 95fed7d

Please sign in to comment.