Re: [PATCH] [RFC v2] packet: experimental support for 64-bit timestamps

From
Willem de Bruijn <willemdebruijn.kernel@gmail.com>
Date
2017-11-28 14:25:17
Also in
lkml
Reply to
Arnd Bergmann, 2017-11-28
On Tue, Nov 28, 2017 at 8:14 AM, Arnd Bergmann [off-list ref] wrote:
This is a second attempt to allow 64-bit timestamps in packet sockets,
Thanks for coding up this variant.
The implementation is fairly straightforward, but I'm less sure about the
interface. Using SOF_TIMESTAMPING_* flags in PACKET_TIMESTAMP is a bit
odd already since most of the other flags make no sense here.  Adding two
more flags that only make sense for packet sockets but not the normal
SO_TIMESTAMPING option on other sockets makes this even more confusing.
Agreed.

Unfortunately, we're already stuck with SOL_PACKET/PACKET_TIMESTAMP
accepting SOF_TIMESTAMPING_RAW_HARDWARE.

Perhaps we can define a new PF_PACKET specific enum where the
equivalent option has the same value, so is backwards compatible:

enum {
      PACKET_TIMESTAMP_ORIG = 0,
      PACKET_TIMESTAMP_ZERO = 1 << 0,
      PACKET_TIMESTAMP_NS64 = 1 << 1,
      PACKET_TIMESTAMP_HW = 1 << 6
};

and  BUILD_BUG_ON(PACKET_TIMESTAMP_RAW != SOF_TIMESTAMPING_RAW_HARDWARE)
to document the dependency.

At high level, the code looks great to me, itself.
Thread (25 messages) 25 messages, 5 authors, last reply 2017-11-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help