Message ID | 20240905160035.62407-1-kerneljasonxing@gmail.com (mailing list archive) |
---|---|
State | Accepted |
Commit | a7e387375f22a4fd46c8ffcfa395a0ca8c186f9e |
Headers | show |
Series | [net-next,v2] selftests: return failure when timestamps can't be reported | expand |
On Fri, 6 Sep 2024 00:00:35 +0800 Jason Xing wrote: > When I was trying to modify the tx timestamping feature, I found that > running "./txtimestamp -4 -C -L 127.0.0.1" didn't reflect the error: > I succeeded to generate timestamp stored in the skb but later failed > to report it to the userspace (which means failed to put css into cmsg). > It can happen when someone writes buggy codes in __sock_recv_timestamp(), > for example. Willem, thoughts?
Jakub Kicinski wrote: > On Fri, 6 Sep 2024 00:00:35 +0800 Jason Xing wrote: > > When I was trying to modify the tx timestamping feature, I found that > > running "./txtimestamp -4 -C -L 127.0.0.1" didn't reflect the error: > > I succeeded to generate timestamp stored in the skb but later failed > > to report it to the userspace (which means failed to put css into cmsg). > > It can happen when someone writes buggy codes in __sock_recv_timestamp(), > > for example. > > Willem, thoughts? Reviewed-by: Willem de Bruijn <willemb@google.com> Sorry, lost track of this.
Hello: This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <kuba@kernel.org>: On Fri, 6 Sep 2024 00:00:35 +0800 you wrote: > From: Jason Xing <kernelxing@tencent.com> > > When I was trying to modify the tx timestamping feature, I found that > running "./txtimestamp -4 -C -L 127.0.0.1" didn't reflect the error: > I succeeded to generate timestamp stored in the skb but later failed > to report it to the userspace (which means failed to put css into cmsg). > It can happen when someone writes buggy codes in __sock_recv_timestamp(), > for example. > > [...] Here is the summary with links: - [net-next,v2] selftests: return failure when timestamps can't be reported https://git.kernel.org/netdev/net-next/c/a7e387375f22 You are awesome, thank you!
diff --git a/tools/testing/selftests/net/txtimestamp.c b/tools/testing/selftests/net/txtimestamp.c index ec60a16c9307..d626f22f9550 100644 --- a/tools/testing/selftests/net/txtimestamp.c +++ b/tools/testing/selftests/net/txtimestamp.c @@ -356,8 +356,12 @@ static void __recv_errmsg_cmsg(struct msghdr *msg, int payload_len) } } - if (batch > 1) + if (batch > 1) { fprintf(stderr, "batched %d timestamps\n", batch); + } else if (!batch) { + fprintf(stderr, "Failed to report timestamps\n"); + test_failed = true; + } } static int recv_errmsg(int fd)