-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
[BPF] failed to dump the conntrack table #9651
Comments
cc @tomastigera |
What was the resolution of this? |
Just closed for vacation ;p We haven't fixed this bug yet, but found some clues that might be helpful. calico/felix/bpf-gpl/conntrack_types.h Lines 156 to 163 in 342d8ec
calico/felix/config/config_params.go Lines 199 to 203 in 342d8ec
calico/felix/bpf/conntrack/v3/map.go Lines 34 to 36 in 342d8ec
calico/felix/bpf/conntrack/v2/map.go Lines 34 to 36 in 342d8ec
As long as we modify these values(512000) at the same time, and rebuild the image, then everything will be working as expected. |
The problem is most likely in https://github.com/projectcalico/calico/blob/master/felix/cmd/calico-bpf/commands/conntrack.go where we do not adjust the default value to the value from the actual map. That is a bug. I think we need to read the size and then call https://github.com/projectcalico/calico/blob/master/felix/bpf/libbpf/libbpf.go#L87 |
Good catch! Thanks a lot for your time! Unfortunately, it seems that there is more than one problem :(
calico/felix/bpf-gpl/include/libbpf/src/libbpf.c Lines 5269 to 5275 in 638464f
I‘m not sure whether the second problem still exists in the master, but everything is working as expected after the following changes in v3.27.3. calico/felix/bpf-gpl/conntrack_types.h Lines 156 to 163 in 342d8ec
The value 512000 in this macro needs to be changed to one that aligns with the global Felix configuration. |
If you would like to submit a fix for (1), that would be fantastic! As for (2), that is weird, we specifically test that here https://github.com/projectcalico/calico/blob/master/felix/fv/bpf_map_resize_test.go Note that there is a process of creating a new map, copying over the old entries and then removing the old map. Also I am pretty sure that we adjust the map constant at loadtime through libbpf 🤔 @sridhartigera |
There was a fix related to this in 3.29 regarding (2). When attaching BPF programs, the new size is picked up. #9117 |
Thanks for reaching out! Yep, let me give it a try ~ |
Thanks for sharing and referencing. It helps me a lot! |
version: v3.27.3
dataplane: eBPF
I modified the bpfMapSizeConntrack parameter in the global Felix configuration and then deleted a calico-node. After that, the following errors occurred:
These errors can be resolved by deleting the file /sys/fs/bpf/tc/globals/cali_v4_ct3. But, when I tried to dump the conntrack table, another error occurred: ErrIterationFinished during the first iteration.
The text was updated successfully, but these errors were encountered: