aboutsummaryrefslogtreecommitdiffstats
path: root/tools/testing
diff options
context:
space:
mode:
Diffstat (limited to 'tools/testing')
-rw-r--r--tools/testing/selftests/net/psock_tpacket.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/testing/selftests/net/psock_tpacket.c b/tools/testing/selftests/net/psock_tpacket.c
index a8d7ffadd49b..c41b58640a05 100644
--- a/tools/testing/selftests/net/psock_tpacket.c
+++ b/tools/testing/selftests/net/psock_tpacket.c
@@ -300,7 +300,7 @@ static void walk_v1_v2_rx(int sock, struct ring *ring)
300 300
301static inline int __v1_tx_kernel_ready(struct tpacket_hdr *hdr) 301static inline int __v1_tx_kernel_ready(struct tpacket_hdr *hdr)
302{ 302{
303 return ((hdr->tp_status & TP_STATUS_AVAILABLE) == TP_STATUS_AVAILABLE); 303 return !(hdr->tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING));
304} 304}
305 305
306static inline void __v1_tx_user_ready(struct tpacket_hdr *hdr) 306static inline void __v1_tx_user_ready(struct tpacket_hdr *hdr)
@@ -311,7 +311,7 @@ static inline void __v1_tx_user_ready(struct tpacket_hdr *hdr)
311 311
312static inline int __v2_tx_kernel_ready(struct tpacket2_hdr *hdr) 312static inline int __v2_tx_kernel_ready(struct tpacket2_hdr *hdr)
313{ 313{
314 return ((hdr->tp_status & TP_STATUS_AVAILABLE) == TP_STATUS_AVAILABLE); 314 return !(hdr->tp_status & (TP_STATUS_SEND_REQUEST | TP_STATUS_SENDING));
315} 315}
316 316
317static inline void __v2_tx_user_ready(struct tpacket2_hdr *hdr) 317static inline void __v2_tx_user_ready(struct tpacket2_hdr *hdr)