diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2010-05-15 23:57:10 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-05-15 23:57:10 -0700 |
commit | 3b098e2d7c693796cc4dffb07caa249fc0f70771 (patch) | |
tree | 586c4f5dc57988ade175ffc7e4b6d0261b12e166 /Documentation | |
parent | a1aa3483041bd3691c7f029272ccef4ce70bd957 (diff) | |
download | linux-3b098e2d7c693796cc4dffb07caa249fc0f70771.tar.gz linux-3b098e2d7c693796cc4dffb07caa249fc0f70771.tar.bz2 linux-3b098e2d7c693796cc4dffb07caa249fc0f70771.zip |
net: Consistent skb timestamping
With RPS inclusion, skb timestamping is not consistent in RX path.
If netif_receive_skb() is used, its deferred after RPS dispatch.
If netif_rx() is used, its done before RPS dispatch.
This can give strange tcpdump timestamps results.
I think timestamping should be done as soon as possible in the receive
path, to get meaningful values (ie timestamps taken at the time packet
was delivered by NIC driver to our stack), even if NAPI already can
defer timestamping a bit (RPS can help to reduce the gap)
Tom Herbert prefer to sample timestamps after RPS dispatch. In case
sampling is expensive (HPET/acpi_pm on x86), this makes sense.
Let admins switch from one mode to another, using a new
sysctl, /proc/sys/net/core/netdev_tstamp_prequeue
Its default value (1), means timestamps are taken as soon as possible,
before backlog queueing, giving accurate timestamps.
Setting a 0 value permits to sample timestamps when processing backlog,
after RPS dispatch, to lower the load of the pre-RPS cpu.
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'Documentation')
-rw-r--r-- | Documentation/sysctl/net.txt | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/Documentation/sysctl/net.txt b/Documentation/sysctl/net.txt index df38ef046f8d..cbd05ffc606b 100644 --- a/Documentation/sysctl/net.txt +++ b/Documentation/sysctl/net.txt @@ -84,6 +84,16 @@ netdev_max_backlog Maximum number of packets, queued on the INPUT side, when the interface receives packets faster than kernel can process them. +netdev_tstamp_prequeue +---------------------- + +If set to 0, RX packet timestamps can be sampled after RPS processing, when +the target CPU processes packets. It might give some delay on timestamps, but +permit to distribute the load on several cpus. + +If set to 1 (default), timestamps are sampled as soon as possible, before +queueing. + optmem_max ---------- |