aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2013-02-07 03:55:46 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2013-04-18 19:40:07 -0400
commitb646c22edef1c350d26237a6f60d3a890ceedf6e (patch)
tree279301c5ad4c7efb3afc87fa8b888c3fe929d2f8
parentb9555f6627656309c01b0c077dcecbee0ac9343f (diff)
igb: Pull adapter out of main path in igb_xmit_frame_ring
We only need the adapter pointer in the case of ptp. As such we can pull the adapter out of the main path and place it inside the if statement to avoid the temptation of accessing the adapter pointer in the fast path. Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Tested-by: Aaron Brown <aaron.f.brown@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 2f3dab079900..d27eb4ed7a09 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -4593,7 +4593,6 @@ static inline int igb_maybe_stop_tx(struct igb_ring *tx_ring, const u16 size)
4593netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb, 4593netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
4594 struct igb_ring *tx_ring) 4594 struct igb_ring *tx_ring)
4595{ 4595{
4596 struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
4597 struct igb_tx_buffer *first; 4596 struct igb_tx_buffer *first;
4598 int tso; 4597 int tso;
4599 u32 tx_flags = 0; 4598 u32 tx_flags = 0;
@@ -4628,15 +4627,18 @@ netdev_tx_t igb_xmit_frame_ring(struct sk_buff *skb,
4628 4627
4629 skb_tx_timestamp(skb); 4628 skb_tx_timestamp(skb);
4630 4629
4631 if (unlikely((skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP) && 4630 if (unlikely(skb_shinfo(skb)->tx_flags & SKBTX_HW_TSTAMP)) {
4632 !(adapter->ptp_tx_skb))) { 4631 struct igb_adapter *adapter = netdev_priv(tx_ring->netdev);
4633 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
4634 tx_flags |= IGB_TX_FLAGS_TSTAMP;
4635 4632
4636 adapter->ptp_tx_skb = skb_get(skb); 4633 if (!(adapter->ptp_tx_skb)) {
4637 adapter->ptp_tx_start = jiffies; 4634 skb_shinfo(skb)->tx_flags |= SKBTX_IN_PROGRESS;
4638 if (adapter->hw.mac.type == e1000_82576) 4635 tx_flags |= IGB_TX_FLAGS_TSTAMP;
4639 schedule_work(&adapter->ptp_tx_work); 4636
4637 adapter->ptp_tx_skb = skb_get(skb);
4638 adapter->ptp_tx_start = jiffies;
4639 if (adapter->hw.mac.type == e1000_82576)
4640 schedule_work(&adapter->ptp_tx_work);
4641 }
4640 } 4642 }
4641 4643
4642 if (vlan_tx_tag_present(skb)) { 4644 if (vlan_tx_tag_present(skb)) {