Skip to content

Commit a9e5105

Browse files
jacob-kellerJeff Kirsher
authored andcommitted
intel-ethernet: software timestamp skbs as late as possible
Many of the Intel Ethernet drivers call skb_tx_timestamp() earlier than necessary. Move the calls to this function to the latest point possible, just prior to notifying hardware of the new Tx packet when we bump the tail register. This affects i40e, iavf, igb, igc, and ixgbe. The e100, e1000, e1000e, fm10k, and ice drivers already call the skb_tx_timestamp() function just prior to indicating the Tx packet to hardware, so they do not need to be changed. Signed-off-by: Jacob Keller <[email protected]> Tested-by: Andrew Bowers <[email protected]> Signed-off-by: Jeff Kirsher <[email protected]>
1 parent 9fc145f commit a9e5105

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

drivers/net/ethernet/intel/i40e/i40e_txrx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3473,6 +3473,8 @@ static inline int i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
34733473
tx_desc->cmd_type_offset_bsz =
34743474
build_ctob(td_cmd, td_offset, size, td_tag);
34753475

3476+
skb_tx_timestamp(skb);
3477+
34763478
/* Force memory writes to complete before letting h/w know there
34773479
* are new descriptors to fetch.
34783480
*
@@ -3652,8 +3654,6 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
36523654
if (tsyn)
36533655
tx_flags |= I40E_TX_FLAGS_TSYN;
36543656

3655-
skb_tx_timestamp(skb);
3656-
36573657
/* always enable CRC insertion offload */
36583658
td_cmd |= I40E_TX_DESC_CMD_ICRC;
36593659

drivers/net/ethernet/intel/iavf/iavf_txrx.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2343,6 +2343,8 @@ static inline void iavf_tx_map(struct iavf_ring *tx_ring, struct sk_buff *skb,
23432343
tx_desc->cmd_type_offset_bsz =
23442344
build_ctob(td_cmd, td_offset, size, td_tag);
23452345

2346+
skb_tx_timestamp(skb);
2347+
23462348
/* Force memory writes to complete before letting h/w know there
23472349
* are new descriptors to fetch.
23482350
*
@@ -2461,8 +2463,6 @@ static netdev_tx_t iavf_xmit_frame_ring(struct sk_buff *skb,
24612463
if (tso < 0)
24622464
goto out_drop;
24632465

2464-
skb_tx_timestamp(skb);
2465-
24662466
/* always enable CRC insertion offload */
24672467
td_cmd |= IAVF_TX_DESC_CMD_ICRC;
24682468

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6019,6 +6019,8 @@ static int igb_tx_map(struct igb_ring *tx_ring,
60196019
/* set the timestamp */
60206020
first->time_stamp = jiffies;
60216021

6022+
skb_tx_timestamp(skb);
6023+
60226024
/* Force memory writes to complete before letting h/w know there
60236025
* are new descriptors to fetch. (Only applicable for weak-ordered
60246026
* memory model archs, such as IA-64).
@@ -6147,8 +6149,6 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
61476149
else if (!tso)
61486150
igb_tx_csum(tx_ring, first);
61496151

6150-
skb_tx_timestamp(skb);
6151-
61526152
if (igb_tx_map(tx_ring, first, hdr_len))
61536153
goto cleanup_tx_tstamp;
61546154

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,6 +865,8 @@ static int igc_tx_map(struct igc_ring *tx_ring,
865865
/* set the timestamp */
866866
first->time_stamp = jiffies;
867867

868+
skb_tx_timestamp(skb);
869+
868870
/* Force memory writes to complete before letting h/w know there
869871
* are new descriptors to fetch. (Only applicable for weak-ordered
870872
* memory model archs, such as IA-64).
@@ -959,8 +961,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
959961
first->bytecount = skb->len;
960962
first->gso_segs = 1;
961963

962-
skb_tx_timestamp(skb);
963-
964964
/* record initial flags and protocol */
965965
first->tx_flags = tx_flags;
966966
first->protocol = protocol;

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8269,6 +8269,8 @@ static int ixgbe_tx_map(struct ixgbe_ring *tx_ring,
82698269
/* set the timestamp */
82708270
first->time_stamp = jiffies;
82718271

8272+
skb_tx_timestamp(skb);
8273+
82728274
/*
82738275
* Force memory writes to complete before letting h/w know there
82748276
* are new descriptors to fetch. (Only applicable for weak-ordered
@@ -8646,8 +8648,6 @@ netdev_tx_t ixgbe_xmit_frame_ring(struct sk_buff *skb,
86468648
}
86478649
}
86488650

8649-
skb_tx_timestamp(skb);
8650-
86518651
#ifdef CONFIG_PCI_IOV
86528652
/*
86538653
* Use the l2switch_enable flag - would be false if the DMA

0 commit comments

Comments
 (0)