diff mbox

[net-next,07/10] igb: never generate both software and hardware timestamps

Message ID 1394818481-7652-8-git-send-email-kubakici@wp.pl
State Awaiting Upstream, archived
Delegated to: David Miller
Headers show

Commit Message

Jakub Kicinski March 14, 2014, 5:34 p.m. UTC
skb_tx_timestamp() does not report software time stamp
if SKBTX_IN_PROGRESS is set. According to timestamping.txt
software time stamps are a fallback and should not be
generated if hardware time stamp is provided.

Move call to skb_tx_timestamp() after setting
SKBTX_IN_PROGRESS.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
---
 drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Kirsher, Jeffrey T March 14, 2014, 11:18 p.m. UTC | #1
On Fri, 2014-03-14 at 18:34 +0100, Jakub Kicinski wrote:
> skb_tx_timestamp() does not report software time stamp
> if SKBTX_IN_PROGRESS is set. According to timestamping.txt
> software time stamps are a fallback and should not be
> generated if hardware time stamp is provided.
> 
> Move call to skb_tx_timestamp() after setting
> SKBTX_IN_PROGRESS.
> 
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
> ---
>  drivers/net/ethernet/intel/igb/igb_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Thanks Jakub, I will add this patch to my queue.
diff mbox

Patch

diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 340a344..ee9a482 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4946,8 +4946,6 @@  netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
 	first->bytecount = skb->len;
 	first->gso_segs = 1;
 
-	skb_tx_timestamp(skb);
-
 	if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
 		struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
 
@@ -4962,6 +4960,8 @@  netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
 		}
 	}
 
+	skb_tx_timestamp(skb);
+
 	if (vlan_tx_tag_present(skb)) {
 		tx_flags |= IGB_TX_FLAGS_VLAN;
 		tx_flags |= (vlan_tx_tag_get(skb) << IGB_TX_FLAGS_VLAN_SHIFT);