aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacob Keller <jacob.e.keller@intel.com>2018-10-05 12:33:56 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2018-11-07 12:47:01 -0500
commita9e510589d7017ee4e82800d0a1d78a694772787 (patch)
treed38e8d0791cfeb12f7a1e5927f6866a57ea8ef94
parent9fc145fcb5fbf2e10ad5e4b31a011b5cecb77b10 (diff)
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 <jacob.e.keller@intel.com> Tested-by: Andrew Bowers <andrewx.bowers@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/i40e/i40e_txrx.c4
-rw-r--r--drivers/net/ethernet/intel/iavf/iavf_txrx.c4
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c4
-rw-r--r--drivers/net/ethernet/intel/igc/igc_main.c4
-rw-r--r--drivers/net/ethernet/intel/ixgbe/ixgbe_main.c4
5 files changed, 10 insertions, 10 deletions
diff --git a/drivers/net/ethernet/intel/i40e/i40e_txrx.c b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
index aef3c89ee79c..1384a5a006a4 100644
--- a/drivers/net/ethernet/intel/i40e/i40e_txrx.c
+++ b/drivers/net/ethernet/intel/i40e/i40e_txrx.c
@@ -3473,6 +3473,8 @@ static inline int i40e_tx_map(struct i40e_ring *tx_ring, struct sk_buff *skb,
3473 tx_desc->cmd_type_offset_bsz = 3473 tx_desc->cmd_type_offset_bsz =
3474 build_ctob(td_cmd, td_offset, size, td_tag); 3474 build_ctob(td_cmd, td_offset, size, td_tag);
3475 3475
3476 skb_tx_timestamp(skb);
3477
3476 /* Force memory writes to complete before letting h/w know there 3478 /* Force memory writes to complete before letting h/w know there
3477 * are new descriptors to fetch. 3479 * are new descriptors to fetch.
3478 * 3480 *
@@ -3652,8 +3654,6 @@ static netdev_tx_t i40e_xmit_frame_ring(struct sk_buff *skb,
3652 if (tsyn) 3654 if (tsyn)
3653 tx_flags |= I40E_TX_FLAGS_TSYN; 3655 tx_flags |= I40E_TX_FLAGS_TSYN;
3654 3656
3655 skb_tx_timestamp(skb);
3656
3657 /* always enable CRC insertion offload */ 3657 /* always enable CRC insertion offload */
3658 td_cmd |= I40E_TX_DESC_CMD_ICRC; 3658 td_cmd |= I40E_TX_DESC_CMD_ICRC;
3659 3659
diff --git a/drivers/net/ethernet/intel/iavf/iavf_txrx.c b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
index fb9bfad96daf..3b1dc77ae368 100644
--- a/drivers/net/ethernet/intel/iavf/iavf_txrx.c
+++ b/drivers/net/ethernet/intel/iavf/iavf_txrx.c
@@ -2343,6 +2343,8 @@ static inline void iavf_tx_map(struct iavf_ring *tx_ring, struct sk_buff *skb,
2343 tx_desc->cmd_type_offset_bsz = 2343 tx_desc->cmd_type_offset_bsz =
2344 build_ctob(td_cmd, td_offset, size, td_tag); 2344 build_ctob(td_cmd, td_offset, size, td_tag);
2345 2345
2346 skb_tx_timestamp(skb);
2347
2346 /* Force memory writes to complete before letting h/w know there 2348 /* Force memory writes to complete before letting h/w know there
2347 * are new descriptors to fetch. 2349 * are new descriptors to fetch.
2348 * 2350 *
@@ -2461,8 +2463,6 @@ static netdev_tx_t iavf_xmit_frame_ring(struct sk_buff *skb,
2461 if (tso < 0) 2463 if (tso < 0)
2462 goto out_drop; 2464 goto out_drop;
2463 2465
2464 skb_tx_timestamp(skb);
2465
2466 /* always enable CRC insertion offload */ 2466 /* always enable CRC insertion offload */
2467 td_cmd |= IAVF_TX_DESC_CMD_ICRC; 2467 td_cmd |= IAVF_TX_DESC_CMD_ICRC;
2468 2468
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 5df88ad8ac81..4584ebc9e8fe 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -6019,6 +6019,8 @@ static int igb_tx_map(struct igb_ring *tx_ring,
6019 /* set the timestamp */ 6019 /* set the timestamp */
6020 first->time_stamp = jiffies; 6020 first->time_stamp = jiffies;
6021 6021
6022 skb_tx_timestamp(skb);
6023
6022 /* Force memory writes to complete before letting h/w know there 6024 /* Force memory writes to complete before letting h/w know there
6023 * are new descriptors to fetch. (Only applicable for weak-ordered 6025 * are new descriptors to fetch. (Only applicable for weak-ordered
6024 * memory model archs, such as IA-64). 6026 * memory model archs, such as IA-64).
@@ -6147,8 +6149,6 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
6147 else if (!tso) 6149 else if (!tso)
6148 igb_tx_csum(tx_ring, first); 6150 igb_tx_csum(tx_ring, first);
6149 6151
6150 skb_tx_timestamp(skb);
6151
6152 if (igb_tx_map(tx_ring, first, hdr_len)) 6152 if (igb_tx_map(tx_ring, first, hdr_len))
6153 goto cleanup_tx_tstamp; 6153 goto cleanup_tx_tstamp;
6154 6154
diff --git a/drivers/net/ethernet/intel/igc/igc_main.c b/drivers/net/ethernet/intel/igc/igc_main.c
index 9d85707e8a81..615a5fcd5a00 100644
--- a/drivers/net/ethernet/intel/igc/igc_main.c
+++ b/drivers/net/ethernet/intel/igc/igc_main.c
@@ -865,6 +865,8 @@ static int igc_tx_map(struct igc_ring *tx_ring,
865 /* set the timestamp */ 865 /* set the timestamp */
866 first->time_stamp = jiffies; 866 first->time_stamp = jiffies;
867 867
868 skb_tx_timestamp(skb);
869
868 /* Force memory writes to complete before letting h/w know there 870 /* Force memory writes to complete before letting h/w know there
869 * are new descriptors to fetch. (Only applicable for weak-ordered 871 * are new descriptors to fetch. (Only applicable for weak-ordered
870 * memory model archs, such as IA-64). 872 * memory model archs, such as IA-64).
@@ -959,8 +961,6 @@ static netdev_tx_t igc_xmit_frame_ring(struct sk_buff *skb,
959 first->bytecount = skb->len; 961 first->bytecount = skb->len;
960 first->gso_segs = 1; 962 first->gso_segs = 1;
961 963
962 skb_tx_timestamp(skb);
963
964 /* record initial flags and protocol */ 964 /* record initial flags and protocol */
965 first->tx_flags = tx_flags; 965 first->tx_flags = tx_flags;
966 first->protocol = protocol; 966 first->protocol = protocol;
diff --git a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
index aeda1834e66a..cfb83687c3d8 100644
--- a/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
+++ b/drivers/net/ethernet/intel/ixgbe/ixgbe_main.c
@@ -8269,6 +8269,8 @@ static int ixgbe_tx_map(struct ixgbe_ring *tx_ring,
8269 /* set the timestamp */ 8269 /* set the timestamp */
8270 first->time_stamp = jiffies; 8270 first->time_stamp = jiffies;
8271 8271
8272 skb_tx_timestamp(skb);
8273
8272 /* 8274 /*
8273 * Force memory writes to complete before letting h/w know there 8275 * Force memory writes to complete before letting h/w know there
8274 * are new descriptors to fetch. (Only applicable for weak-ordered 8276 * 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,
8646 } 8648 }
8647 } 8649 }
8648 8650
8649 skb_tx_timestamp(skb);
8650
8651#ifdef CONFIG_PCI_IOV 8651#ifdef CONFIG_PCI_IOV
8652 /* 8652 /*
8653 * Use the l2switch_enable flag - would be false if the DMA 8653 * Use the l2switch_enable flag - would be false if the DMA