aboutsummaryrefslogtreecommitdiffstats
path: root/tools/bpf/bpftool/prog.c
diff options
context:
space:
mode:
authorGerhard Engleder <[email protected]>2022-10-13 20:09:22 +0000
committerMartin KaFai Lau <[email protected]>2022-10-19 17:56:21 +0000
commit05ee658c654bacda03f7fecef367e62aaf8e1cfe (patch)
tree9809d8442a0399b1b1ddd60b22d90c15619121c3 /tools/bpf/bpftool/prog.c
parentnet: ethernet: adi: adin1110: Fix SPI transfers (diff)
downloadkernel-05ee658c654bacda03f7fecef367e62aaf8e1cfe.tar.gz
kernel-05ee658c654bacda03f7fecef367e62aaf8e1cfe.zip
samples/bpf: Fix map iteration in xdp1_user
BPF map iteration in xdp1_user results in endless loop without any output, because the return value of bpf_map_get_next_key() is checked against the wrong value. Other call locations of bpf_map_get_next_key() check for equal 0 for continuing the iteration. xdp1_user checks against unequal -1. This is wrong for a function which can return arbitrary negative errno values, because a return value of e.g. -2 results in an endless loop. With this fix xdp1_user is printing statistics again: proto 0: 1 pkt/s proto 0: 1 pkt/s proto 17: 107383 pkt/s proto 17: 881655 pkt/s proto 17: 882083 pkt/s proto 17: 881758 pkt/s Fixes: bd054102a8c7 ("libbpf: enforce strict libbpf 1.0 behaviors") Signed-off-by: Gerhard Engleder <[email protected]> Acked-by: Song Liu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Martin KaFai Lau <[email protected]>
Diffstat (limited to 'tools/bpf/bpftool/prog.c')
0 files changed, 0 insertions, 0 deletions