History

net: allow simultaneous SW and HW transmit timestamping

Add SOF_TIMESTAMPING_OPT_TX_SWHW option to allow an outgoing packet to be looped to the socket's error queue with a software timestamp even when a hardware transmit timestamp is expected to be provided by the driver. Applications using this option will receive two separate messages from the error queue, one with a software timestamp and the other with a hardware timestamp. As the hardware timestamp is saved to the shared skb info, which may happen before the first message with software timestamp is received by the application, the hardware timestamp is copied to the SCM_TIMESTAMPING control message only when the skb has no software timestamp or it is an incoming packet. While changing sw_tx_timestamp(), inline it in skb_tx_timestamp() as there are no other users.

Miroslav Lichvar committed 9 years ago

Commit b50a5c71 parent 67953d45 files · +34 −11Browse files

Showing the changes to include/uapi/linux (1 of 5 files). Show all

Unified · Split

include/uapi/linux/net_tstamp.h+2−1
@@ -28,8 +28,9 @@ enum { · 27 unmodified lines
28 SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),28 SOF_TIMESTAMPING_OPT_TSONLY = (1<<11),
29 SOF_TIMESTAMPING_OPT_STATS = (1<<12),29 SOF_TIMESTAMPING_OPT_STATS = (1<<12),
30 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),30 SOF_TIMESTAMPING_OPT_PKTINFO = (1<<13),
31 SOF_TIMESTAMPING_OPT_TX_SWHW = (1<<14),
31 32
32 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_PKTINFO,33 SOF_TIMESTAMPING_LAST = SOF_TIMESTAMPING_OPT_TX_SWHW,
33 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |34 SOF_TIMESTAMPING_MASK = (SOF_TIMESTAMPING_LAST - 1) |
34 SOF_TIMESTAMPING_LAST35 SOF_TIMESTAMPING_LAST
35};36};