Skip to content

Commit e640bcd

Browse files
Abhishek Dubeymaddy-kerneldev
authored andcommitted
selftests/bpf: Enable private stack tests for powerpc64
With support of private stack, relevant tests must pass on powerpc64. #./test_progs -t struct_ops_private_stack #434/1 struct_ops_private_stack/private_stack:OK #434/2 struct_ops_private_stack/private_stack_fail:OK #434/3 struct_ops_private_stack/private_stack_recur:OK #434 struct_ops_private_stack:OK Summary: 1/3 PASSED, 0 SKIPPED, 0 FAILED Signed-off-by: Abhishek Dubey <adubey@linux.ibm.com> Tested-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com> Reviewed-by: Hari Bathini <hbathini@linux.ibm.com> Signed-off-by: Madhavan Srinivasan <maddy@linux.ibm.com> Link: https://patch.msgid.link/20260401103215.104438-2-adubey@linux.ibm.com
1 parent 156d985 commit e640bcd

4 files changed

Lines changed: 13 additions & 35 deletions

File tree

tools/testing/selftests/bpf/prog_tests/struct_ops_private_stack.c

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#include "struct_ops_private_stack_fail.skel.h"
66
#include "struct_ops_private_stack_recur.skel.h"
77

8+
#if defined(__x86_64__) || defined(__aarch64__) || defined(__powerpc64__)
89
static void test_private_stack(void)
910
{
1011
struct struct_ops_private_stack *skel;
@@ -15,11 +16,6 @@ static void test_private_stack(void)
1516
if (!ASSERT_OK_PTR(skel, "struct_ops_private_stack__open"))
1617
return;
1718

18-
if (skel->data->skip) {
19-
test__skip();
20-
goto cleanup;
21-
}
22-
2319
err = struct_ops_private_stack__load(skel);
2420
if (!ASSERT_OK(err, "struct_ops_private_stack__load"))
2521
goto cleanup;
@@ -48,15 +44,9 @@ static void test_private_stack_fail(void)
4844
if (!ASSERT_OK_PTR(skel, "struct_ops_private_stack_fail__open"))
4945
return;
5046

51-
if (skel->data->skip) {
52-
test__skip();
53-
goto cleanup;
54-
}
55-
5647
err = struct_ops_private_stack_fail__load(skel);
5748
ASSERT_ERR(err, "struct_ops_private_stack_fail__load");
5849

59-
cleanup:
6050
struct_ops_private_stack_fail__destroy(skel);
6151
}
6252

@@ -70,11 +60,6 @@ static void test_private_stack_recur(void)
7060
if (!ASSERT_OK_PTR(skel, "struct_ops_private_stack_recur__open"))
7161
return;
7262

73-
if (skel->data->skip) {
74-
test__skip();
75-
goto cleanup;
76-
}
77-
7863
err = struct_ops_private_stack_recur__load(skel);
7964
if (!ASSERT_OK(err, "struct_ops_private_stack_recur__load"))
8065
goto cleanup;
@@ -93,7 +78,7 @@ static void test_private_stack_recur(void)
9378
struct_ops_private_stack_recur__destroy(skel);
9479
}
9580

96-
void test_struct_ops_private_stack(void)
81+
static void __test_struct_ops_private_stack(void)
9782
{
9883
if (test__start_subtest("private_stack"))
9984
test_private_stack();
@@ -102,3 +87,14 @@ void test_struct_ops_private_stack(void)
10287
if (test__start_subtest("private_stack_recur"))
10388
test_private_stack_recur();
10489
}
90+
#else
91+
static void __test_struct_ops_private_stack(void)
92+
{
93+
test__skip();
94+
}
95+
#endif
96+
97+
void test_struct_ops_private_stack(void)
98+
{
99+
__test_struct_ops_private_stack();
100+
}

tools/testing/selftests/bpf/progs/struct_ops_private_stack.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77

88
char _license[] SEC("license") = "GPL";
99

10-
#if defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)
11-
bool skip __attribute((__section__(".data"))) = false;
12-
#else
13-
bool skip = true;
14-
#endif
15-
1610
void bpf_testmod_ops3_call_test_2(void) __ksym;
1711

1812
int val_i, val_j;

tools/testing/selftests/bpf/progs/struct_ops_private_stack_fail.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77

88
char _license[] SEC("license") = "GPL";
99

10-
#if defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)
11-
bool skip __attribute((__section__(".data"))) = false;
12-
#else
13-
bool skip = true;
14-
#endif
15-
1610
void bpf_testmod_ops3_call_test_2(void) __ksym;
1711

1812
int val_i, val_j;

tools/testing/selftests/bpf/progs/struct_ops_private_stack_recur.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,6 @@
77

88
char _license[] SEC("license") = "GPL";
99

10-
#if defined(__TARGET_ARCH_x86) || defined(__TARGET_ARCH_arm64)
11-
bool skip __attribute((__section__(".data"))) = false;
12-
#else
13-
bool skip = true;
14-
#endif
15-
1610
void bpf_testmod_ops3_call_test_1(void) __ksym;
1711

1812
int val_i, val_j;

0 commit comments

Comments
 (0)