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

Refactor: rename bpf prog/map names #1081

Open
hzxuzhonghu opened this issue Nov 29, 2024 · 7 comments
Open

Refactor: rename bpf prog/map names #1081

hzxuzhonghu opened this issue Nov 29, 2024 · 7 comments
Labels
good first issue Good for newcomers kind/enhancement New feature or request

Comments

@hzxuzhonghu
Copy link
Member

What would you like to be added:

As i have learned that it is sometimes hard to distinguish bpf progs in the OS from names, especially when there are more and more bpf progs attached by different system.

We may need to add kmesh_ prefix like what we do for bpf map..

BTW, cilium use cil_ prefix

Why is this needed:

@hzxuzhonghu hzxuzhonghu added the kind/enhancement New feature or request label Nov 29, 2024
@LiZhenCheng9527
Copy link
Collaborator

I think the name of our bpf map needs to be prefixed with kmesh_ as well

@hzxuzhonghu hzxuzhonghu added the good first issue Good for newcomers label Nov 30, 2024
@hzxuzhonghu
Copy link
Member Author

hzxuzhonghu commented Nov 30, 2024

Right, there are still some maps not named with kmesh prefix

@LiZhenCheng9527
Copy link
Collaborator

I will rename Kmesh's bpf_map.

@nlgwcy
Copy link
Contributor

nlgwcy commented Nov 30, 2024

I will rename Kmesh's bpf_map.

Note that bpf map name contains a maximum of 16 characters. kp_ / km_prefix?

@LiZhenCheng9527
Copy link
Collaborator

Note that bpf map name contains a maximum of 16 characters. kp_ / km_prefix?

Ok. I will use 'km_' to prevent the map name exceeded

@hzxuzhonghu
Copy link
Member Author

km_ make sense

@hzxuzhonghu hzxuzhonghu changed the title Refactor: rename bpf prog names Refactor: rename bpf prog/map names Dec 4, 2024
@hzxuzhonghu
Copy link
Member Author

Now we have these maps

type KmeshCgroupSockWorkloadMaps struct {
	KmAuth         *ebpf.Map `ebpf:"km_auth"`
	KmBackend      *ebpf.Map `ebpf:"km_backend"`
	KmConfigmap    *ebpf.Map `ebpf:"km_configmap"`
	KmDstinfo      *ebpf.Map `ebpf:"km_dstinfo"`
	KmEndpoint     *ebpf.Map `ebpf:"km_endpoint"`
	KmFrontend     *ebpf.Map `ebpf:"km_frontend"`
	KmLogEvent     *ebpf.Map `ebpf:"km_log_event"`
	KmManage       *ebpf.Map `ebpf:"km_manage"`
	KmPerfInfo     *ebpf.Map `ebpf:"km_perf_info"`
	KmPerfMap      *ebpf.Map `ebpf:"km_perf_map"`
	KmService      *ebpf.Map `ebpf:"km_service"`
	KmSockstorage  *ebpf.Map `ebpf:"km_sockstorage"`
	KmTailcallprog *ebpf.Map `ebpf:"km_tailcallprog"`
	KmTcpinfo      *ebpf.Map `ebpf:"km_tcpinfo"`
	KmTmpbuf       *ebpf.Map `ebpf:"km_tmpbuf"`
	KmTuple        *ebpf.Map `ebpf:"km_tuple"`
	KmWlpolicy     *ebpf.Map `ebpf:"km_wlpolicy"`
	KmXdptailcall  *ebpf.Map `ebpf:"km_xdptailcall"`
	KmeshMap1600   *ebpf.Map `ebpf:"kmesh_map1600"`
	KmeshMap192    *ebpf.Map `ebpf:"kmesh_map192"`
	KmeshMap296    *ebpf.Map `ebpf:"kmesh_map296"`
	KmeshMap64     *ebpf.Map `ebpf:"kmesh_map64"`
}

KmAuth KmTuple, KmPerfInfo KmPerfMap are all very confusing

And some maps are not very easy to understand, like KmTcpinfo , KmDstinfo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers kind/enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants