diff options
author | Ben Hutchings <bhutchings@solarflare.com> | 2009-11-25 11:11:35 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-11-26 18:59:36 -0500 |
commit | 55edc6e6ff728681ebc10d418222740705376664 (patch) | |
tree | 66136e674adde15b9668f13d4e0486482b7f1851 /drivers/net/sfc/falcon_xmac.c | |
parent | 1dfc5ceacd00365a9089e98643f4b26253d5a6aa (diff) |
sfc: Split MAC stats DMA initiation and completion
From: Steve Hodgson <shodgson@solarflare.com>
Currently we initiate MAC stats DMA and busy-wait for completion when
stats are requested. We can improve on this with a periodic timer to
initiate and poll for stats, and opportunistically poll when stats are
requested.
Since efx_nic::stats_disable_count and efx_stats_{disable,enable}()
are Falcon-specific, rename them and move them accordingly.
Signed-off-by: Ben Hutchings <bhutchings@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/sfc/falcon_xmac.c')
-rw-r--r-- | drivers/net/sfc/falcon_xmac.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/drivers/net/sfc/falcon_xmac.c b/drivers/net/sfc/falcon_xmac.c index cf24513900e7..e57545de60ff 100644 --- a/drivers/net/sfc/falcon_xmac.c +++ b/drivers/net/sfc/falcon_xmac.c | |||
@@ -60,9 +60,13 @@ static void falcon_setup_xaui(struct efx_nic *efx) | |||
60 | 60 | ||
61 | int falcon_reset_xaui(struct efx_nic *efx) | 61 | int falcon_reset_xaui(struct efx_nic *efx) |
62 | { | 62 | { |
63 | struct falcon_nic_data *nic_data = efx->nic_data; | ||
63 | efx_oword_t reg; | 64 | efx_oword_t reg; |
64 | int count; | 65 | int count; |
65 | 66 | ||
67 | /* Don't fetch MAC statistics over an XMAC reset */ | ||
68 | WARN_ON(nic_data->stats_disable_count == 0); | ||
69 | |||
66 | /* Start reset sequence */ | 70 | /* Start reset sequence */ |
67 | EFX_POPULATE_OWORD_1(reg, FRF_AB_XX_RST_XX_EN, 1); | 71 | EFX_POPULATE_OWORD_1(reg, FRF_AB_XX_RST_XX_EN, 1); |
68 | efx_writeo(efx, ®, FR_AB_XX_PWR_RST); | 72 | efx_writeo(efx, ®, FR_AB_XX_PWR_RST); |
@@ -250,6 +254,8 @@ static void falcon_check_xaui_link_up(struct efx_nic *efx, int tries) | |||
250 | /* XAUI link is expected to be down */ | 254 | /* XAUI link is expected to be down */ |
251 | return; | 255 | return; |
252 | 256 | ||
257 | falcon_stop_nic_stats(efx); | ||
258 | |||
253 | while (!efx->mac_up && tries) { | 259 | while (!efx->mac_up && tries) { |
254 | EFX_LOG(efx, "bashing xaui\n"); | 260 | EFX_LOG(efx, "bashing xaui\n"); |
255 | falcon_reset_xaui(efx); | 261 | falcon_reset_xaui(efx); |
@@ -258,6 +264,8 @@ static void falcon_check_xaui_link_up(struct efx_nic *efx, int tries) | |||
258 | efx->mac_up = falcon_xaui_link_ok(efx); | 264 | efx->mac_up = falcon_xaui_link_ok(efx); |
259 | --tries; | 265 | --tries; |
260 | } | 266 | } |
267 | |||
268 | falcon_start_nic_stats(efx); | ||
261 | } | 269 | } |
262 | 270 | ||
263 | static void falcon_reconfigure_xmac(struct efx_nic *efx) | 271 | static void falcon_reconfigure_xmac(struct efx_nic *efx) |
@@ -276,11 +284,6 @@ static void falcon_reconfigure_xmac(struct efx_nic *efx) | |||
276 | static void falcon_update_stats_xmac(struct efx_nic *efx) | 284 | static void falcon_update_stats_xmac(struct efx_nic *efx) |
277 | { | 285 | { |
278 | struct efx_mac_stats *mac_stats = &efx->mac_stats; | 286 | struct efx_mac_stats *mac_stats = &efx->mac_stats; |
279 | int rc; | ||
280 | |||
281 | rc = falcon_dma_stats(efx, XgDmaDone_offset); | ||
282 | if (rc) | ||
283 | return; | ||
284 | 287 | ||
285 | /* Update MAC stats from DMAed values */ | 288 | /* Update MAC stats from DMAed values */ |
286 | FALCON_STAT(efx, XgRxOctets, rx_bytes); | 289 | FALCON_STAT(efx, XgRxOctets, rx_bytes); |