aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ethernet/intel
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2011-08-26 03:43:27 -0400
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-09-20 02:56:33 -0400
commita74420e0f3bdb4bfd8b59a4e67442d642f22e5b9 (patch)
tree3693e584cfbd2095a498af6c17d9ebc7412ab22e /drivers/net/ethernet/intel
parent765cf9976e937f1cfe9159bf4534967c8bf8eb6d (diff)
igb: Update RXDCTL/TXDCTL configurations
This change cleans up the RXDCTL and TXDCTL configurations and optimizes RX performance by allowing back write-backs on all hardware other than 82576. 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')
-rw-r--r--drivers/net/ethernet/intel/igb/igb.h5
-rw-r--r--drivers/net/ethernet/intel/igb/igb_main.c23
2 files changed, 12 insertions, 16 deletions
diff --git a/drivers/net/ethernet/intel/igb/igb.h b/drivers/net/ethernet/intel/igb/igb.h
index 265e151b66c4..577fd3e797e5 100644
--- a/drivers/net/ethernet/intel/igb/igb.h
+++ b/drivers/net/ethernet/intel/igb/igb.h
@@ -100,11 +100,12 @@ struct vf_data_storage {
100 */ 100 */
101#define IGB_RX_PTHRESH 8 101#define IGB_RX_PTHRESH 8
102#define IGB_RX_HTHRESH 8 102#define IGB_RX_HTHRESH 8
103#define IGB_RX_WTHRESH 1
104#define IGB_TX_PTHRESH 8 103#define IGB_TX_PTHRESH 8
105#define IGB_TX_HTHRESH 1 104#define IGB_TX_HTHRESH 1
105#define IGB_RX_WTHRESH ((hw->mac.type == e1000_82576 && \
106 adapter->msix_entries) ? 1 : 4)
106#define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \ 107#define IGB_TX_WTHRESH ((hw->mac.type == e1000_82576 && \
107 adapter->msix_entries) ? 1 : 16) 108 adapter->msix_entries) ? 1 : 16)
108 109
109/* this is the size past which hardware will drop packets when setting LPE=0 */ 110/* this is the size past which hardware will drop packets when setting LPE=0 */
110#define MAXIMUM_ETHERNET_VLAN_SIZE 1522 111#define MAXIMUM_ETHERNET_VLAN_SIZE 1522
diff --git a/drivers/net/ethernet/intel/igb/igb_main.c b/drivers/net/ethernet/intel/igb/igb_main.c
index 3cb1bc96bf70..aa78c10a2ec3 100644
--- a/drivers/net/ethernet/intel/igb/igb_main.c
+++ b/drivers/net/ethernet/intel/igb/igb_main.c
@@ -2666,14 +2666,12 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
2666 struct igb_ring *ring) 2666 struct igb_ring *ring)
2667{ 2667{
2668 struct e1000_hw *hw = &adapter->hw; 2668 struct e1000_hw *hw = &adapter->hw;
2669 u32 txdctl; 2669 u32 txdctl = 0;
2670 u64 tdba = ring->dma; 2670 u64 tdba = ring->dma;
2671 int reg_idx = ring->reg_idx; 2671 int reg_idx = ring->reg_idx;
2672 2672
2673 /* disable the queue */ 2673 /* disable the queue */
2674 txdctl = rd32(E1000_TXDCTL(reg_idx)); 2674 wr32(E1000_TXDCTL(reg_idx), 0);
2675 wr32(E1000_TXDCTL(reg_idx),
2676 txdctl & ~E1000_TXDCTL_QUEUE_ENABLE);
2677 wrfl(); 2675 wrfl();
2678 mdelay(10); 2676 mdelay(10);
2679 2677
@@ -2685,7 +2683,7 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
2685 2683
2686 ring->head = hw->hw_addr + E1000_TDH(reg_idx); 2684 ring->head = hw->hw_addr + E1000_TDH(reg_idx);
2687 ring->tail = hw->hw_addr + E1000_TDT(reg_idx); 2685 ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
2688 writel(0, ring->head); 2686 wr32(E1000_TDH(reg_idx), 0);
2689 writel(0, ring->tail); 2687 writel(0, ring->tail);
2690 2688
2691 txdctl |= IGB_TX_PTHRESH; 2689 txdctl |= IGB_TX_PTHRESH;
@@ -3028,12 +3026,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
3028 struct e1000_hw *hw = &adapter->hw; 3026 struct e1000_hw *hw = &adapter->hw;
3029 u64 rdba = ring->dma; 3027 u64 rdba = ring->dma;
3030 int reg_idx = ring->reg_idx; 3028 int reg_idx = ring->reg_idx;
3031 u32 srrctl, rxdctl; 3029 u32 srrctl = 0, rxdctl = 0;
3032 3030
3033 /* disable the queue */ 3031 /* disable the queue */
3034 rxdctl = rd32(E1000_RXDCTL(reg_idx)); 3032 wr32(E1000_RXDCTL(reg_idx), 0);
3035 wr32(E1000_RXDCTL(reg_idx),
3036 rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE);
3037 3033
3038 /* Set DMA base address registers */ 3034 /* Set DMA base address registers */
3039 wr32(E1000_RDBAL(reg_idx), 3035 wr32(E1000_RDBAL(reg_idx),
@@ -3045,7 +3041,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
3045 /* initialize head and tail */ 3041 /* initialize head and tail */
3046 ring->head = hw->hw_addr + E1000_RDH(reg_idx); 3042 ring->head = hw->hw_addr + E1000_RDH(reg_idx);
3047 ring->tail = hw->hw_addr + E1000_RDT(reg_idx); 3043 ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
3048 writel(0, ring->head); 3044 wr32(E1000_RDH(reg_idx), 0);
3049 writel(0, ring->tail); 3045 writel(0, ring->tail);
3050 3046
3051 /* set descriptor configuration */ 3047 /* set descriptor configuration */
@@ -3076,13 +3072,12 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
3076 /* set filtering for VMDQ pools */ 3072 /* set filtering for VMDQ pools */
3077 igb_set_vmolr(adapter, reg_idx & 0x7, true); 3073 igb_set_vmolr(adapter, reg_idx & 0x7, true);
3078 3074
3079 /* enable receive descriptor fetching */
3080 rxdctl = rd32(E1000_RXDCTL(reg_idx));
3081 rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
3082 rxdctl &= 0xFFF00000;
3083 rxdctl |= IGB_RX_PTHRESH; 3075 rxdctl |= IGB_RX_PTHRESH;
3084 rxdctl |= IGB_RX_HTHRESH << 8; 3076 rxdctl |= IGB_RX_HTHRESH << 8;
3085 rxdctl |= IGB_RX_WTHRESH << 16; 3077 rxdctl |= IGB_RX_WTHRESH << 16;
3078
3079 /* enable receive descriptor fetching */
3080 rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
3086 wr32(E1000_RXDCTL(reg_idx), rxdctl); 3081 wr32(E1000_RXDCTL(reg_idx), rxdctl);
3087} 3082}
3088 3083