samples/bpf: Xdp_redirect_cpu fix missing tracepoint attach
authorJesper Dangaard Brouer <brouer@redhat.com>
Fri, 20 Dec 2019 16:19:36 +0000 (17:19 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 11 Feb 2020 12:35:29 +0000 (04:35 -0800)
commitc0ada6ad3ec5f9c02d04f49ba9fc115732bfa0ae
treebae76fc8afb0d3506ca98560cbc8346d5465da1f
parenta69af866bd35272ac2caf62eba5704cd36dbd5d9
samples/bpf: Xdp_redirect_cpu fix missing tracepoint attach

commit f9e6bfdbaf0cf304d72c70a05d81acac01a04f48 upstream.

When sample xdp_redirect_cpu was converted to use libbpf, the
tracepoints used by this sample were not getting attached automatically
like with bpf_load.c. The BPF-maps was still getting loaded, thus
nobody notice that the tracepoints were not updating these maps.

This fix doesn't use the new skeleton code, as this bug was introduced
in v5.1 and stable might want to backport this. E.g. Red Hat QA uses
this sample as part of their testing.

Fixes: bbaf6029c49c ("samples/bpf: Convert XDP samples to libbpf usage")
Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/157685877642.26195.2798780195186786841.stgit@firesoul
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
samples/bpf/xdp_redirect_cpu_user.c