Use shared umem in CentOS 8.2(4.18.0-193.el8.x86_64)

Harold Huang <[email protected]>
Newsgroups org.kernel.vger.xdp-newbies
Message-ID <CAHJXk3b1Hj9Xp_v0gEXf6TB56-P7T=jVQ9_mzTVwhUFSKVJjOg@mail.gmail.com>
Hi, all
   I see in libbpf 0.3 or higher version, xsk_socket__create_shared
function is added to support shared umem. I also want to use shared
umem in CentOS 8.2 with a native kernel 4.18.0-193.el8.x86_64.  I have
updated libbpf to v0.4.0, but the samples/bpf/xsk_fwd is existed with
an exception:

libbpf: can't get next link: Invalid argument

The function is existed in bpf_obj_get_next_id where it calls sys_bpf.
The gdb trace is showed as followed:

#0  bpf_obj_get_next_id (start_id=0, next_id=0x7fffffffddc8, cmd=31)
at bpf.c:806
#1  0x0000000000421b4d in bpf_link_get_next_id (start_id=0,
next_id=0x7fffffffddc8) at bpf.c:830
#2  0x000000000042e393 in xsk_link_lookup (ifindex=1, prog_id=0x0,
link_fd=0x7fffffffde1c) at xsk.c:685
#3  0x000000000042e602 in xsk_probe_bpf_link () at xsk.c:740
#4  0x000000000042f0a9 in xsk_socket__create_shared (xsk_ptr=0x724838,
ifname=0x7fffffffe4e0 "peer0", queue_id=0, umem=0x7242d0,
    rx=0x724778, tx=0x7247a8, fill=0x7247d8, comp=0x724808,
usr_config=0x650720 <port_params>) at xsk.c:1075
#5  0x0000000000403831 in port_init (params=0x650720 <port_params>) at
samples/bpf/xsk_fwd.c:499
#6  0x00000000004047c0 in main (argc=11, argv=0x7fffffffe1b8) at
samples/bpf/xsk_fwd.c:1012

Is there any way to support shared umem if I only updated the libbpf
with a native kernel version 4.18.0-193.el8.x86_64 in CentOS 8.2?

Thanks
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.