aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/tg3.c
diff options
context:
space:
mode:
authorMatt Carlson <mcarlson@broadcom.com>2009-09-01 09:12:00 -0400
committerDavid S. Miller <davem@davemloft.net>2009-09-02 03:43:46 -0400
commitb6080e126012047d42e53154189fdca286d0600e (patch)
tree254fb744e29dab5fc17baf4e37287a742dda9452 /drivers/net/tg3.c
parentfed9781081aa9600765346c108ff22751e003715 (diff)
tg3: Add coalesce parameters for msix vectors
This patch adds code to tune the coalescing parameters for the other msix vectors. Signed-off-by: Matt Carlson <mcarlson@broadcom.com> Reviewed-by: Benjamin Li <benli@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tg3.c')
-rw-r--r--drivers/net/tg3.c57
1 files changed, 48 insertions, 9 deletions
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index a4e46e4de927..f51c29c64741 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -6876,24 +6876,63 @@ static void tg3_set_bdinfo(struct tg3 *tp, u32 bdinfo_addr,
6876static void __tg3_set_rx_mode(struct net_device *); 6876static void __tg3_set_rx_mode(struct net_device *);
6877static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec) 6877static void __tg3_set_coalesce(struct tg3 *tp, struct ethtool_coalesce *ec)
6878{ 6878{
6879 tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs); 6879 int i;
6880 tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs); 6880
6881 tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames); 6881 if (!(tp->tg3_flags2 & TG3_FLG2_USING_MSIX)) {
6882 tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames); 6882 tw32(HOSTCC_TXCOL_TICKS, ec->tx_coalesce_usecs);
6883 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { 6883 tw32(HOSTCC_TXMAX_FRAMES, ec->tx_max_coalesced_frames);
6884 tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq); 6884 tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq);
6885 tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq); 6885
6886 tw32(HOSTCC_RXCOL_TICKS, ec->rx_coalesce_usecs);
6887 tw32(HOSTCC_RXMAX_FRAMES, ec->rx_max_coalesced_frames);
6888 tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq);
6889 } else {
6890 tw32(HOSTCC_TXCOL_TICKS, 0);
6891 tw32(HOSTCC_TXMAX_FRAMES, 0);
6892 tw32(HOSTCC_TXCOAL_MAXF_INT, 0);
6893
6894 tw32(HOSTCC_RXCOL_TICKS, 0);
6895 tw32(HOSTCC_RXMAX_FRAMES, 0);
6896 tw32(HOSTCC_RXCOAL_MAXF_INT, 0);
6886 } 6897 }
6887 tw32(HOSTCC_RXCOAL_MAXF_INT, ec->rx_max_coalesced_frames_irq); 6898
6888 tw32(HOSTCC_TXCOAL_MAXF_INT, ec->tx_max_coalesced_frames_irq);
6889 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) { 6899 if (!(tp->tg3_flags2 & TG3_FLG2_5705_PLUS)) {
6890 u32 val = ec->stats_block_coalesce_usecs; 6900 u32 val = ec->stats_block_coalesce_usecs;
6891 6901
6902 tw32(HOSTCC_RXCOAL_TICK_INT, ec->rx_coalesce_usecs_irq);
6903 tw32(HOSTCC_TXCOAL_TICK_INT, ec->tx_coalesce_usecs_irq);
6904
6892 if (!netif_carrier_ok(tp->dev)) 6905 if (!netif_carrier_ok(tp->dev))
6893 val = 0; 6906 val = 0;
6894 6907
6895 tw32(HOSTCC_STAT_COAL_TICKS, val); 6908 tw32(HOSTCC_STAT_COAL_TICKS, val);
6896 } 6909 }
6910
6911 for (i = 0; i < tp->irq_cnt - 1; i++) {
6912 u32 reg;
6913
6914 reg = HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18;
6915 tw32(reg, ec->rx_coalesce_usecs);
6916 reg = HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18;
6917 tw32(reg, ec->tx_coalesce_usecs);
6918 reg = HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18;
6919 tw32(reg, ec->rx_max_coalesced_frames);
6920 reg = HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18;
6921 tw32(reg, ec->tx_max_coalesced_frames);
6922 reg = HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18;
6923 tw32(reg, ec->rx_max_coalesced_frames_irq);
6924 reg = HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18;
6925 tw32(reg, ec->tx_max_coalesced_frames_irq);
6926 }
6927
6928 for (; i < tp->irq_max - 1; i++) {
6929 tw32(HOSTCC_RXCOL_TICKS_VEC1 + i * 0x18, 0);
6930 tw32(HOSTCC_TXCOL_TICKS_VEC1 + i * 0x18, 0);
6931 tw32(HOSTCC_RXMAX_FRAMES_VEC1 + i * 0x18, 0);
6932 tw32(HOSTCC_TXMAX_FRAMES_VEC1 + i * 0x18, 0);
6933 tw32(HOSTCC_RXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
6934 tw32(HOSTCC_TXCOAL_MAXF_INT_VEC1 + i * 0x18, 0);
6935 }
6897} 6936}
6898 6937
6899/* tp->lock is held. */ 6938/* tp->lock is held. */