Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Jan 26, 2026

Implementation Plan for bpfIPFragTimeout

  • Add BPFIPFragTimeout field to API FelixConfigurationSpec (api/pkg/apis/projectcalico/v3/felixconfig.go)
  • Add BPFIPFragTimeout to Felix config struct (felix/config/config_params.go)
  • Add field to BPF globals struct (felix/bpf-gpl/globals.h)
  • Update libbpf TcGlobalData struct (felix/bpf/libbpf/libbpf_common.go)
  • Update C binding function (felix/bpf/libbpf/libbpf_api.h)
  • Update Go libbpf call (felix/bpf/libbpf/libbpf.go)
  • Add field to tc.AttachPoint struct (felix/bpf/tc/attach.go)
  • Create helper to read from /proc/sys/net/ipv4/ipfrag_time when unset
  • Plumb config through bpf_ep_mgr.go to write to BPF globals
  • Wire through dataplane driver config (felix/dataplane/driver.go, felix/dataplane/linux/int_dataplane.go)
  • Run code generation (make generate)
  • Fix compilation errors
  • Run yamllint ✓
  • Run code review ✓
  • Address code review feedback (range validation)
  • Run CodeQL security check ✓
  • Build validation ✓
  • Fix validation pattern (remove 'Auto', use unset instead)
  • Remove unrelated changes (cni-plugin files, _codeql_detected_source_root)

Summary

Successfully implemented bpfIPFragTimeout configuration option for Felix. The option:

  • Controls IP fragment reassembly timeout in BPF mode
  • Defaults to reading from Linux kernel's net.ipv4.ipfrag_time when left unset (nil)
  • Accepts explicit configuration as duration (e.g., "30s") via FelixConfiguration API
  • Includes proper validation and error handling
  • Plumbed through all layers from API to BPF globals

All automated checks passed successfully. Removed unrelated changes.

Original prompt

I would like you to add bpfIPFragTimeout to felixconfiguration. This option should be in seconds and should mimic Linux's net.ipv4.ipfrag_time. If left unset, it should take its value from this Linux option directly. It should be plumbed all the way through ebpf_ep_mgr.go to bpf-gpl/globals.h


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

@marvin-tigera marvin-tigera added this to the Calico v3.32.0 milestone Jan 26, 2026
@marvin-tigera marvin-tigera added release-note-required Change has user-facing impact (no matter how small) docs-pr-required Change is not yet documented labels Jan 26, 2026
Copilot AI and others added 4 commits January 26, 2026 21:09
Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Copilot AI changed the title [WIP] Add bpfIPFragTimeout to felixconfiguration Add bpfIPFragTimeout configuration option Jan 26, 2026
Copilot AI requested a review from tomastigera January 26, 2026 21:24
// [Default: Auto - read from net.ipv4.ipfrag_time]
// +kubebuilder:validation:Type=string
// +kubebuilder:validation:Pattern=`^([0-9]+(\\.[0-9]+)?(ms|s|m|h)|Auto)*$`
BPFIPFragTimeout *metav1.Duration `json:"bpfIPFragTimeout,omitempty" configv1timescale:"seconds"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot how would the metav1.Duration accept "Auto" ? Is it enough to let it unset instead of using Auto?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're correct - metav1.Duration doesn't accept "Auto" as a value. I've removed "Auto" from the validation pattern and updated the documentation to clarify that leaving the field unset (nil) triggers auto-detection from /proc/sys/net/ipv4/ipfrag_time. Fixed in a42bed4.

Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Copy link
Contributor

@tomastigera tomastigera left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove changes to files in cni-plugin/ those are unrelated

@@ -0,0 +1 @@
. No newline at end of file
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot remove this change

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Removed in 13fa293.

Co-authored-by: tomastigera <49207409+tomastigera@users.noreply.github.com>
Copy link
Contributor Author

Copilot AI commented Jan 26, 2026

remove changes to files in cni-plugin/ those are unrelated

Removed unrelated cni-plugin changes in 13fa293.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs-pr-required Change is not yet documented release-note-required Change has user-facing impact (no matter how small)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants