igb: remove adaptive IFS from driver
authorNick Nunley <nicholasx.d.nunley@intel.com>
Wed, 17 Feb 2010 01:02:59 +0000 (01:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Wed, 17 Feb 2010 21:21:34 +0000 (13:21 -0800)
Adaptive IFS support has been included in the igb driver since its
initial release, but it is not a feature on any igb NICs. This patch
removes it from the driver.

Signed-off-by: Nicholas Nunley <nicholasx.d.nunley@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/igb/e1000_defines.h
drivers/net/igb/e1000_hw.h
drivers/net/igb/e1000_mac.c
drivers/net/igb/e1000_mac.h
drivers/net/igb/igb_main.c

index c0171507076410c57e082cbe48dab3409006fbc8..fe6cf1b696c783b7ce754fca7530f7cdaea618be 100644 (file)
 #define E1000_PBA_34K 0x0022
 #define E1000_PBA_64K 0x0040    /* 64KB */
 
-#define IFS_MAX       80
-#define IFS_MIN       40
-#define IFS_RATIO     4
-#define IFS_STEP      10
-#define MIN_NUM_XMITS 1000
-
 /* SW Semaphore Register */
 #define E1000_SWSM_SMBI         0x00000001 /* Driver Semaphore bit */
 #define E1000_SWSM_SWESMBI      0x00000002 /* FW Semaphore bit */
index dbaeb5f5e0c72529ab1ced7e35ce2a4fa5486de9..448005276b26b68bdba25be9606aa41185a7ebe6 100644 (file)
@@ -339,19 +339,12 @@ struct e1000_mac_info {
 
        enum e1000_mac_type type;
 
-       u32 collision_delta;
        u32 ledctl_default;
        u32 ledctl_mode1;
        u32 ledctl_mode2;
        u32 mc_filter_type;
-       u32 tx_packet_delta;
        u32 txcw;
 
-       u16 current_ifs_val;
-       u16 ifs_max_val;
-       u16 ifs_min_val;
-       u16 ifs_ratio;
-       u16 ifs_step_size;
        u16 mta_reg_count;
        u16 uta_reg_count;
 
index 2ad358a240bf742848c997a7bf8689ab92fe0a4a..2a8a886b37eb698bfed13f145b3e677cf363e9c2 100644 (file)
@@ -1303,76 +1303,6 @@ out:
        return ret_val;
 }
 
-/**
- *  igb_reset_adaptive - Reset Adaptive Interframe Spacing
- *  @hw: pointer to the HW structure
- *
- *  Reset the Adaptive Interframe Spacing throttle to default values.
- **/
-void igb_reset_adaptive(struct e1000_hw *hw)
-{
-       struct e1000_mac_info *mac = &hw->mac;
-
-       if (!mac->adaptive_ifs) {
-               hw_dbg("Not in Adaptive IFS mode!\n");
-               goto out;
-       }
-
-       if (!mac->ifs_params_forced) {
-               mac->current_ifs_val = 0;
-               mac->ifs_min_val = IFS_MIN;
-               mac->ifs_max_val = IFS_MAX;
-               mac->ifs_step_size = IFS_STEP;
-               mac->ifs_ratio = IFS_RATIO;
-       }
-
-       mac->in_ifs_mode = false;
-       wr32(E1000_AIT, 0);
-out:
-       return;
-}
-
-/**
- *  igb_update_adaptive - Update Adaptive Interframe Spacing
- *  @hw: pointer to the HW structure
- *
- *  Update the Adaptive Interframe Spacing Throttle value based on the
- *  time between transmitted packets and time between collisions.
- **/
-void igb_update_adaptive(struct e1000_hw *hw)
-{
-       struct e1000_mac_info *mac = &hw->mac;
-
-       if (!mac->adaptive_ifs) {
-               hw_dbg("Not in Adaptive IFS mode!\n");
-               goto out;
-       }
-
-       if ((mac->collision_delta * mac->ifs_ratio) > mac->tx_packet_delta) {
-               if (mac->tx_packet_delta > MIN_NUM_XMITS) {
-                       mac->in_ifs_mode = true;
-                       if (mac->current_ifs_val < mac->ifs_max_val) {
-                               if (!mac->current_ifs_val)
-                                       mac->current_ifs_val = mac->ifs_min_val;
-                               else
-                                       mac->current_ifs_val +=
-                                               mac->ifs_step_size;
-                               wr32(E1000_AIT,
-                                               mac->current_ifs_val);
-                       }
-               }
-       } else {
-               if (mac->in_ifs_mode &&
-                   (mac->tx_packet_delta <= MIN_NUM_XMITS)) {
-                       mac->current_ifs_val = 0;
-                       mac->in_ifs_mode = false;
-                       wr32(E1000_AIT, 0);
-               }
-       }
-out:
-       return;
-}
-
 /**
  *  igb_validate_mdi_setting - Verify MDI/MDIx settings
  *  @hw: pointer to the HW structure
index bca17d88241731c344a3e3a9f1fc49f1d6069def..601be99711c26c8f85783af8da91ab7bc5240ecf 100644 (file)
@@ -67,8 +67,6 @@ void igb_mta_set(struct e1000_hw *hw, u32 hash_value);
 void igb_put_hw_semaphore(struct e1000_hw *hw);
 void igb_rar_set(struct e1000_hw *hw, u8 *addr, u32 index);
 s32  igb_check_alt_mac_addr(struct e1000_hw *hw);
-void igb_reset_adaptive(struct e1000_hw *hw);
-void igb_update_adaptive(struct e1000_hw *hw);
 
 bool igb_enable_mng_pass_thru(struct e1000_hw *hw);
 
index 30fb5a89c42d5a978adb935ce202951f42824bac..eb48e1a084ddc3b35490eadf4fe937ff0852eb36 100644 (file)
@@ -1365,7 +1365,6 @@ void igb_reset(struct igb_adapter *adapter)
        /* Enable h/w to recognize an 802.1Q VLAN Ethernet packet */
        wr32(E1000_VET, ETHERNET_IEEE_VLAN_TYPE);
 
-       igb_reset_adaptive(hw);
        igb_get_phy_info(hw);
 }
 
@@ -1508,7 +1507,6 @@ static int __devinit igb_probe(struct pci_dev *pdev,
        igb_get_bus_info_pcie(hw);
 
        hw->phy.autoneg_wait_to_complete = false;
-       hw->mac.adaptive_ifs = true;
 
        /* Copper options */
        if (hw->phy.media_type == e1000_media_type_copper) {
@@ -3159,7 +3157,6 @@ static void igb_watchdog_task(struct work_struct *work)
        }
 
        igb_update_stats(adapter);
-       igb_update_adaptive(hw);
 
        for (i = 0; i < adapter->num_tx_queues; i++) {
                struct igb_ring *tx_ring = adapter->tx_ring[i];
@@ -4064,11 +4061,8 @@ void igb_update_stats(struct igb_adapter *adapter)
        adapter->stats.mptc += rd32(E1000_MPTC);
        adapter->stats.bptc += rd32(E1000_BPTC);
 
-       /* used for adaptive IFS */
-       hw->mac.tx_packet_delta = rd32(E1000_TPT);
-       adapter->stats.tpt += hw->mac.tx_packet_delta;
-       hw->mac.collision_delta = rd32(E1000_COLC);
-       adapter->stats.colc += hw->mac.collision_delta;
+       adapter->stats.tpt += rd32(E1000_TPT);
+       adapter->stats.colc += rd32(E1000_COLC);
 
        adapter->stats.algnerrc += rd32(E1000_ALGNERRC);
        adapter->stats.rxerrc += rd32(E1000_RXERRC);