Skip to content

net-timestamp: new tx tstamps and tcp

Willem de Bruijn netdev 3 versions – Applied

Status from this message: Applied to net-next.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest posting 2/26 patches 17 repliesApplied
  2. v4 posting 1/25 patches 7 repliesSuperseded
  3. v35 patches 9 repliesSuperseded

Changes in v4 from the cover letter

- (v3 review comment) removed skb->mark packet identification (*A)
- (v3 review comment) fixed indentation
- tcp: fixed poll() to return POLLERR on non-zero queue
- rebased to work without syststamp
- comments: removed all traces of MSG_TSTAMP_.. (*B)

Patches in v4 posting 2/2 Applied

#Subject and filesSizeRepliesApplied
1/6net-timestamp: extend SCM_TIMESTAMPING ancillary data structinclude/linux/skbuff.h include/net/sock.h include/uapi/linux/errqueue.h +2 more+36 -100 replies
2/6net-timestamp: move timestamp flags out of sk_flagsinclude/net/sock.h net/core/sock.c net/socket.c+17 -450 replies
3/6net-timestamp: add key to disambiguate concurrent datagramsinclude/linux/skbuff.h include/net/sock.h include/uapi/linux/net_tstamp.h +4 more+27 -40 replies
4/6net-timestamp: SCHED timestamp on entering packet schedulerinclude/linux/skbuff.h include/uapi/linux/errqueue.h include/uapi/linux/net_tstamp.h +3 more+31 -70 replies
5/6net-timestamp: TCP timestampingnet/core/skbuff.c net/core/sock.c net/ipv4/tcp.c +1 more+52 -616 replies
6/6net-timestamp: ACK timestamp for bytestreamsinclude/linux/skbuff.h include/uapi/linux/errqueue.h include/uapi/linux/net_tstamp.h +2 more+17 -20 replies

Reviews trailers per patch

1 of 6 patches has a Reviewed-by or Acked-by.

PatchWillem de Bruijn
1/6
2/6
3/6
4/6
5/6A-b
6/6

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH net-next v4 0/6] net-timestamp: new tx tstamps and tcp

Extend socket tx timestamping:
- allow multiple types of software timestamps aside from send (1)
- add software timestamp on enter packet scheduling (4)
- add software timestamp for TCP (5)
- add software timestamp for TCP on ACK (6)

The sk_flags option space is nearly exhausted. Also move the many timestamp options to a new sk->sk_tstamps (2).

To disambiguate data when tstamps may arrive out of order, optionally return a sequential ID assigned at send (3).

Extend Linux tx timestamping to monitoring of latency incurred within the kernel stack and to protocols embedded in TCP. Complex kernel setups may have multiple layers of queueing, including multiple instances of packet scheduling, and many classes per layer. Many applications embed discrete payloads into TCP bytestreams for reliability, flow control, etcetera. Detecting application tail latency in such scenarios relies on identifying the exact queue responsible if on the host, or the network latency if otherwise.

Changelog:
v4->v5
- define SCM_TSTAMP_SND == 0, for legacy behavior
- add TCP tstamps without changing the generated byte stream
  - modify GSO and ACK to find offset: slightly more complex than previous invariant that it is the last byte
- consistent naming of packet scheduling
  - rename SCM_TSTAMP_ENQ to SCM_TSTAMP_SCHED
- add unique key in ee_data
- add id field in ee_info to disambiguate tstamps
  - optional, only on new flag SOF_TIMESTAMPING_OPT_ID
  - for bytestream, in bytes

v3->v4
- (v3 review comment) removed skb->mark packet identification (*A)
- (v3 review comment) fixed indentation
- tcp: fixed poll() to return POLLERR on non-zero queue
- rebased to work without syststamp
- comments: removed all traces of MSG_TSTAMP_.. (*B)

v2->v3
- extend the SO_TIMESTAMPING API, instead of defining a new one.
- add protocol independent support to correlate tstamps with data,

    based on returning skb->mark.

- removed no-payload optimization and documentation (for now):

I have a follow-on patch that reintroduces MSG_TSTAMP along with a new socket option SOF_TIMESTAMPING_OPT_ONFLAG. This is equivalent to sequence setsockopt(<enable>); send(..); setsockopt(<disable>), but avoids the need to define a MSG_TSTAMP_<TYPE> for each type.

I will leave these three patches as follow-on, as this patchset is large enough as is.

v1->v2
- expand timestamping (existing and new) to SOCK_RAW and ping sockets
- rename sock_errqueue_timestamping to scm_timestamping
- change timestamp data format: do not add fields to scm_timestamping. Doing so could break legacy applications. Instead, communicate through an existing, but unused, field in the error message.
- rename SOF_.._OPT_TX_NO_PAYLOAD to shorter SOF_.._OPT_TSONLY
- move msg_tstamp test app out of patchset and to github
git://github.com/wdebruij/kerneltools.git

Willem de Bruijn (6):
net-timestamp: extend SCM_TIMESTAMPING ancillary data struct
net-timestamp: move timestamp flags out of sk_flags
net-timestamp: add key to disambiguate concurrent datagrams
net-timestamp: SCHED timestamp on entering packet scheduler
net-timestamp: TCP timestamping
net-timestamp: ACK timestamp for bytestreams

Signature · 1 line
2.0.0.526.g5318336