linux/tools/testing/selftests/bpf/progs
Yonghong Song 9eca508375 tools/bpf: selftests: add map lookup to test_map_in_map bpf prog
The bpf_map_lookup_elem is added in the bpf program.
Without previous patch, the test change will trigger the
following error:
  $ ./test_maps
  ...
  ; value_p = bpf_map_lookup_elem(map, &key);
  20: (bf) r1 = r7
  21: (bf) r2 = r8
  22: (85) call bpf_map_lookup_elem#1
  ; if (!value_p || *value_p != 123)
  23: (15) if r0 == 0x0 goto pc+16
   R0=map_value(id=2,off=0,ks=4,vs=4,imm=0) R6=inv1 R7=map_ptr(id=0,off=0,ks=4,vs=4,imm=0)
   R8=fp-8,call_-1 R10=fp0,call_-1 fp-8=mmmmmmmm
  ; if (!value_p || *value_p != 123)
  24: (61) r1 = *(u32 *)(r0 +0)
   R0=map_value(id=2,off=0,ks=4,vs=4,imm=0) R6=inv1 R7=map_ptr(id=0,off=0,ks=4,vs=4,imm=0)
   R8=fp-8,call_-1 R10=fp0,call_-1 fp-8=mmmmmmmm
  bpf_spin_lock cannot be accessed directly by load/store

With the kernel fix in the previous commit, the error goes away.

Signed-off-by: Yonghong Song <yhs@fb.com>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2019-02-27 17:03:13 -08:00
..
bpf_flow.c
connect4_prog.c
connect6_prog.c
dev_cgroup.c
get_cgroup_id_kern.c
netcnt_prog.c
sample_map_ret0.c
sample_ret0.c
sendmsg4_prog.c
sendmsg6_prog.c
socket_cookie_prog.c
sockmap_parse_prog.c
sockmap_tcp_msg_prog.c
sockmap_verdict_prog.c
test_adjust_tail.c
test_btf_haskv.c
test_btf_nokv.c
test_get_stack_rawtp.c
test_l4lb_noinline.c
test_l4lb.c
test_lirc_mode2_kern.c
test_lwt_ip_encap.c
test_lwt_seg6local.c
test_map_in_map.c tools/bpf: selftests: add map lookup to test_map_in_map bpf prog 2019-02-27 17:03:13 -08:00
test_map_lock.c
test_obj_id.c
test_pkt_access.c
test_pkt_md_access.c
test_queue_map.c
test_select_reuseport_kern.c
test_sk_lookup_kern.c
test_skb_cgroup_id_kern.c
test_sock_fields_kern.c
test_sockhash_kern.c
test_sockmap_kern.c
test_spin_lock.c
test_stack_map.c
test_stacktrace_build_id.c
test_stacktrace_map.c
test_tcp_estats.c
test_tcpbpf_kern.c
test_tcpnotify_kern.c
test_tracepoint.c
test_tunnel_kern.c
test_xdp_meta.c
test_xdp_noinline.c
test_xdp_redirect.c
test_xdp_vlan.c
test_xdp.c
xdp_dummy.c