summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/bpf/netcnt_common.h
diff options
context:
space:
mode:
authorIlya Leoshkevich <iii@linux.ibm.com>2023-01-28 01:06:32 +0100
committerAlexei Starovoitov <ast@kernel.org>2023-01-28 21:30:08 +0100
commit80a611904eef65e8c60e0c8c8f50fa98a0bd0c69 (patch)
treee4079c5703566db1a6e88ab5912a90cea4e38e97 /tools/testing/selftests/bpf/netcnt_common.h
parentselftests/bpf: Check stack_mprotect() return value (diff)
downloadlinux-80a611904eef65e8c60e0c8c8f50fa98a0bd0c69.tar.xz
linux-80a611904eef65e8c60e0c8c8f50fa98a0bd0c69.zip
selftests/bpf: Increase SIZEOF_BPF_LOCAL_STORAGE_ELEM on s390x
sizeof(struct bpf_local_storage_elem) is 512 on s390x: struct bpf_local_storage_elem { struct hlist_node map_node; /* 0 16 */ struct hlist_node snode; /* 16 16 */ struct bpf_local_storage * local_storage; /* 32 8 */ struct callback_head rcu __attribute__((__aligned__(8))); /* 40 16 */ /* XXX 200 bytes hole, try to pack */ /* --- cacheline 1 boundary (256 bytes) --- */ struct bpf_local_storage_data sdata __attribute__((__aligned__(256))); /* 256 8 */ /* size: 512, cachelines: 2, members: 5 */ /* sum members: 64, holes: 1, sum holes: 200 */ /* padding: 248 */ /* forced alignments: 2, forced holes: 1, sum forced holes: 200 */ } __attribute__((__aligned__(256))); As the existing comment suggests, use a larger number in order to be future-proof. Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com> Link: https://lore.kernel.org/r/20230128000650.1516334-14-iii@linux.ibm.com Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'tools/testing/selftests/bpf/netcnt_common.h')
-rw-r--r--tools/testing/selftests/bpf/netcnt_common.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/tools/testing/selftests/bpf/netcnt_common.h b/tools/testing/selftests/bpf/netcnt_common.h
index 0ab1c88041cd..2d4a58e4e39c 100644
--- a/tools/testing/selftests/bpf/netcnt_common.h
+++ b/tools/testing/selftests/bpf/netcnt_common.h
@@ -8,11 +8,11 @@
/* sizeof(struct bpf_local_storage_elem):
*
- * It really is about 128 bytes on x86_64, but allocate more to account for
- * possible layout changes, different architectures, etc.
+ * It is about 128 bytes on x86_64 and 512 bytes on s390x, but allocate more to
+ * account for possible layout changes, different architectures, etc.
* The kernel will wrap up to PAGE_SIZE internally anyway.
*/
-#define SIZEOF_BPF_LOCAL_STORAGE_ELEM 256
+#define SIZEOF_BPF_LOCAL_STORAGE_ELEM 768
/* Try to estimate kernel's BPF_LOCAL_STORAGE_MAX_VALUE_SIZE: */
#define BPF_LOCAL_STORAGE_MAX_VALUE_SIZE (0xFFFF - \