-
Notifications
You must be signed in to change notification settings - Fork 133
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
xsk_umem__create() return -22 #382
Comments
maybe it's related to my kernel configurations? Here are some information:
And:
|
Since you are not changing any of the default values, pass NULL as the configuration and see if that works. What is UMEM_SIZE in your program? |
UMEM_SIZE:
|
Look reasonable to me, so do not know what it is on the top of my head. Your best bet is to trace the function xdp_umem_reg() and see where it returns EINVAL. There are at least 8 checks that can give rise to this errno. |
Anyway, even passing NULL as config doesn't change anything. I have two questions:
|
xsk_umem__create() will eventually call the function xdp_umem_reg() and it has a lot of tests in it that can return EINVAL. Your questions: 1: It is not related to any bpf program. You can use xsk_umem__create() before any bpf program comes into play. 32-bit program could be the cause though. Have not tried. 2: Yes, since I do not know what you have done to the kernel :-). Have you tried running your program on an unmodified kernel in 64-bit mode? Just to verify that it works. |
Just a question. if we use Offloaded Mode (NIC Hardware) to run xdp directly on the NIC, we still need umem area? Since as i understood, umem is an area that will contain all packets received and the ones that are going to be sent. So for me it makes more sence to resrever this area when we are in: Native Mode (NIC Driver) or Generic Mode (Linux Network Stack). Correct me if i'm wrong. (I asked this, since i want to use offloaded mode and if there is no need for umem, i can skip this function call - currently i call |
You always need a umem if you are using AF_XDP sockets. If you are using XDP without AF_XDP sockets, then there is no need. I do not think you can redirect to an AF_XDP socket from a HW offloaded XDP program. Nothing that I have heard of being supported. Use a regular XDP program executed on the CPU if you want to use AF_XDP. |
I tried this one, no problem found.
Also i tested my 32bit application on a kernel with lots of customization. still didn't see any issue regarding to umem. The point is that i created a virtual interface in my linux machine and connect my xdp application to it. but in my main applicaiton, i connect directly to the physical NIC. maybe this cause the umem issue? Another doubt that i have is regarding to multi-thread application. my test application is a single thread(the last part of this tutorial: https://developers.redhat.com/blog/2021/04/01/get-started-with-xdp#task_4__load_xdp_objects_with_the_custom_loader) But my main program that i have umem error, is multi-thread. Can this be a problem? |
I have this function in my application:
xsk_umem__create()
always fails with error = -22. why? any idea?I use:
Debian bullseye(Kernel: 6.1.54)
The text was updated successfully, but these errors were encountered: