Skip to content
Snippets Groups Projects
Commit 5750902a authored by Björn Töpel's avatar Björn Töpel Committed by Alexei Starovoitov
Browse files

libbpf: proper XSKMAP cleanup


The bpf_map_update_elem() function, when used on an XSKMAP, will fail
if not a valid AF_XDP socket is passed as value. Therefore, this is
function cannot be used to clear the XSKMAP. Instead, the
bpf_map_delete_elem() function should be used for that.

This patch also simplifies the code by breaking up
xsk_update_bpf_maps() into three smaller functions.

Reported-by: default avatarWilliam Tu <u9012063@gmail.com>
Fixes: 1cad0788 ("libbpf: add support for using AF_XDP sockets")
Signed-off-by: default avatarBjörn Töpel <bjorn.topel@intel.com>
Tested-by: default avatarWilliam Tu <u9012063@gmail.com>
Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 0e6741f0
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment