summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c')
-rw-r--r--tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c b/tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
index 21bb7da90ea5..0efafa927a3d 100644
--- a/tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
+++ b/tools/testing/selftests/bpf/progs/test_ringbuf_map_key.c
@@ -35,7 +35,7 @@ SEC("fentry/" SYS_PREFIX "sys_getpgid")
int test_ringbuf_mem_map_key(void *ctx)
{
int cur_pid = bpf_get_current_pid_tgid() >> 32;
- struct sample *sample, sample_copy;
+ struct sample *sample;
int *lookup_val;
if (cur_pid != pid)
@@ -55,16 +55,11 @@ int test_ringbuf_mem_map_key(void *ctx)
lookup_val = (int *)bpf_map_lookup_elem(&hash_map, sample);
__sink(lookup_val);
- /* workaround - memcpy is necessary so that verifier doesn't
- * complain with:
- * verifier internal error: more than one arg with ref_obj_id R3
- * when trying to do bpf_map_update_elem(&hash_map, sample, &sample->seq, BPF_ANY);
- *
+ /*
* Since bpf_map_lookup_elem above uses 'sample' as key, test using
* sample field as value below
*/
- __builtin_memcpy(&sample_copy, sample, sizeof(struct sample));
- bpf_map_update_elem(&hash_map, &sample_copy, &sample->seq, BPF_ANY);
+ bpf_map_update_elem(&hash_map, sample, &sample->seq, BPF_ANY);
bpf_ringbuf_submit(sample, 0);
return 0;