netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Willem de Bruijn <willemb@google.com>
To: netdev@vger.kernel.org
Cc: eric.dumazet@gmail.com, richardcochran@gmail.com,
	davem@davemloft.net, Willem de Bruijn <willemb@google.com>
Subject: net-timestamp: MSG_TSTAMP flags and bytestream support
Date: Tue, 24 Jun 2014 11:43:45 -0400	[thread overview]
Message-ID: <1403624632-17327-1-git-send-email-willemb@google.com> (raw)

This patchset extends socket timestamping in a number of related ways.
Most notably:

2 MSG_TSTAMP: request a single tx timestamp by passing a flag on send
6 MSG_TSTAMP_ENQ: request a tx timestamp before traffic shaping.
5 MSG_TSTAMP_ACK: request a tx timestamp after acknowledgements (TCP)
4 TCP support for all three flags

Each individual patch commit message gives more detail about the
specific feature.

The other patches support the main feature:
1 explicitly define the timestamp response API
3 optionally avoid looping large packets onto the socket error queue.
7 documentation and an example test.

This initial patchset is mostly to request feedback. Though the
patches are somewhat interdependent, I can resubmit them independently
or drop optional features (most notably, patches 1 and 3).

While rebasing, I found a few possible improvements, myself. These are
debatable, so I will send the set first and optionally integrate these
in v2:

- The struct in patch 1 was informally called scm_timestamping in the
  documentation. I prefer that name over the long one I came up with.
- We can actually avoid extending that structure, because ts_type and
  ts_key can be passed in the currently unused sock_extended_err
  fields ee_info and ee_data
- the new functionality of MSG_TSTAMP_* should also be extended to
  the socket option interface SO_TIMESTAMPING

Tested:
  I ran the msg_tstamp binary for various settings:
  - IPv4 and IPv6
  - UDP and TCP
  - 1 B and 20 KB payload
  - GSO, TSO, neither
  - with and without the no-payload feature (patch 3)

  Example output from one IPv4/TCP/1B/payload run:
  (on a bonded machine, resulting in 2 ENQ timestamps per send)

proto INET
  test SND
      USR: 1400265321 s 167847 us (seq=0, len=0)
      SND: 1400265321 s 167854 us (seq=408779523, len=7)  (+7 us)
  test ENQ
      USR: 1400265321 s 768728 us (seq=0, len=7)
      ENQ: 1400265321 s 768732 us (seq=3113669987, len=7)  (+4 us)
      ENQ: 1400265321 s 768734 us (seq=3113669987, len=7)  (+2 us)
  test ENQ + SND
      USR: 1400265322 s 369747 us (seq=0, len=7)
      ENQ: 1400265322 s 369750 us (seq=2305548511, len=7)  (+3 us)
      ENQ: 1400265322 s 369751 us (seq=2305548511, len=7)  (+1 us)
      SND: 1400265322 s 369752 us (seq=2305548511, len=7)  (+1 us)
  test ACK
      USR: 1400265322 s 970717 us (seq=0, len=7)
      ACK: 1400265322 s 970752 us (seq=2324323855, len=7)  (+35 us)
  test SND + ACK
      USR: 1400265323 s 571662 us (seq=0, len=7)
      SND: 1400265323 s 571681 us (seq=872301729, len=7)  (+19 us)
      ACK: 1400265323 s 571708 us (seq=872301729, len=7)  (+27 us)
  test ENQ + SND + ACK
      USR: 1400265324 s 172558 us (seq=0, len=7)
      ENQ: 1400265324 s 172561 us (seq=2135092223, len=7)  (+3 us)
      ENQ: 1400265324 s 172565 us (seq=2135092223, len=7)  (+4 us)
      SND: 1400265324 s 172581 us (seq=2135092223, len=7)  (+16 us)
      ACK: 1400265324 s 172624 us (seq=2135092223, len=7)  (+43 us)


Signed-off-by: Willem de Bruijn <willemb@google.com>

             reply	other threads:[~2014-06-24 15:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-24 15:43 Willem de Bruijn [this message]
2014-06-24 15:43 ` [PATCH net-next 1/7] net-timestamp: explicit SO_TIMESTAMPING ancillary data struct Willem de Bruijn
2014-06-25  4:56   ` Richard Cochran
2014-06-25 21:18     ` Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 2/7] net-timestamp: MSG_TSTAMP one-shot tx timestamps Willem de Bruijn
2014-06-25  5:01   ` Richard Cochran
2014-06-25 21:20     ` Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 3/7] net-timestamp: tx timestamp without payload Willem de Bruijn
2014-06-25  5:16   ` Richard Cochran
2014-06-25 21:22     ` Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 4/7] net-timestamp: TCP timestamping Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 5/7] net-timestamp: ACK timestamp for bytestreams Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 6/7] net-timestamp: ENQ timestamp on enqueue to traffic shaping layer Willem de Bruijn
2014-06-24 15:43 ` [PATCH net-next 7/7] net-timestamp: expand documentation Willem de Bruijn
2014-06-25  7:32 ` net-timestamp: MSG_TSTAMP flags and bytestream support Richard Cochran
2014-06-25 21:11   ` Willem de Bruijn
  -- strict thread matches above, loose matches on Subject: below --
2014-07-03 19:39 Willem de Bruijn

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1403624632-17327-1-git-send-email-willemb@google.com \
    --to=willemb@google.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=richardcochran@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).