af_xdp: fix xdp socket create fail 74/37274/6
authorChen Yahui <goodluckwillcomesoon@gmail.com>
Wed, 28 Sep 2022 13:30:07 +0000 (21:30 +0800)
committerBeno�t Ganne <bganne@cisco.com>
Tue, 24 Jan 2023 08:53:26 +0000 (08:53 +0000)
commit7cbd3cc41916ececa97af0b3acbb50dee190d656
tree96e668aef6064c61f1f566632ea396b196641d25
parent139b2da5c533a84faca0ae1bf5b37c3185d9d4fb
af_xdp: fix xdp socket create fail

In libbpf code, xsk_socket__create will call xsk_link_lookup to get the
xdp_sock bpf prog. But xsk_link_lookup can't get any bpf prog. This will
cause Libbpf not to insert the fd into xsks_map and return ERROR.

The solution to this problem is to insert fd into xsks_map ourselves
instead of libbpf.

Type: fix
Change-Id: Ic5d279c6ddc02d67371262d6106a5b53b70e7913
Signed-off-by: Chen Yahui <goodluckwillcomesoon@gmail.com>
src/plugins/af_xdp/device.c