]> www.infradead.org Git - users/jedix/linux-maple.git/commitdiff
igb: Update RXDCTL/TXDCTL configurations
authorAlexander Duyck <alexander.h.duyck@intel.com>
Fri, 26 Aug 2011 07:43:27 +0000 (07:43 +0000)
committerJoe Jin <joe.jin@oracle.com>
Thu, 17 May 2012 08:23:19 +0000 (16:23 +0800)
This change cleans up the RXDCTL and TXDCTL configurations and optimizes RX
performance by allowing back write-backs on all hardware other than 82576.

(cherry picked from commit a74420e0f3bdb4bfd8b59a4e67442d642f22e5b9)
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>
Signed-off-by: Joe Jin <joe.jin@oracle.com>
drivers/net/igb/igb.h
drivers/net/igb/igb_main.c

index 265e151b66c44d5b9221f91c7bfd38260db397f6..577fd3e797e57d112f5f5e549fd2d9aae9c49f5b 100644 (file)
@@ -100,11 +100,12 @@ struct vf_data_storage {
  */
 #define IGB_RX_PTHRESH                     8
 #define IGB_RX_HTHRESH                     8
-#define IGB_RX_WTHRESH                     1
 #define IGB_TX_PTHRESH                     8
 #define IGB_TX_HTHRESH                     1
+#define IGB_RX_WTHRESH                     ((hw->mac.type == e1000_82576 && \
+                                            adapter->msix_entries) ? 1 : 4)
 #define IGB_TX_WTHRESH                     ((hw->mac.type == e1000_82576 && \
-                                             adapter->msix_entries) ? 1 : 16)
+                                            adapter->msix_entries) ? 1 : 16)
 
 /* this is the size past which hardware will drop packets when setting LPE=0 */
 #define MAXIMUM_ETHERNET_VLAN_SIZE 1522
index 592b5c1827bcecd0ab5695ab04408e669fde83e3..49b0f51c7778e4dc741e59631cd1c585f092333e 100644 (file)
@@ -2667,14 +2667,12 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
                            struct igb_ring *ring)
 {
        struct e1000_hw *hw = &adapter->hw;
-       u32 txdctl;
+       u32 txdctl = 0;
        u64 tdba = ring->dma;
        int reg_idx = ring->reg_idx;
 
        /* disable the queue */
-       txdctl = rd32(E1000_TXDCTL(reg_idx));
-       wr32(E1000_TXDCTL(reg_idx),
-                       txdctl & ~E1000_TXDCTL_QUEUE_ENABLE);
+       wr32(E1000_TXDCTL(reg_idx), 0);
        wrfl();
        mdelay(10);
 
@@ -2686,7 +2684,7 @@ void igb_configure_tx_ring(struct igb_adapter *adapter,
 
        ring->head = hw->hw_addr + E1000_TDH(reg_idx);
        ring->tail = hw->hw_addr + E1000_TDT(reg_idx);
-       writel(0, ring->head);
+       wr32(E1000_TDH(reg_idx), 0);
        writel(0, ring->tail);
 
        txdctl |= IGB_TX_PTHRESH;
@@ -3029,12 +3027,10 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
        struct e1000_hw *hw = &adapter->hw;
        u64 rdba = ring->dma;
        int reg_idx = ring->reg_idx;
-       u32 srrctl, rxdctl;
+       u32 srrctl = 0, rxdctl = 0;
 
        /* disable the queue */
-       rxdctl = rd32(E1000_RXDCTL(reg_idx));
-       wr32(E1000_RXDCTL(reg_idx),
-                       rxdctl & ~E1000_RXDCTL_QUEUE_ENABLE);
+       wr32(E1000_RXDCTL(reg_idx), 0);
 
        /* Set DMA base address registers */
        wr32(E1000_RDBAL(reg_idx),
@@ -3046,7 +3042,7 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
        /* initialize head and tail */
        ring->head = hw->hw_addr + E1000_RDH(reg_idx);
        ring->tail = hw->hw_addr + E1000_RDT(reg_idx);
-       writel(0, ring->head);
+       wr32(E1000_RDH(reg_idx), 0);
        writel(0, ring->tail);
 
        /* set descriptor configuration */
@@ -3077,13 +3073,12 @@ void igb_configure_rx_ring(struct igb_adapter *adapter,
        /* set filtering for VMDQ pools */
        igb_set_vmolr(adapter, reg_idx & 0x7, true);
 
-       /* enable receive descriptor fetching */
-       rxdctl = rd32(E1000_RXDCTL(reg_idx));
-       rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
-       rxdctl &= 0xFFF00000;
        rxdctl |= IGB_RX_PTHRESH;
        rxdctl |= IGB_RX_HTHRESH << 8;
        rxdctl |= IGB_RX_WTHRESH << 16;
+
+       /* enable receive descriptor fetching */
+       rxdctl |= E1000_RXDCTL_QUEUE_ENABLE;
        wr32(E1000_RXDCTL(reg_idx), rxdctl);
 }