Skip to content

Commit 3203c90

Browse files
ksacilottoborkmann
authored andcommitted
test_bpf: flag tests that cannot be jited on s390
Flag with FLAG_EXPECTED_FAIL the BPF_MAXINSNS tests that cannot be jited on s390 because they exceed BPF_SIZE_MAX and fail when CONFIG_BPF_JIT_ALWAYS_ON is set. Also set .expected_errcode to -ENOTSUPP so the tests pass in that case. Signed-off-by: Kleber Sacilotto de Souza <kleber.souza@canonical.com> Acked-by: Song Liu <songliubraving@fb.com> Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
1 parent dd349c3 commit 3203c90

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

lib/test_bpf.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5282,21 +5282,31 @@ static struct bpf_test tests[] = {
52825282
{ /* Mainly checking JIT here. */
52835283
"BPF_MAXINSNS: Ctx heavy transformations",
52845284
{ },
5285+
#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5286+
CLASSIC | FLAG_EXPECTED_FAIL,
5287+
#else
52855288
CLASSIC,
5289+
#endif
52865290
{ },
52875291
{
52885292
{ 1, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) },
52895293
{ 10, !!(SKB_VLAN_TCI & VLAN_TAG_PRESENT) }
52905294
},
52915295
.fill_helper = bpf_fill_maxinsns6,
5296+
.expected_errcode = -ENOTSUPP,
52925297
},
52935298
{ /* Mainly checking JIT here. */
52945299
"BPF_MAXINSNS: Call heavy transformations",
52955300
{ },
5301+
#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5302+
CLASSIC | FLAG_NO_DATA | FLAG_EXPECTED_FAIL,
5303+
#else
52965304
CLASSIC | FLAG_NO_DATA,
5305+
#endif
52975306
{ },
52985307
{ { 1, 0 }, { 10, 0 } },
52995308
.fill_helper = bpf_fill_maxinsns7,
5309+
.expected_errcode = -ENOTSUPP,
53005310
},
53015311
{ /* Mainly checking JIT here. */
53025312
"BPF_MAXINSNS: Jump heavy test",
@@ -5347,18 +5357,28 @@ static struct bpf_test tests[] = {
53475357
{
53485358
"BPF_MAXINSNS: exec all MSH",
53495359
{ },
5360+
#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5361+
CLASSIC | FLAG_EXPECTED_FAIL,
5362+
#else
53505363
CLASSIC,
5364+
#endif
53515365
{ 0xfa, 0xfb, 0xfc, 0xfd, },
53525366
{ { 4, 0xababab83 } },
53535367
.fill_helper = bpf_fill_maxinsns13,
5368+
.expected_errcode = -ENOTSUPP,
53545369
},
53555370
{
53565371
"BPF_MAXINSNS: ld_abs+get_processor_id",
53575372
{ },
5373+
#if defined(CONFIG_BPF_JIT_ALWAYS_ON) && defined(CONFIG_S390)
5374+
CLASSIC | FLAG_EXPECTED_FAIL,
5375+
#else
53585376
CLASSIC,
5377+
#endif
53595378
{ },
53605379
{ { 1, 0xbee } },
53615380
.fill_helper = bpf_fill_ld_abs_get_processor_id,
5381+
.expected_errcode = -ENOTSUPP,
53625382
},
53635383
/*
53645384
* LD_IND / LD_ABS on fragmented SKBs

0 commit comments

Comments
 (0)