Message ID | 20220615161041.902916-10-maciej.fijalkowski@intel.com (mailing list archive) |
---|---|
State | Superseded |
Delegated to: | BPF |
Headers | show |
Series | AF_XDP ZC selftests | expand |
diff --git a/tools/testing/selftests/bpf/xdpxceiver.c b/tools/testing/selftests/bpf/xdpxceiver.c index de4cf0432243..13a3b2ac2399 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.c +++ b/tools/testing/selftests/bpf/xdpxceiver.c @@ -965,7 +965,7 @@ static int __send_pkts(struct ifobject *ifobject, u32 *pkt_nb) static void wait_for_tx_completion(struct xsk_socket_info *xsk) { - while (xsk->outstanding_tx) + while (pkts_in_flight) complete_pkts(xsk, BATCH_SIZE); } @@ -1269,6 +1269,7 @@ static void *worker_testapp_validate_rx(void *arg) pthread_mutex_unlock(&pacing_mutex); } + pkts_in_flight = 0; pthread_exit(NULL); } diff --git a/tools/testing/selftests/bpf/xdpxceiver.h b/tools/testing/selftests/bpf/xdpxceiver.h index b7aa6c7cf2be..f364a92675f8 100644 --- a/tools/testing/selftests/bpf/xdpxceiver.h +++ b/tools/testing/selftests/bpf/xdpxceiver.h @@ -170,6 +170,6 @@ pthread_barrier_t barr; pthread_mutex_t pacing_mutex = PTHREAD_MUTEX_INITIALIZER; pthread_cond_t pacing_cond = PTHREAD_COND_INITIALIZER; -int pkts_in_flight; +volatile int pkts_in_flight; #endif /* XDPXCEIVER_H */