Commit ae882403 authored by Yonghong Song's avatar Yonghong Song Committed by Alexei Starovoitov
Browse files

selftests/bpf: Reduce test_xdp_adjust_frags_tail_grow logs



For selftest xdp_adjust_tail/xdp_adjust_frags_tail_grow, if tested failure,
I see a long list of log output like

    ...
    test_xdp_adjust_frags_tail_grow:PASS:9Kb+10b-untouched 0 nsec
    test_xdp_adjust_frags_tail_grow:PASS:9Kb+10b-untouched 0 nsec
    test_xdp_adjust_frags_tail_grow:PASS:9Kb+10b-untouched 0 nsec
    test_xdp_adjust_frags_tail_grow:PASS:9Kb+10b-untouched 0 nsec
    ...

There are total 7374 lines of the above which is too much. Let us
only issue such logs when it is an assert failure.

Signed-off-by: default avatarYonghong Song <yonghong.song@linux.dev>
Link: https://lore.kernel.org/r/20250607013610.1551399-1-yonghong.song@linux.dev


Signed-off-by: default avatarAlexei Starovoitov <ast@kernel.org>
parent 64a064ce
Loading
Loading
Loading
Loading
+12 −6
Original line number Diff line number Diff line
@@ -246,14 +246,20 @@ static void test_xdp_adjust_frags_tail_grow(void)
	ASSERT_EQ(topts.retval, XDP_TX, "9Kb+10b retval");
	ASSERT_EQ(topts.data_size_out, exp_size, "9Kb+10b size");

	for (i = 0; i < 9000; i++)
	for (i = 0; i < 9000; i++) {
		if (buf[i] != 1)
			ASSERT_EQ(buf[i], 1, "9Kb+10b-old");
	}

	for (i = 9000; i < 9010; i++)
	for (i = 9000; i < 9010; i++) {
		if (buf[i] != 0)
			ASSERT_EQ(buf[i], 0, "9Kb+10b-new");
	}

	for (i = 9010; i < 16384; i++)
	for (i = 9010; i < 16384; i++) {
		if (buf[i] != 1)
			ASSERT_EQ(buf[i], 1, "9Kb+10b-untouched");
	}

	/* Test a too large grow */
	memset(buf, 1, 16384);