From: Geliang Tang Date: Thu, 23 May 2024 06:50:04 +0000 (+0800) Subject: selftests/bpf: Drop duplicate bpf_map_lookup_elem in test_sockmap X-Git-Tag: microblaze-v6.13~667^2~222^2~16 X-Git-Url: http://git.monstr.eu/?a=commitdiff_plain;h=49784c7979321c49a8055f5c588d24c34a8c55fc;p=linux-2.6-microblaze.git selftests/bpf: Drop duplicate bpf_map_lookup_elem in test_sockmap bpf_map_lookup_elem is invoked in bpf_prog3() already, no need to invoke it again. This patch drops it. Signed-off-by: Geliang Tang Signed-off-by: Daniel Borkmann Tested-by: Jakub Sitnicki Acked-by: John Fastabend Link: https://lore.kernel.org/bpf/ea8458462b876ee445173e3effb535fd126137ed.1716446893.git.tanggeliang@kylinos.cn --- diff --git a/tools/testing/selftests/bpf/progs/test_sockmap_kern.h b/tools/testing/selftests/bpf/progs/test_sockmap_kern.h index 3dff0813730b..f48f85f1bd70 100644 --- a/tools/testing/selftests/bpf/progs/test_sockmap_kern.h +++ b/tools/testing/selftests/bpf/progs/test_sockmap_kern.h @@ -177,9 +177,6 @@ int bpf_prog3(struct __sk_buff *skb) return bpf_sk_redirect_hash(skb, &tls_sock_map, &ret, flags); #endif } - f = bpf_map_lookup_elem(&sock_skb_opts, &one); - if (f && *f) - ret = SK_DROP; err = bpf_skb_adjust_room(skb, 4, 0, 0); if (err) return SK_DROP;