summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorSoheil Hassas Yeganeh <soheil@google.com>2016-08-23 18:22:33 -0400
committerAmit Pundir <amit.pundir@linaro.org>2016-10-12 17:34:22 +0530
commit27d421020677852b44dcb25e87ab8e4cdf843094 (patch)
tree5f3b29368a6022c0275bb90485ca3d2544a4ced7 /drivers/net
parentd17c9e4d388fc76084fee3eb694ebca96051ec69 (diff)
UPSTREAM: tun: fix transmit timestamp support
Instead of using sock_tx_timestamp, use skb_tx_timestamp to record software transmit timestamp of a packet. sock_tx_timestamp resets and overrides the tx_flags of the skb. The function is intended to be called from within the protocol layer when creating the skb, not from a device driver. This is inconsistent with other drivers and will cause issues for TCP. In TCP, we intend to sample the timestamps for the last byte for each sendmsg/sendpage. For that reason, tcp_sendmsg calls tcp_tx_timestamp only with the last skb that it generates. For example, if a 128KB message is split into two 64KB packets we want to sample the SND timestamp of the last packet. The current code in the tun driver, however, will result in sampling the SND timestamp for both packets. Also, when the last packet is split into smaller packets for retranmission (see tcp_fragment), the tun driver will record timestamps for all of the retransmitted packets and not only the last packet. Change-Id: If7458ab31de52aa15a12364b6c1ac2a8f93f17a7 Fixes: eda297729171 (tun: Support software transmit time stamping.) Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com> Signed-off-by: Francis Yan <francisyyan@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/tun.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index 62f2d80a9fe0..6941f0888b00 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -862,10 +862,7 @@ static netdev_tx_t tun_net_xmit(struct sk_buff *skb, struct net_device *dev)
if (unlikely(skb_orphan_frags(skb, GFP_ATOMIC)))
goto drop;
- if (skb->sk && sk_fullsock(skb->sk)) {
- sock_tx_timestamp(skb->sk, &skb_shinfo(skb)->tx_flags);
- sw_tx_timestamp(skb);
- }
+ skb_tx_timestamp(skb);
/* Orphan the skb - required as we might hang on to it
* for indefinite time.