[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20200929123026.46751-1-toke@redhat.com>
Date: Tue, 29 Sep 2020 14:30:26 +0200
From: Toke Høiland-Jørgensen <toke@...hat.com>
To: daniel@...earbox.net, ast@...com
Cc: Toke Høiland-Jørgensen <toke@...hat.com>,
bpf@...r.kernel.org, netdev@...r.kernel.org,
Martin KaFai Lau <kafai@...com>
Subject: [PATCH bpf-next] selftests: Make sure all 'skel' variables are declared static
If programs in prog_tests using skeletons declare the 'skel' variable as
global but not static, that will lead to linker errors on the final link of
the prog_tests binary due to duplicate symbols. Fix a few instances of this.
Fixes: b18c1f0aa477 ("bpf: selftest: Adapt sock_fields test to use skel and global variables")
Fixes: 9a856cae2217 ("bpf: selftest: Add test_btf_skc_cls_ingress")
Signed-off-by: Toke Høiland-Jørgensen <toke@...hat.com>
---
tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c | 2 +-
tools/testing/selftests/bpf/prog_tests/sock_fields.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c b/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
index 4ce0e8a25bc5..86ccf37e26b3 100644
--- a/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
+++ b/tools/testing/selftests/bpf/prog_tests/btf_skc_cls_ingress.c
@@ -16,7 +16,7 @@
#include "test_progs.h"
#include "test_btf_skc_cls_ingress.skel.h"
-struct test_btf_skc_cls_ingress *skel;
+static struct test_btf_skc_cls_ingress *skel;
struct sockaddr_in6 srv_sa6;
static __u32 duration;
diff --git a/tools/testing/selftests/bpf/prog_tests/sock_fields.c b/tools/testing/selftests/bpf/prog_tests/sock_fields.c
index 66e83b8fc69d..af87118e748e 100644
--- a/tools/testing/selftests/bpf/prog_tests/sock_fields.c
+++ b/tools/testing/selftests/bpf/prog_tests/sock_fields.c
@@ -36,7 +36,7 @@ struct bpf_spinlock_cnt {
static struct sockaddr_in6 srv_sa6, cli_sa6;
static int sk_pkt_out_cnt10_fd;
-struct test_sock_fields *skel;
+static struct test_sock_fields *skel;
static int sk_pkt_out_cnt_fd;
static __u64 parent_cg_id;
static __u64 child_cg_id;
--
2.28.0
Powered by blists - more mailing lists