Skip to contentSkip to conversation

Error running AF_XDP sample application

DISCUSSION kdjimeli 3 participants 6 messages Aug 9, 2018 – Aug 10, 2018

Subsystems (2)
lore
Share & tools
lore

kdjimeli

author
#0 lore raw

Hello,

I have been trying to test a sample AF_XDP program, but I have been experiencing some issues.
After building the sample code
https://github.com/torvalds/linux/tree/master/samples/bpf,
when running the xdpsock binary, I get the errors "libbpf: failed to create map (name: 'xsks_map'): Invalid argument" "libbpf: failed to load object './xdpsock_kern.o"

I tried to figure out the cause of the error but all I know is that it occurs at line 910 with the function
call "bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)".

Please I would like to inquire what could be a possible for this error.

Thanks
Konrad

#1 lore raw
Quoted 10 lines · kdjimeli

Hello,

I have been trying to test a sample AF_XDP program, but I have been experiencing some issues.
After building the sample code
https://github.com/torvalds/linux/tree/master/samples/bpf,
when running the xdpsock binary, I get the errors "libbpf: failed to create map (name: 'xsks_map'): Invalid argument" "libbpf: failed to load object './xdpsock_kern.o"

Quoted 5 lines

I tried to figure out the cause of the error but all I know is that it occurs at line 910 with the function
call "bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)".

Please I would like to inquire what could be a possible for this error.

which kernel version are you running?

#2 lore raw
Quoted 11 lines · Jakub Kicinski
Quoted 10 lines · kdjimeli

Hello,

I have been trying to test a sample AF_XDP program, but I have been experiencing some issues.
After building the sample code
https://github.com/torvalds/linux/tree/master/samples/bpf,
when running the xdpsock binary, I get the errors "libbpf: failed to create map (name: 'xsks_map'): Invalid argument" "libbpf: failed to load object './xdpsock_kern.o"

Quoted 7 lines
Quoted 5 lines

I tried to figure out the cause of the error but all I know is that it occurs at line 910 with the function
call "bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)".

Please I would like to inquire what could be a possible for this error.

which kernel version are you running?

My kernel version is 4.18.0-rc8+. I cloned it from
https://github.com/torvalds/linux before building a running.

My commit head(git show-ref --head) is at 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/heads/master 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/master
...

I also applied the patch https://patchwork.ozlabs.org/patch/949884/
(samples: bpf: convert xdpsock_user.c to libbpf ), as the error was initially in the form show below:
"failed to create a map: 22 Invalid argument"
"ERROR: load_bpf_file"

Thanks
Konrad

#3 lore raw
Quoted 31 lines · Konrad Djimeli
Quoted 11 lines · Jakub Kicinski
Quoted 10 lines · kdjimeli

Hello,

I have been trying to test a sample AF_XDP program, but I have been experiencing some issues.
After building the sample code
https://github.com/torvalds/linux/tree/master/samples/bpf,
when running the xdpsock binary, I get the errors "libbpf: failed to create map (name: 'xsks_map'): Invalid argument" "libbpf: failed to load object './xdpsock_kern.o"

Quoted 7 lines
Quoted 5 lines

I tried to figure out the cause of the error but all I know is that it occurs at line 910 with the function
call "bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)".

Please I would like to inquire what could be a possible for this error.

which kernel version are you running?

My kernel version is 4.18.0-rc8+. I cloned it from
https://github.com/torvalds/linux before building a running.

My commit head(git show-ref --head) is at 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/heads/master 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/master
...

Quoted 8 lines

I also applied the patch https://patchwork.ozlabs.org/patch/949884/
(samples: bpf: convert xdpsock_user.c to libbpf ), as the error was initially in the form show below:
"failed to create a map: 22 Invalid argument"
"ERROR: load_bpf_file"

Thanks
Konrad

Also other sample applications that make use of other bpf maps, such as BPF_MAP_TYPE_CPUMAP in xdp_redirect_cpu work fine. But the application with BPF_MAP_TYPE_XSKMAP fails producing the error mentioned above.

Thanks
Konrad

#4 lore raw

Den fre 10 aug. 2018 kl 15:23 skrev Konrad Djimeli <[email protected]>:

Quoted 42 lines · Konrad Djimeli
Quoted 31 lines · Jakub Kicinski
Quoted 11 lines · kdjimeli
Quoted 10 lines

Hello,

I have been trying to test a sample AF_XDP program, but I have been experiencing some issues.
After building the sample code
https://github.com/torvalds/linux/tree/master/samples/bpf,
when running the xdpsock binary, I get the errors "libbpf: failed to create map (name: 'xsks_map'): Invalid argument" "libbpf: failed to load object './xdpsock_kern.o"

Quoted 7 lines
Quoted 5 lines

I tried to figure out the cause of the error but all I know is that it occurs at line 910 with the function
call "bpf_prog_load_xattr(&prog_load_attr, &obj, &prog_fd)".

Please I would like to inquire what could be a possible for this error.

which kernel version are you running?

My kernel version is 4.18.0-rc8+. I cloned it from
https://github.com/torvalds/linux before building a running.

My commit head(git show-ref --head) is at 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/heads/master 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/HEAD 1236568ee3cbb0d3ac62d0074a29b97ecf34cbbc refs/remotes/origin/master
...

Quoted 8 lines

I also applied the patch https://patchwork.ozlabs.org/patch/949884/
(samples: bpf: convert xdpsock_user.c to libbpf ), as the error was initially in the form show below:
"failed to create a map: 22 Invalid argument"
"ERROR: load_bpf_file"

Thanks
Konrad

Quoted 6 lines

Also other sample applications that make use of other bpf maps, such as BPF_MAP_TYPE_CPUMAP in xdp_redirect_cpu work fine. But the application with BPF_MAP_TYPE_XSKMAP fails producing the error mentioned above.

Thanks
Konrad

Thanks for taking AF_XDP for a spin!

Before I start digging into details; Do you have CONFIG_XDP_SOCKETS=y in your config? :-)

Björn

#5 lore raw
Quoted 2 lines · Björn Töpel

Thanks for taking AF_XDP for a spin!

Thanks, I am actually an Igalia Coding Experience participant working remotely from Cameroon in Africa and I am working on making use of AF_XDP within Snabb. I am currently trying to familiarize myself with XDP and AF_XDP, I also hope to make contributions to the development/implementation of AF_XDP.

Quoted 3 lines

Before I start digging into details; Do you have CONFIG_XDP_SOCKETS=y in your config? :-)

Yay!, setting CONFIG_XDP_SOCKETS=y in my config resolved every issue, and it now works fine.

Quoted 2 lines

Björn

Konrad