lkml.org 
[lkml]   [2017]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH] [RFC v2] packet: experimental support for 64-bit timestamps
On Tue, Nov 28, 2017 at 8:14 AM, Arnd Bergmann <arnd@arndb.de> 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.

\
 
 \ /
  Last update: 2017-11-28 15:26    [W:0.064 / U:4.700 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site