diff options
author | Divy Le Ray <divy@chelsio.com> | 2009-03-12 17:14:09 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-03-13 14:30:45 -0400 |
commit | fc88219601aa3f94def89433a6afde154e8faa8c (patch) | |
tree | 8c921807f947ba25c7ce188c9ec586aa57b0a0f9 /drivers/net/cxgb3/t3_hw.c | |
parent | 42c8ea17e8f78752ed5a354791b0ea1697dc3480 (diff) |
cxgb3: disable high freq non-data interrupts
Under RX pressure, The HW might generate a high load of interrupts
to signal mac fifo or free lists overflow.
Disable the interrupts, and poll the relevant status bits
to maintain stats.
Signed-off-by: Divy Le Ray <divy@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cxgb3/t3_hw.c')
-rw-r--r-- | drivers/net/cxgb3/t3_hw.c | 30 |
1 files changed, 26 insertions, 4 deletions
diff --git a/drivers/net/cxgb3/t3_hw.c b/drivers/net/cxgb3/t3_hw.c index ac2a974dfe37..7c6ee0c9b6fc 100644 --- a/drivers/net/cxgb3/t3_hw.c +++ b/drivers/net/cxgb3/t3_hw.c | |||
@@ -1323,7 +1323,7 @@ static int t3_handle_intr_status(struct adapter *adapter, unsigned int reg, | |||
1323 | #define MC7_INTR_MASK (F_AE | F_UE | F_CE | V_PE(M_PE)) | 1323 | #define MC7_INTR_MASK (F_AE | F_UE | F_CE | V_PE(M_PE)) |
1324 | #define XGM_INTR_MASK (V_TXFIFO_PRTY_ERR(M_TXFIFO_PRTY_ERR) | \ | 1324 | #define XGM_INTR_MASK (V_TXFIFO_PRTY_ERR(M_TXFIFO_PRTY_ERR) | \ |
1325 | V_RXFIFO_PRTY_ERR(M_RXFIFO_PRTY_ERR) | \ | 1325 | V_RXFIFO_PRTY_ERR(M_RXFIFO_PRTY_ERR) | \ |
1326 | F_TXFIFO_UNDERRUN | F_RXFIFO_OVERFLOW) | 1326 | F_TXFIFO_UNDERRUN) |
1327 | #define PCIX_INTR_MASK (F_MSTDETPARERR | F_SIGTARABT | F_RCVTARABT | \ | 1327 | #define PCIX_INTR_MASK (F_MSTDETPARERR | F_SIGTARABT | F_RCVTARABT | \ |
1328 | F_RCVMSTABT | F_SIGSYSERR | F_DETPARERR | \ | 1328 | F_RCVMSTABT | F_SIGSYSERR | F_DETPARERR | \ |
1329 | F_SPLCMPDIS | F_UNXSPLCMP | F_RCVSPLCMPERR | \ | 1329 | F_SPLCMPDIS | F_UNXSPLCMP | F_RCVSPLCMPERR | \ |
@@ -1695,7 +1695,14 @@ static void mc7_intr_handler(struct mc7 *mc7) | |||
1695 | static int mac_intr_handler(struct adapter *adap, unsigned int idx) | 1695 | static int mac_intr_handler(struct adapter *adap, unsigned int idx) |
1696 | { | 1696 | { |
1697 | struct cmac *mac = &adap2pinfo(adap, idx)->mac; | 1697 | struct cmac *mac = &adap2pinfo(adap, idx)->mac; |
1698 | u32 cause = t3_read_reg(adap, A_XGM_INT_CAUSE + mac->offset); | 1698 | /* |
1699 | * We mask out interrupt causes for which we're not taking interrupts. | ||
1700 | * This allows us to use polling logic to monitor some of the other | ||
1701 | * conditions when taking interrupts would impose too much load on the | ||
1702 | * system. | ||
1703 | */ | ||
1704 | u32 cause = t3_read_reg(adap, A_XGM_INT_CAUSE + mac->offset) & | ||
1705 | ~F_RXFIFO_OVERFLOW; | ||
1699 | 1706 | ||
1700 | if (cause & V_TXFIFO_PRTY_ERR(M_TXFIFO_PRTY_ERR)) { | 1707 | if (cause & V_TXFIFO_PRTY_ERR(M_TXFIFO_PRTY_ERR)) { |
1701 | mac->stats.tx_fifo_parity_err++; | 1708 | mac->stats.tx_fifo_parity_err++; |
@@ -3617,7 +3624,15 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, | |||
3617 | adapter->params.info = ai; | 3624 | adapter->params.info = ai; |
3618 | adapter->params.nports = ai->nports; | 3625 | adapter->params.nports = ai->nports; |
3619 | adapter->params.rev = t3_read_reg(adapter, A_PL_REV); | 3626 | adapter->params.rev = t3_read_reg(adapter, A_PL_REV); |
3620 | adapter->params.linkpoll_period = 0; | 3627 | /* |
3628 | * We used to only run the "adapter check task" once a second if | ||
3629 | * we had PHYs which didn't support interrupts (we would check | ||
3630 | * their link status once a second). Now we check other conditions | ||
3631 | * in that routine which could potentially impose a very high | ||
3632 | * interrupt load on the system. As such, we now always scan the | ||
3633 | * adapter state once a second ... | ||
3634 | */ | ||
3635 | adapter->params.linkpoll_period = 10; | ||
3621 | adapter->params.stats_update_period = is_10G(adapter) ? | 3636 | adapter->params.stats_update_period = is_10G(adapter) ? |
3622 | MAC_STATS_ACCUM_SECS : (MAC_STATS_ACCUM_SECS * 10); | 3637 | MAC_STATS_ACCUM_SECS : (MAC_STATS_ACCUM_SECS * 10); |
3623 | adapter->params.pci.vpd_cap_addr = | 3638 | adapter->params.pci.vpd_cap_addr = |
@@ -3707,7 +3722,14 @@ int t3_prep_adapter(struct adapter *adapter, const struct adapter_info *ai, | |||
3707 | ETH_ALEN); | 3722 | ETH_ALEN); |
3708 | init_link_config(&p->link_config, p->phy.caps); | 3723 | init_link_config(&p->link_config, p->phy.caps); |
3709 | p->phy.ops->power_down(&p->phy, 1); | 3724 | p->phy.ops->power_down(&p->phy, 1); |
3710 | if (!(p->phy.caps & SUPPORTED_IRQ)) | 3725 | |
3726 | /* | ||
3727 | * If the PHY doesn't support interrupts for link status | ||
3728 | * changes, schedule a scan of the adapter links at least | ||
3729 | * once a second. | ||
3730 | */ | ||
3731 | if (!(p->phy.caps & SUPPORTED_IRQ) && | ||
3732 | adapter->params.linkpoll_period > 10) | ||
3711 | adapter->params.linkpoll_period = 10; | 3733 | adapter->params.linkpoll_period = 10; |
3712 | } | 3734 | } |
3713 | 3735 | ||