Assistance needed with TCP BBR to BPF Conversion Issue

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear BPF community,

I am a student currently trying to use the BPF interface in the TCP congestion control study for faster Linux system integration without compiling the entire kernel. 

I've encountered a challenge while attempting to convert TCP BBR to BPF format and would greatly appreciate your guidance.

My modifications to the original tcp_bbr is as follow:
* change u8,u32,u64,etc to __u8, __u32, __u64, etc.
* Defined external kernel functions
* Removed compiler flags using macro (e.g., "unlikely", "READ_ONCE")
* Borrowed some time definitions from bpf_cubic (e.g., HZ and JIFFY)
* Defined constant values not included in vmlinux.h (e.g., "TCP_INFINITE_SSTHRESH")
* Implemented do_div() and cmpxchg() from assembly to C
* Changed min_t() macro to min()
This is the link to my modified tcp_bbr file https://github.com/zmrui/bbr-bpf/blob/main/tcp_bbr.c

I use "clang -O2 -target bpf -c -g bpf_cubic.c" command to compile and it doesn't output any warning or error,
and the "sudo bpftool struct_ops register tcp_bbr.o" command does not have any output

Then the "bpftool -debug" option displays the following debug message at the last line:
"libbpf: sec '.rodata': failed to determine size from ELF: size 0, err -2"
Additionally, the new algorithm doesn't appear in "net.ipv4.tcp_available_congestion_control" or in "bpftool struct_ops list".

I did not find much related content for this debug error message on the Internet.
I would be very grateful for any suggestions or insights you might have regarding this issue. 
Thank you in advance for your time and expertise.

For context, here's my system information:
Ubuntu 22.04
6.5.0-41-generic
$ bpftool -V
	bpftool v7.3.0
	using libbpf v1.3
	features: llvm, skeletons
-$ clang -v
	-Ubuntu clang version 14.0.0-1ubuntu1.1

Best,
Mingrui





[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux