aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel/igb/igb_ethtool.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-08-26 03:46:03 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-10-08 01:49:19 -0400
commit3ceb90fd4898853cdac43084f0c6ee7270cb15f3 (patch)
tree97526ddf3e00da217061063a30fba616e982d4b5 /drivers/net/ethernet/intel/igb/igb_ethtool.c
parent294e7d78f5b929536b81620ed33c6507f2921463 (diff)
igb: leave staterr in place and instead us a helper function to check bits
Instead of doing a byte swap on the staterr bits in the Rx descriptor we can save ourselves a bit of space and some CPU time by instead just testing for the various bits out of the Rx descriptor directly. 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>
Diffstat (limited to 'drivers/net/ethernet/intel/igb/igb_ethtool.c')
-rw-r--r--drivers/net/ethernet/intel/igb/igb_ethtool.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb_ethtool.c b/drivers/net/ethernet/intel/igb/igb_ethtool.c
index 5ebe992010d6..bc198ea2bc14 100644
--- a/drivers/net/ethernet/intel/igb/igb_ethtool.c
+++ b/drivers/net/ethernet/intel/igb/igb_ethtool.c
@@ -1581,16 +1581,14 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
1581 union e1000_adv_rx_desc *rx_desc; 1581 union e1000_adv_rx_desc *rx_desc;
1582 struct igb_rx_buffer *rx_buffer_info; 1582 struct igb_rx_buffer *rx_buffer_info;
1583 struct igb_tx_buffer *tx_buffer_info; 1583 struct igb_tx_buffer *tx_buffer_info;
1584 u32 staterr;
1585 u16 rx_ntc, tx_ntc, count = 0; 1584 u16 rx_ntc, tx_ntc, count = 0;
1586 1585
1587 /* initialize next to clean and descriptor values */ 1586 /* initialize next to clean and descriptor values */
1588 rx_ntc = rx_ring->next_to_clean; 1587 rx_ntc = rx_ring->next_to_clean;
1589 tx_ntc = tx_ring->next_to_clean; 1588 tx_ntc = tx_ring->next_to_clean;
1590 rx_desc = IGB_RX_DESC(rx_ring, rx_ntc); 1589 rx_desc = IGB_RX_DESC(rx_ring, rx_ntc);
1591 staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
1592 1590
1593 while (staterr & E1000_RXD_STAT_DD) { 1591 while (igb_test_staterr(rx_desc, E1000_RXD_STAT_DD)) {
1594 /* check rx buffer */ 1592 /* check rx buffer */
1595 rx_buffer_info = &rx_ring->rx_buffer_info[rx_ntc]; 1593 rx_buffer_info = &rx_ring->rx_buffer_info[rx_ntc];
1596 1594
@@ -1619,7 +1617,6 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
1619 1617
1620 /* fetch next descriptor */ 1618 /* fetch next descriptor */
1621 rx_desc = IGB_RX_DESC(rx_ring, rx_ntc); 1619 rx_desc = IGB_RX_DESC(rx_ring, rx_ntc);
1622 staterr = le32_to_cpu(rx_desc->wb.upper.status_error);
1623 } 1620 }
1624 1621
1625 /* re-map buffers to ring, store next to clean values */ 1622 /* re-map buffers to ring, store next to clean values */