aboutsummaryrefslogtreecommitdiffstats
path: root/net/core
diff options
context:
space:
mode:
authorWillem de Bruijn <willemb@google.com>2013-04-22 20:39:28 -0400
committerDavid S. Miller <davem@davemloft.net>2013-04-25 01:22:22 -0400
commit2e31396fa14be50a98c5d2b00416ebd74d381c1f (patch)
treee01cf0a24659116265e189a68331bd74ebb48d42 /net/core
parent92dea7c06656f709a3957aacef20574ce3dbe6fc (diff)
packet: tx timestamping on tpacket ring
When transmit timestamping is enabled at the socket level, record a timestamp on packets written to a PACKET_TX_RING. Tx timestamps are always looped to the application over the socket error queue. Software timestamps are also written back into the packet frame header in the packet ring. Reported-by: Paul Chavent <paul.chavent@onera.fr> Signed-off-by: Willem de Bruijn <willemb@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r--net/core/skbuff.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index 898cf5c566f9..af9185d0be6a 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -3327,12 +3327,8 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
3327 if (!sk) 3327 if (!sk)
3328 return; 3328 return;
3329 3329
3330 skb = skb_clone(orig_skb, GFP_ATOMIC);
3331 if (!skb)
3332 return;
3333
3334 if (hwtstamps) { 3330 if (hwtstamps) {
3335 *skb_hwtstamps(skb) = 3331 *skb_hwtstamps(orig_skb) =
3336 *hwtstamps; 3332 *hwtstamps;
3337 } else { 3333 } else {
3338 /* 3334 /*
@@ -3340,9 +3336,13 @@ void skb_tstamp_tx(struct sk_buff *orig_skb,
3340 * so keep the shared tx_flags and only 3336 * so keep the shared tx_flags and only
3341 * store software time stamp 3337 * store software time stamp
3342 */ 3338 */
3343 skb->tstamp = ktime_get_real(); 3339 orig_skb->tstamp = ktime_get_real();
3344 } 3340 }
3345 3341
3342 skb = skb_clone(orig_skb, GFP_ATOMIC);
3343 if (!skb)
3344 return;
3345
3346 serr = SKB_EXT_ERR(skb); 3346 serr = SKB_EXT_ERR(skb);
3347 memset(serr, 0, sizeof(*serr)); 3347 memset(serr, 0, sizeof(*serr));
3348 serr->ee.ee_errno = ENOMSG; 3348 serr->ee.ee_errno = ENOMSG;