selftests: xsk: Don't call worker_pkt_dump() for stats test

For TEST_TYPE_STATS, worker_pkt_validate() that places frames onto
pkt_buf is not called. Therefore, when dump mode is set, don't call
worker_pkt_dump() for mentioned test type, so that it won't crash on
pkt_buf() access.

Signed-off-by: Maciej Fijalkowski <maciej.fijalkowski@intel.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20210329224316.17793-2-maciej.fijalkowski@intel.com
This commit is contained in:
Maciej Fijalkowski 2021-03-30 00:43:00 +02:00 committed by Alexei Starovoitov
parent 05d817031f
commit 9f33df73a9
1 changed files with 1 additions and 1 deletions
tools/testing/selftests/bpf

View File

@ -999,7 +999,7 @@ static void testapp_validate(void)
pthread_join(t1, NULL);
pthread_join(t0, NULL);
if (debug_pkt_dump) {
if (debug_pkt_dump && test_type != TEST_TYPE_STATS) {
worker_pkt_dump();
for (int iter = 0; iter < num_frames - 1; iter++) {
free(pkt_buf[iter]->payload);