Closed H0mTanks closed 1 month ago
@shpalani - please update documentation as needed to use xdp-test instead of xdp. And add a link to the xdp-for-windows project + msi.
Thanks for the detailed steps. The problem is the user is not using the xdp-for-windows release package for the program type 'xdp'. Hence the xdp program failed to load and attach. ebpf-for-windows repo has replaced its support of xdp functionality with the xdp-for-windows extension.
Please use xdp-for-windows msi, instead of ebpf-for-windows's netebpfext xdp test extension xdp_test.
Download the latest xdp-for-windows release: https://github.com/microsoft/xdp-for-windows/releases/tag/v1.1.0%2Bbed474a Note: Certificate is in bin_Release_x64\amd64fre\xdp.cer
Instructions: (in a nutshell)
Note: Please use the above latest version packages (ebpf-for-windows v0.18.0, xdp-for-windows v1.1.0%2Bbed474a ) stated to avoid a mismatch of versions (as some releases do not have backward compatibility in between them)
After the installations, Please check the program type for 'xdp' (and not xdp_test) Sample:
netsh ebpf add program xdp_driver.o interface=\<pick an interface ifindex> netsh ebpf show programs
ID Pins Links Mode Type Name
====== ==== ===== ========= ============= ====================
65568 1 1 JIT xdp xdp_driver
Note: XDP programs attach to the XDP hooks for an interface. Please make sure to attach the program to the appropriate active interface. Use get-netadapter
to get the ifindex.
Usage: netsh ebpf add program
[filename=]<string>
[[type=]<string>]
[[pinpath=]<string>]
[[interface=]<string>]
[[pinned=]none|first|all]
[[execution=]jit|interpret]
[[compartment=]<integer>
Information: https://github.com/microsoft/ebpf-for-windows/blob/main/docs/GettingStarted.md
If you still want to use the non-recommended program type 'xdp_test' test extension (no support) from ebpf-for-windows msi, then you need to specify the type with xdp_test:
netsh ebpf add program xdp_driver.o xdp_test
I will update the documentation as needed.
Describe the bug
Possible duplicate of #2627.
Hello there, I'm trying to load a simple xdp program compiled with:
clang -I ..\..\..\ebpf-for-windows\x64\Debug\undocked\ebpf-for-windows\build\native\include -target bpf -Werror -O2 xdp_driver.c -o xdp_driver.o
Program load fails with:
Etl trace: (I can see that the attach guid is all zeros)
In accordance with the TSG, I've restarted
ebpfcore
,ebpfsvc
,netebpfext
. Same issue.I also tried to load the program myself with
bpf_object__load()
, Same issue with same traces.Please let me know if there are any further debugging steps I can take.
OS information
Edition Windows 11 Enterprise Evaluation Version 22H2 Installed on 7/28/2024 OS build 22621.3880 Experience Windows Feature Experience Pack 1000.22700.1020.0
Steps taken to reproduce bug
clang -I <include_dir> -target bpf -Werror -O2 xdp_driver.c -o xdp_driver.o
xdp_driver.o
to target vmnetsh ebpf add program xdp_driver.o
Expected behavior
The program load should succeed.
Actual outcome
Program load fails with attach guid:
00000000-0000-0000-0000-000000000000
in traces.Additional details
No response