@@ -219,10 +219,7 @@ static void test_tailcall_2(void)
219
219
bpf_object__close (obj );
220
220
}
221
221
222
- /* test_tailcall_3 checks that the count value of the tail call limit
223
- * enforcement matches with expectations.
224
- */
225
- static void test_tailcall_3 (void )
222
+ static void test_tailcall_count (const char * which )
226
223
{
227
224
int err , map_fd , prog_fd , main_fd , data_fd , i , val ;
228
225
struct bpf_map * prog_array , * data_map ;
@@ -231,7 +228,7 @@ static void test_tailcall_3(void)
231
228
__u32 retval , duration ;
232
229
char buff [128 ] = {};
233
230
234
- err = bpf_prog_load ("tailcall3.o" , BPF_PROG_TYPE_SCHED_CLS , & obj ,
231
+ err = bpf_prog_load (which , BPF_PROG_TYPE_SCHED_CLS , & obj ,
235
232
& prog_fd );
236
233
if (CHECK_FAIL (err ))
237
234
return ;
@@ -296,6 +293,22 @@ static void test_tailcall_3(void)
296
293
bpf_object__close (obj );
297
294
}
298
295
296
+ /* test_tailcall_3 checks that the count value of the tail call limit
297
+ * enforcement matches with expectations. JIT uses direct jump.
298
+ */
299
+ static void test_tailcall_3 (void )
300
+ {
301
+ test_tailcall_count ("tailcall3.o" );
302
+ }
303
+
304
+ /* test_tailcall_6 checks that the count value of the tail call limit
305
+ * enforcement matches with expectations. JIT uses indirect jump.
306
+ */
307
+ static void test_tailcall_6 (void )
308
+ {
309
+ test_tailcall_count ("tailcall6.o" );
310
+ }
311
+
299
312
/* test_tailcall_4 checks that the kernel properly selects indirect jump
300
313
* for the case where the key is not known. Latter is passed via global
301
314
* data to select different targets we can compare return value of.
@@ -822,6 +835,8 @@ void test_tailcalls(void)
822
835
test_tailcall_4 ();
823
836
if (test__start_subtest ("tailcall_5" ))
824
837
test_tailcall_5 ();
838
+ if (test__start_subtest ("tailcall_6" ))
839
+ test_tailcall_6 ();
825
840
if (test__start_subtest ("tailcall_bpf2bpf_1" ))
826
841
test_tailcall_bpf2bpf_1 ();
827
842
if (test__start_subtest ("tailcall_bpf2bpf_2" ))
0 commit comments