All of lore.kernel.org
 help / color / mirror / Atom feed
* SOF_TIMESTAMPING_OPT_ID is unreliable when sendmsg fails
@ 2024-02-08 18:02 Andy Lutomirski
  2024-02-08 19:55 ` Vadim Fedorenko
  0 siblings, 1 reply; 8+ messages in thread
From: Andy Lutomirski @ 2024-02-08 18:02 UTC (permalink / raw)
  To: Vadim Fedorenko, Willem de Bruijn, David S. Miller,
	Network Development

I’ve been using OPT_ID-style timestamping for years, but for some
reason this issue only bit me last week: if sendmsg() fails on a UDP
or ping socket, sk_tskey is poorly.  It may or may not get incremented
by the failed sendmsg().

I can think of at least three ways to improve this:

1. Make it so that the sequence number is genuinely only incremented
on success. This may be tedious to implement and may be nearly
impossible if there are multiple concurrent sendmsg() calls on the
same socket.

2. Allow the user program to specify an explicit ID.  cmsg values are
variable length, so for datagram sockets, extending the
SO_TIMESTAMPING cmsg with 64 bits of sequence number to be used for
the TX timestamp on that particular packet might be a nice solution.

3. Add a getsockopt to read sk_tskey, which user code could use to
determine the next sequence number after a failed sendmsg() call.

Thanks,
Andy

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-02-10 16:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-08 18:02 SOF_TIMESTAMPING_OPT_ID is unreliable when sendmsg fails Andy Lutomirski
2024-02-08 19:55 ` Vadim Fedorenko
2024-02-08 20:05   ` Andy Lutomirski
2024-02-08 20:40     ` Andy Lutomirski
2024-02-08 21:51     ` Willem de Bruijn
2024-02-08 22:40       ` Andy Lutomirski
2024-02-09  3:22       ` Vadim Fedorenko
2024-02-10 16:37         ` Willem de Bruijn

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.