Skip to content

Commit

Permalink
selftests: xsk: Don't call worker_pkt_dump() for stats test
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Alexei Starovoitov <[email protected]>
Link: https://lore.kernel.org/bpf/[email protected]
  • Loading branch information
mfijalko authored and Alexei Starovoitov committed Mar 30, 2021
1 parent 05d8170 commit 9f33df7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/testing/selftests/bpf/xdpxceiver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 9f33df7

Please sign in to comment.