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

Configure Feed

Select the types of activity you want to include in your feed.

selftests/bpf: Fix xdp_pull_data failure with 64K page

If the argument 'pull_len' of run_test() is 'PULL_MAX' or
'PULL_MAX | PULL_PLUS_ONE', the eventual pull_len size
will close to the page size. On arm64 systems with 64K pages,
the pull_len size will be close to 64K. But the existing buffer
will be close to 9000 which is not enough to pull.

For those failed run_tests(), make buff size to
pg_sz + (pg_sz / 2)
This way, there will be enough buffer space to pull
regardless of page size.

Tested-by: Alan Maguire <alan.maguire@oracle.com>
Cc: Amery Hung <ameryhung@gmail.com>
Signed-off-by: Yonghong Song <yonghong.song@linux.dev>
Acked-by: Amery Hung <ameryhung@gmail.com>
Link: https://lore.kernel.org/r/20260123055128.495265-1-yonghong.song@linux.dev
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

authored by

Yonghong Song and committed by
Alexei Starovoitov
c7900f22 d8df8781

+9 -7
+9 -7
tools/testing/selftests/bpf/prog_tests/xdp_pull_data.c
··· 114 114 { 115 115 u32 pg_sz, max_meta_len, max_data_len; 116 116 struct test_xdp_pull_data *skel; 117 + int buff_len; 117 118 118 119 skel = test_xdp_pull_data__open_and_load(); 119 120 if (!ASSERT_OK_PTR(skel, "test_xdp_pull_data__open_and_load")) 120 121 return; 121 122 122 123 pg_sz = sysconf(_SC_PAGE_SIZE); 124 + buff_len = pg_sz + pg_sz / 2; 123 125 124 126 if (find_xdp_sizes(skel, pg_sz)) 125 127 goto out; ··· 142 140 run_test(skel, XDP_PASS, pg_sz, 9000, 0, 1025, 1025); 143 141 144 142 /* multi-buf pkt, empty linear data area, pull requires memmove */ 145 - run_test(skel, XDP_PASS, pg_sz, 9000, 0, 0, PULL_MAX); 143 + run_test(skel, XDP_PASS, pg_sz, buff_len, 0, 0, PULL_MAX); 146 144 147 145 /* multi-buf pkt, no headroom */ 148 - run_test(skel, XDP_PASS, pg_sz, 9000, max_meta_len, 1024, PULL_MAX); 146 + run_test(skel, XDP_PASS, pg_sz, buff_len, max_meta_len, 1024, PULL_MAX); 149 147 150 148 /* multi-buf pkt, no tailroom, pull requires memmove */ 151 - run_test(skel, XDP_PASS, pg_sz, 9000, 0, max_data_len, PULL_MAX); 149 + run_test(skel, XDP_PASS, pg_sz, buff_len, 0, max_data_len, PULL_MAX); 152 150 153 151 /* Test cases with invalid pull length */ 154 152 ··· 156 154 run_test(skel, XDP_DROP, pg_sz, 2048, 0, 2048, 2049); 157 155 158 156 /* multi-buf pkt with no space left in linear data area */ 159 - run_test(skel, XDP_DROP, pg_sz, 9000, max_meta_len, max_data_len, 157 + run_test(skel, XDP_DROP, pg_sz, buff_len, max_meta_len, max_data_len, 160 158 PULL_MAX | PULL_PLUS_ONE); 161 159 162 160 /* multi-buf pkt, empty linear data area */ 163 - run_test(skel, XDP_DROP, pg_sz, 9000, 0, 0, PULL_MAX | PULL_PLUS_ONE); 161 + run_test(skel, XDP_DROP, pg_sz, buff_len, 0, 0, PULL_MAX | PULL_PLUS_ONE); 164 162 165 163 /* multi-buf pkt, no headroom */ 166 - run_test(skel, XDP_DROP, pg_sz, 9000, max_meta_len, 1024, 164 + run_test(skel, XDP_DROP, pg_sz, buff_len, max_meta_len, 1024, 167 165 PULL_MAX | PULL_PLUS_ONE); 168 166 169 167 /* multi-buf pkt, no tailroom */ 170 - run_test(skel, XDP_DROP, pg_sz, 9000, 0, max_data_len, 168 + run_test(skel, XDP_DROP, pg_sz, buff_len, 0, max_data_len, 171 169 PULL_MAX | PULL_PLUS_ONE); 172 170 173 171 out: