Commit 06c1865b authored by Ilya Leoshkevich's avatar Ilya Leoshkevich Committed by Alexei Starovoitov

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: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Link: https://lore.kernel.org/r/20230128000650.1516334-11-iii@linux.ibm.comSigned-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 56e1a504
...@@ -65,7 +65,11 @@ static int attach_tc_prog(struct bpf_tc_hook *hook, int fd) ...@@ -65,7 +65,11 @@ static int attach_tc_prog(struct bpf_tc_hook *hook, int fd)
/* The maximum permissible size is: PAGE_SIZE - sizeof(struct xdp_page_head) - /* The maximum permissible size is: PAGE_SIZE - sizeof(struct xdp_page_head) -
* sizeof(struct skb_shared_info) - XDP_PACKET_HEADROOM = 3368 bytes * sizeof(struct skb_shared_info) - XDP_PACKET_HEADROOM = 3368 bytes
*/ */
#if defined(__s390x__)
#define MAX_PKT_SIZE 3176
#else
#define MAX_PKT_SIZE 3368 #define MAX_PKT_SIZE 3368
#endif
static void test_max_pkt_size(int fd) static void test_max_pkt_size(int fd)
{ {
char data[MAX_PKT_SIZE + 1] = {}; char data[MAX_PKT_SIZE + 1] = {};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment