aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/igb/igb_ethtool.c
diff options
context:
space:
mode:
authorAlexander Duyck <alexander.h.duyck@intel.com>2008-07-08 18:14:44 -0400
committerJeff Garzik <jgarzik@redhat.com>2008-07-11 01:20:33 -0400
commit6eb5a7f1dbd56883680290f6a0bd2d8d15f8ff58 (patch)
treeee4b0be39dba02863ae3e260b2b8c210e7535929 /drivers/net/igb/igb_ethtool.c
parent9280fa5201d7f69b20af4b7efadb5fe8f2f67277 (diff)
igb: Improve multiqueue AIM support
Improve multiqueue performance Change itr_val to reflect ITR timer value instead of ints/sec Cleaned up AIM algorithms in general Based on work by Mitch Williams Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com> Acked-by: Mitch Williams <mitch.a.williams@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
Diffstat (limited to 'drivers/net/igb/igb_ethtool.c')
-rw-r--r--drivers/net/igb/igb_ethtool.c17
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/net/igb/igb_ethtool.c b/drivers/net/igb/igb_ethtool.c
index 7db183093768..11aee1309951 100644
--- a/drivers/net/igb/igb_ethtool.c
+++ b/drivers/net/igb/igb_ethtool.c
@@ -1861,6 +1861,8 @@ static int igb_set_coalesce(struct net_device *netdev,
1861 struct ethtool_coalesce *ec) 1861 struct ethtool_coalesce *ec)
1862{ 1862{
1863 struct igb_adapter *adapter = netdev_priv(netdev); 1863 struct igb_adapter *adapter = netdev_priv(netdev);
1864 struct e1000_hw *hw = &adapter->hw;
1865 int i;
1864 1866
1865 if ((ec->rx_coalesce_usecs > IGB_MAX_ITR_USECS) || 1867 if ((ec->rx_coalesce_usecs > IGB_MAX_ITR_USECS) ||
1866 ((ec->rx_coalesce_usecs > 3) && 1868 ((ec->rx_coalesce_usecs > 3) &&
@@ -1869,13 +1871,16 @@ static int igb_set_coalesce(struct net_device *netdev,
1869 return -EINVAL; 1871 return -EINVAL;
1870 1872
1871 /* convert to rate of irq's per second */ 1873 /* convert to rate of irq's per second */
1872 if (ec->rx_coalesce_usecs <= 3) 1874 if (ec->rx_coalesce_usecs && ec->rx_coalesce_usecs <= 3) {
1873 adapter->itr_setting = ec->rx_coalesce_usecs; 1875 adapter->itr_setting = ec->rx_coalesce_usecs;
1874 else 1876 adapter->itr = IGB_START_ITR;
1875 adapter->itr_setting = (1000000 / ec->rx_coalesce_usecs); 1877 } else {
1878 adapter->itr_setting = ec->rx_coalesce_usecs << 2;
1879 adapter->itr = adapter->itr_setting;
1880 }
1876 1881
1877 if (netif_running(netdev)) 1882 for (i = 0; i < adapter->num_rx_queues; i++)
1878 igb_reinit_locked(adapter); 1883 wr32(adapter->rx_ring[i].itr_register, adapter->itr);
1879 1884
1880 return 0; 1885 return 0;
1881} 1886}
@@ -1888,7 +1893,7 @@ static int igb_get_coalesce(struct net_device *netdev,
1888 if (adapter->itr_setting <= 3) 1893 if (adapter->itr_setting <= 3)
1889 ec->rx_coalesce_usecs = adapter->itr_setting; 1894 ec->rx_coalesce_usecs = adapter->itr_setting;
1890 else 1895 else
1891 ec->rx_coalesce_usecs = 1000000 / adapter->itr_setting; 1896 ec->rx_coalesce_usecs = adapter->itr_setting >> 2;
1892 1897
1893 return 0; 1898 return 0;
1894} 1899}