aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/netdevice.h
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-05-16 02:57:10 -0400
committerDavid S. Miller <davem@davemloft.net>2010-05-16 02:57:10 -0400
commit3b098e2d7c693796cc4dffb07caa249fc0f70771 (patch)
tree586c4f5dc57988ade175ffc7e4b6d0261b12e166 /include/linux/netdevice.h
parenta1aa3483041bd3691c7f029272ccef4ce70bd957 (diff)
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 'include/linux/netdevice.h')
-rw-r--r--include/linux/netdevice.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 69022d47d6f2..c1b2341897c2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2100,6 +2100,7 @@ extern const struct net_device_stats *dev_get_stats(struct net_device *dev);
2100extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); 2100extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats);
2101 2101
2102extern int netdev_max_backlog; 2102extern int netdev_max_backlog;
2103extern int netdev_tstamp_prequeue;
2103extern int weight_p; 2104extern int weight_p;
2104extern int netdev_set_master(struct net_device *dev, struct net_device *master); 2105extern int netdev_set_master(struct net_device *dev, struct net_device *master);
2105extern int skb_checksum_help(struct sk_buff *skb); 2106extern int skb_checksum_help(struct sk_buff *skb);