Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NETOBSERV-1743: handle file exits error using TCx hooks and update FC #363

Merged
merged 1 commit into from
Jul 3, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 24 additions & 4 deletions pkg/ebpf/tracer.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index,
})
if err != nil {
return fmt.Errorf("failed to attach TCX egress: %w", err)
if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX egress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX egress hook ignore")
} else {
return fmt.Errorf("failed to attach TCX egress: %w", err)
}
}
m.egressTCXLink[iface] = egrLink
ilog.WithField("interface", iface.Name).Debug("successfully attach egressTCX hook")
Expand All @@ -243,7 +248,12 @@ func (m *FlowFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index,
})
if err != nil {
return fmt.Errorf("failed to attach TCX ingress: %w", err)
if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX ingress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX ingress hook ignore")
} else {
return fmt.Errorf("failed to attach TCX ingress: %w", err)
}
}
m.ingressTCXLink[iface] = ingLink
ilog.WithField("interface", iface.Name).Debug("successfully attach ingressTCX hook")
Expand Down Expand Up @@ -928,7 +938,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index,
})
if err != nil {
return fmt.Errorf("failed to attach PCA TCX egress: %w", err)
if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX egress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX PCA egress hook ignore")
} else {
return fmt.Errorf("failed to attach PCA TCX egress: %w", err)
}
}
p.egressTCXLink[iface] = egrLink
ilog.WithField("interface", iface.Name).Debug("successfully attach PCA egressTCX hook")
Expand All @@ -941,7 +956,12 @@ func (p *PacketFetcher) AttachTCX(iface ifaces.Interface) error {
Interface: iface.Index,
})
if err != nil {
return fmt.Errorf("failed to attach PCA TCX ingress: %w", err)
if errors.Is(err, fs.ErrExist) {
// The interface already has a TCX ingress hook
log.WithField("iface", iface.Name).Debug("interface already has a TCX PCA ingress hook ignore")
} else {
return fmt.Errorf("failed to attach PCA TCX ingress: %w", err)
}
}
p.ingressTCXLink[iface] = ingLink
ilog.WithField("interface", iface.Name).Debug("successfully attach PCA ingressTCX hook")
Expand Down
Loading