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

eBPF: Update map definition in sockops program #8693

Merged
merged 3 commits into from
Apr 8, 2024

Conversation

debasishbsws
Copy link
Contributor

@debasishbsws debasishbsws commented Apr 4, 2024

Description

bpf_map_def map declaration was deprecated https://github.com/libbpf/libbpf/wiki/Libbpf%3A-the-road-to-v1.0#drop-support-for-legacy-bpf-map-declaration-syntax

was getting errors while building from the source for Wolfi

2024/04/04 18:21:20 INFO clang -Wno-error=unused-but-set-variable -m64 -D__x86_64__ -x c -D__KERNEL__ -D__ASM_SYSREG_H -Wunused -Wall -Werror -fno-stack-protector -O2 -target bpf -emit-llvm -g -I/usr/include/x86_64-pc-linux-gnu -c sockops.c -o sockops.ll
2024/04/04 18:21:20 WARN sockops.c:18:53: error: variable has incomplete type 'struct bpf_map_def'
2024/04/04 18:21:20 WARN struct bpf_map_def __attribute__((section("maps"))) calico_sk_endpoints = {
2024/04/04 18:21:20 WARN                                                     ^
2024/04/04 18:21:20 WARN sockops.c:18:8: note: forward declaration of 'struct bpf_map_def'
2024/04/04 18:21:20 WARN struct bpf_map_def __attribute__((section("maps"))) calico_sk_endpoints = {
2024/04/04 18:21:20 WARN        ^
2024/04/04 18:21:20 WARN 1 error generated.

Release Note

ebpf: Update map definition in sockops program to let libbpf v1.0+ load them successfully.

@debasishbsws debasishbsws requested a review from a team as a code owner April 4, 2024 19:11
@marvin-tigera marvin-tigera added this to the Calico v3.29.0 milestone Apr 4, 2024
@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 Apr 4, 2024
@CLAassistant
Copy link

CLAassistant commented Apr 4, 2024

CLA assistant check
All committers have signed the CLA.

@debasishbsws debasishbsws changed the title Update as the older format was deprecated Update as the older format bpf_map-def was deprecated Apr 4, 2024
Copy link
Member

@mazdakn mazdakn left a comment

Choose a reason for hiding this comment

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

@debasishbsws Thanks for finding and fixing this. We recently fixed the issue in PR #8610, but failed to catch this one.

felix/bpf-apache/sockops.c Outdated Show resolved Hide resolved
@mazdakn mazdakn added the docs-not-required Docs not required for this change label Apr 7, 2024
@marvin-tigera marvin-tigera removed the docs-pr-required Change is not yet documented label Apr 7, 2024
@mazdakn
Copy link
Member

mazdakn commented Apr 8, 2024

/sem-approve

@mazdakn mazdakn merged commit 48907b7 into projectcalico:master Apr 8, 2024
2 checks passed
mazdakn added a commit to mazdakn/calico that referenced this pull request Apr 8, 2024
Update as the older format bpf_map-def was deprecated
@mazdakn mazdakn changed the title Update as the older format bpf_map-def was deprecated eBPF: Update map definition in sockops program Apr 8, 2024
mazdakn added a commit to mazdakn/calico that referenced this pull request Apr 8, 2024
Update as the older format bpf_map-def was deprecated
mazdakn added a commit to mazdakn/calico that referenced this pull request Apr 8, 2024
Update as the older format bpf_map-def was deprecated
@debasishbsws debasishbsws deleted the patch-1 branch April 9, 2024 04:56
mazdakn added a commit to mazdakn/calico that referenced this pull request May 16, 2024
Update as the older format bpf_map-def was deprecated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs-not-required Docs not required for this change 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.

5 participants