Subject: Re: What is SOF_TIMESTAMPING_RX_HARDWARE?

From: Richard Cochran <[email-masked]>
Date: Tue, 4 Mar 2014 11:10:30 +0100

On Mon, Mar 03, 2014 at 06:20:33PM -0800, Andy Lutomirski wrote:
> AFAICT is sets SOCK_TIMESTAMPING_RX_HARDWARE, which appears to do
> exactly nothing.  If I'm right, should I submit a patch documenting
> that fact and removing the getsockopt/setsockopt implementations?

Have you seen Documentation/networking/timestamping.txt?

  SOF_TIMESTAMPING_TX/RX determine how time stamps are generated.
  SOF_TIMESTAMPING_RAW/SYS determine how they are reported in the
  following control message:

This is the API that was invented (not by me) to support HW time stamp
reporting. I agree that it is confusing and complicated, but I don't
think you can remove the flag as it is a firmly established API.
Drivers do use this to advertise whether they support receive time
stamps in hardware.

AFAICT, the reason why setting this socket option is a noop is
this. Once receive time stamping is enabled at the driver level,
eligible skbs will get the information whether they want it or not.
It would be more work to hide this from sockets which haven't enabled
the option, and so we don't do it.

HTH,
Richard