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

xdp fails to attach dispatcher #184

Closed
gizahNL opened this issue Apr 4, 2022 · 6 comments
Closed

xdp fails to attach dispatcher #184

gizahNL opened this issue Apr 4, 2022 · 6 comments

Comments

@gizahNL
Copy link
Contributor

gizahNL commented Apr 4, 2022

And unfortunately doesn't fall back to single program mode.

libbpf: elf: skipping unrecognized data section(7) .xdp_run_config
libbpf: elf: skipping unrecognized data section(7) xdp_metadata
libbpf: prog 'xdp_dispatcher': BPF program load failed: Invalid argument
libbpf: prog 'xdp_dispatcher': -- BEGIN PROG LOAD LOG --
Validating prog0() func#1...
btf_vmlinux is malformed
Arg#0 type PTR in prog0() is not supported yet.
processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0
-- END PROG LOAD LOG --
libbpf: failed to load program 'xdp_dispatcher'
libbpf: failed to load object './xdp-dispatcher.o'
libxdp: Failed to load dispatcher: Invalid argument

Kernel version is: 5.10.109

@tohojo
Copy link
Member

tohojo commented Apr 4, 2022 via email

@gizahNL
Copy link
Contributor Author

gizahNL commented Apr 4, 2022

Gijs Peskens @.***> writes:
And unfortunately doesn't fall back to single program mode. libbpf: elf: skipping unrecognized data section(7) .xdp_run_config libbpf: elf: skipping unrecognized data section(7) xdp_metadata libbpf: prog 'xdp_dispatcher': BPF program load failed: Invalid argument libbpf: prog 'xdp_dispatcher': -- BEGIN PROG LOAD LOG -- Validating prog0() func#1... btf_vmlinux is malformed Arg#0 type PTR in prog0() is not supported yet. processed 0 insns (limit 1000000) max_states_per_insn 0 total_states 0 peak_states 0 mark_read 0 -- END PROG LOAD LOG -- libbpf: failed to load program 'xdp_dispatcher' libbpf: failed to load object './xdp-dispatcher.o' libxdp: Failed to load dispatcher: Invalid argument
What kernel version are you running this on?

Sorry, ninja edited before you replied.. Kernel is 5.10.109

@tohojo
Copy link
Member

tohojo commented Apr 4, 2022 via email

@gizahNL
Copy link
Contributor Author

gizahNL commented Apr 4, 2022

Yes it's compiled part of a custom video broadcast based distribution.

Arg#0 type PTR in prog0() is not supported yet.

I believe that's the cause btw. With the patch I submitted via the PR it is successful in attaching both the default XDP sock program and our custom program.

@tohojo
Copy link
Member

tohojo commented Apr 4, 2022

Ah, the fallback fails because libbpf is once again changing things in a non-backwards-compatible manner; see 2eda2145ebfc ("libbpf: Preserve kernel error code and remove kprobe prog type guessing"). So the check we have to detect the verifier error fails...

@gizahNL
Copy link
Contributor Author

gizahNL commented Apr 4, 2022

Ah, the fallback fails because libbpf is once again changing things in a non-backwards-compatible manner; see 2eda2145ebfc ("libbpf: Preserve kernel error code and remove kprobe prog type guessing"). So the check we have to detect the verifier error fails...

Oh joy... If the kernel verifier can throw more errors than the one I checked against than my patch might not be sufficient :/

tohojo added a commit that referenced this issue Apr 5, 2022
Fix fallback on kernel load error (#184)
@gizahNL gizahNL closed this as completed Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants