Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests/bpf: Fix xdp_do_redirect on s390x

s390x cache line size is 256 bytes, so skb_shared_info must be aligned
on a much larger boundary than for x86. This makes the maximum packet
size smaller.

Signed-off-by: Ilya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230128000650.1516334-11-iii@linux.ibm.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Ilya Leoshkevich and committed by
Alexei Starovoitov
06c1865b 56e1a504

+4
+4
tools/testing/selftests/bpf/prog_tests/xdp_do_redirect.c
··· 65 65 /* The maximum permissible size is: PAGE_SIZE - sizeof(struct xdp_page_head) - 66 66 * sizeof(struct skb_shared_info) - XDP_PACKET_HEADROOM = 3368 bytes 67 67 */ 68 + #if defined(__s390x__) 69 + #define MAX_PKT_SIZE 3176 70 + #else 68 71 #define MAX_PKT_SIZE 3368 72 + #endif 69 73 static void test_max_pkt_size(int fd) 70 74 { 71 75 char data[MAX_PKT_SIZE + 1] = {};