Skip to content

Commit dc6a048

Browse files
iii-igregkh
authored andcommitted
selftests/bpf: Fix xdp_do_redirect on s390x
[ Upstream commit 06c1865 ] 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 <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]> Stable-dep-of: 6c20822 ("bpf, test_run: fix &xdp_frame misplacement for LIVE_FRAMES") Signed-off-by: Sasha Levin <[email protected]>
1 parent 5d447e0 commit dc6a048

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ static int attach_tc_prog(struct bpf_tc_hook *hook, int fd)
6565
/* The maximum permissible size is: PAGE_SIZE - sizeof(struct xdp_page_head) -
6666
* sizeof(struct skb_shared_info) - XDP_PACKET_HEADROOM = 3368 bytes
6767
*/
68+
#if defined(__s390x__)
69+
#define MAX_PKT_SIZE 3176
70+
#else
6871
#define MAX_PKT_SIZE 3368
72+
#endif
6973
static void test_max_pkt_size(int fd)
7074
{
7175
char data[MAX_PKT_SIZE + 1] = {};

0 commit comments

Comments
 (0)