diff options
author | Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com> | 2008-03-03 18:03:57 -0500 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2008-03-17 07:49:28 -0400 |
commit | f494e8faa77bd4147324f7666441e0b780e7db94 (patch) | |
tree | adcb7b1f344209de1db703abd1d1b25e497a613b /drivers/net/ixgbe/ixgbe_ethtool.c | |
parent | 30eba97a3f076cf4e100b598ee9a1b1439b0cfaa (diff) |
ixgbe: Introduce adaptive interrupt moderation
82598 can produce a formidable interrupt rate, and is largely
unusable without some form of moderation. The default behaviour
before this patch is to limit irq's to a reasonable number.
However, just like our other drivers we can reduce latency
for small packet-type traffic considerably by allowing the
irq rate to go up dynamically.
This patch introduces a simple irq moderation algorithm based
on traffic analysis. The driver will use more CPU to service
small packets quicker but will perform the same on bulk traffic
as the old code.
Signed-off-by: Ayyappan Veeraiyan <ayyappan.veeraiyan@intel.com>
Signed-off-by: Auke Kok <auke-jan.h.kok@intel.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_ethtool.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_ethtool.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/drivers/net/ixgbe/ixgbe_ethtool.c b/drivers/net/ixgbe/ixgbe_ethtool.c index 85b7d15e1217..4e463778bcfd 100644 --- a/drivers/net/ixgbe/ixgbe_ethtool.c +++ b/drivers/net/ixgbe/ixgbe_ethtool.c | |||
@@ -886,13 +886,13 @@ static int ixgbe_get_coalesce(struct net_device *netdev, | |||
886 | { | 886 | { |
887 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 887 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
888 | 888 | ||
889 | if (adapter->rx_eitr == 0) | 889 | if (adapter->rx_eitr < IXGBE_MIN_ITR_USECS) |
890 | ec->rx_coalesce_usecs = 0; | 890 | ec->rx_coalesce_usecs = adapter->rx_eitr; |
891 | else | 891 | else |
892 | ec->rx_coalesce_usecs = 1000000 / adapter->rx_eitr; | 892 | ec->rx_coalesce_usecs = 1000000 / adapter->rx_eitr; |
893 | 893 | ||
894 | if (adapter->tx_eitr == 0) | 894 | if (adapter->tx_eitr < IXGBE_MIN_ITR_USECS) |
895 | ec->tx_coalesce_usecs = 0; | 895 | ec->tx_coalesce_usecs = adapter->tx_eitr; |
896 | else | 896 | else |
897 | ec->tx_coalesce_usecs = 1000000 / adapter->tx_eitr; | 897 | ec->tx_coalesce_usecs = 1000000 / adapter->tx_eitr; |
898 | 898 | ||
@@ -906,22 +906,26 @@ static int ixgbe_set_coalesce(struct net_device *netdev, | |||
906 | struct ixgbe_adapter *adapter = netdev_priv(netdev); | 906 | struct ixgbe_adapter *adapter = netdev_priv(netdev); |
907 | 907 | ||
908 | if ((ec->rx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || | 908 | if ((ec->rx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || |
909 | ((ec->rx_coalesce_usecs > 0) && | 909 | ((ec->rx_coalesce_usecs != 0) && |
910 | (ec->rx_coalesce_usecs != 1) && | ||
911 | (ec->rx_coalesce_usecs != 3) && | ||
910 | (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) | 912 | (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) |
911 | return -EINVAL; | 913 | return -EINVAL; |
912 | if ((ec->tx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || | 914 | if ((ec->tx_coalesce_usecs > IXGBE_MAX_ITR_USECS) || |
913 | ((ec->tx_coalesce_usecs > 0) && | 915 | ((ec->tx_coalesce_usecs != 0) && |
916 | (ec->tx_coalesce_usecs != 1) && | ||
917 | (ec->tx_coalesce_usecs != 3) && | ||
914 | (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) | 918 | (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS))) |
915 | return -EINVAL; | 919 | return -EINVAL; |
916 | 920 | ||
917 | /* convert to rate of irq's per second */ | 921 | /* convert to rate of irq's per second */ |
918 | if (ec->rx_coalesce_usecs == 0) | 922 | if (ec->rx_coalesce_usecs < IXGBE_MIN_ITR_USECS) |
919 | adapter->rx_eitr = 0; | 923 | adapter->rx_eitr = ec->rx_coalesce_usecs; |
920 | else | 924 | else |
921 | adapter->rx_eitr = (1000000 / ec->rx_coalesce_usecs); | 925 | adapter->rx_eitr = (1000000 / ec->rx_coalesce_usecs); |
922 | 926 | ||
923 | if (ec->tx_coalesce_usecs == 0) | 927 | if (ec->tx_coalesce_usecs < IXGBE_MIN_ITR_USECS) |
924 | adapter->tx_eitr = 0; | 928 | adapter->tx_eitr = ec->rx_coalesce_usecs; |
925 | else | 929 | else |
926 | adapter->tx_eitr = (1000000 / ec->tx_coalesce_usecs); | 930 | adapter->tx_eitr = (1000000 / ec->tx_coalesce_usecs); |
927 | 931 | ||