aboutsummaryrefslogtreecommitdiffstats
path: root/net/core/dev.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/core/dev.c')
-rw-r--r--net/core/dev.c28
1 files changed, 19 insertions, 9 deletions
diff --git a/net/core/dev.c b/net/core/dev.c
index 9d153eb1e8cf..a3ed53cc4af8 100644
--- a/net/core/dev.c
+++ b/net/core/dev.c
@@ -1009,13 +1009,22 @@ void net_disable_timestamp(void)
1009 atomic_dec(&netstamp_needed); 1009 atomic_dec(&netstamp_needed);
1010} 1010}
1011 1011
1012static inline void net_timestamp(struct timeval *stamp) 1012void __net_timestamp(struct sk_buff *skb)
1013{
1014 struct timeval tv;
1015
1016 do_gettimeofday(&tv);
1017 skb_set_timestamp(skb, &tv);
1018}
1019EXPORT_SYMBOL(__net_timestamp);
1020
1021static inline void net_timestamp(struct sk_buff *skb)
1013{ 1022{
1014 if (atomic_read(&netstamp_needed)) 1023 if (atomic_read(&netstamp_needed))
1015 do_gettimeofday(stamp); 1024 __net_timestamp(skb);
1016 else { 1025 else {
1017 stamp->tv_sec = 0; 1026 skb->tstamp.off_sec = 0;
1018 stamp->tv_usec = 0; 1027 skb->tstamp.off_usec = 0;
1019 } 1028 }
1020} 1029}
1021 1030
@@ -1027,7 +1036,8 @@ static inline void net_timestamp(struct timeval *stamp)
1027void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev) 1036void dev_queue_xmit_nit(struct sk_buff *skb, struct net_device *dev)
1028{ 1037{
1029 struct packet_type *ptype; 1038 struct packet_type *ptype;
1030 net_timestamp(&skb->stamp); 1039
1040 net_timestamp(skb);
1031 1041
1032 rcu_read_lock(); 1042 rcu_read_lock();
1033 list_for_each_entry_rcu(ptype, &ptype_all, list) { 1043 list_for_each_entry_rcu(ptype, &ptype_all, list) {
@@ -1379,8 +1389,8 @@ int netif_rx(struct sk_buff *skb)
1379 if (netpoll_rx(skb)) 1389 if (netpoll_rx(skb))
1380 return NET_RX_DROP; 1390 return NET_RX_DROP;
1381 1391
1382 if (!skb->stamp.tv_sec) 1392 if (!skb->tstamp.off_sec)
1383 net_timestamp(&skb->stamp); 1393 net_timestamp(skb);
1384 1394
1385 /* 1395 /*
1386 * The code is rearranged so that the path is the most 1396 * The code is rearranged so that the path is the most
@@ -1566,8 +1576,8 @@ int netif_receive_skb(struct sk_buff *skb)
1566 if (skb->dev->poll && netpoll_rx(skb)) 1576 if (skb->dev->poll && netpoll_rx(skb))
1567 return NET_RX_DROP; 1577 return NET_RX_DROP;
1568 1578
1569 if (!skb->stamp.tv_sec) 1579 if (!skb->tstamp.off_sec)
1570 net_timestamp(&skb->stamp); 1580 net_timestamp(skb);
1571 1581
1572 if (!skb->input_dev) 1582 if (!skb->input_dev)
1573 skb->input_dev = skb->dev; 1583 skb->input_dev = skb->dev;