adapt bpf2go files in new kernel#1273
Conversation
Signed-off-by: lec-bit <glfhzmy@126.com>
484fe24 to
407c425
Compare
Codecov ReportAttention: Patch coverage is
... and 5 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
🚀 New features to boost your workflow:
|
Signed-off-by: lec-bit <glfhzmy@126.com>
Signed-off-by: lec-bit <glfhzmy@126.com>
bpf/include/bpf_common.h
Outdated
|
|
||
| err = bpf_map_update_elem(&map_of_manager, &key, &value, BPF_ANY); | ||
| if (err) | ||
| BPF_LOG(ERR, KMESH, "record ip failed!, err is %d\n", err); |
There was a problem hiding this comment.
| BPF_LOG(ERR, KMESH, "record ip failed!, err is %d\n", err); | |
| BPF_LOG(ERR, KMESH, "record ip failed, err is %d\n", err); |
bpf/include/bpf_common.h
Outdated
|
|
||
| int err = bpf_map_delete_elem(&map_of_manager, &key); | ||
| if (err && err != -ENOENT) | ||
| BPF_LOG(ERR, KMESH, "remove ip failed!, err is %d\n", err); |
There was a problem hiding this comment.
| BPF_LOG(ERR, KMESH, "remove ip failed!, err is %d\n", err); | |
| BPF_LOG(ERR, KMESH, "remove ip failed, err is %d\n", err); |
pkg/bpf/ads/loader.go
Outdated
| bpf2go.KmeshSockopsObjects | ||
| } | ||
|
|
||
| func Bpf2goLoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { |
There was a problem hiding this comment.
| func Bpf2goLoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { | |
| func loadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { |
pkg/bpf/ads/loader.go
Outdated
| return spec, err | ||
| } | ||
|
|
||
| func Bpf2goLoadKmeshSockOps() (*ebpf.CollectionSpec, error) { |
There was a problem hiding this comment.
| func Bpf2goLoadKmeshSockOps() (*ebpf.CollectionSpec, error) { | |
| func loadKmeshSockOps() (*ebpf.CollectionSpec, error) { |
pkg/bpf/ads/loader_enhanced.go
Outdated
| bpf2go.KmeshSockopsObjects | ||
| } | ||
|
|
||
| func Bpf2goLoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { |
There was a problem hiding this comment.
| func Bpf2goLoadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { | |
| func loadKmeshCgroupSock() (*ebpf.CollectionSpec, error) { |
pkg/bpf/ads/loader_enhanced.go
Outdated
| return spec, err | ||
| } | ||
|
|
||
| func Bpf2goLoadKmeshSockOps() (*ebpf.CollectionSpec, error) { |
There was a problem hiding this comment.
| func Bpf2goLoadKmeshSockOps() (*ebpf.CollectionSpec, error) { | |
| func loadKmeshSockOps() (*ebpf.CollectionSpec, error) { |
There was a problem hiding this comment.
The internal interface of bpf2go uses this name 'loadKmeshSockOps'. To avoid duplicate names, I add a prefix of bpf2go.
Signed-off-by: lec-bit <glfhzmy@126.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: hzxuzhonghu The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What type of PR is this?
/kind feature
What this PR does / why we need it:
After the ads mode adopts the new kernel modification solution, some adaptability work is not fully considered and needs to be fixed:
1.bpf2go files no longer distinguish between enhanced and unenhanced, sockops files are now always required
2.In the sockops hook point, it is necessary to determine whether it is managed by kmesh. Previously, the sockops hook point added to the ko file would come in and set the state_cb tag》The is_kmesh_manage function of sockops in the workload is mentioned in kmesh_common.h
3.compilate kmesh.ko before the compilation run
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: