bxe_stats.c (331722) | bxe_stats.c (339881) |
---|---|
1/*- 2 * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 * THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 2007-2014 QLogic Corporation. All rights reserved. 3 * 4 * Redistribution and use in source and binary forms, with or without 5 * modification, are permitted provided that the following conditions 6 * are met: 7 * 8 * 1. Redistributions of source code must retain the above copyright --- 11 unchanged lines hidden (view full) --- 20 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 21 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 22 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 23 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF 24 * THE POSSIBILITY OF SUCH DAMAGE. 25 */ 26 27#include <sys/cdefs.h> |
28__FBSDID("$FreeBSD: stable/11/sys/dev/bxe/bxe_stats.c 331722 2018-03-29 02:50:57Z eadler $"); | 28__FBSDID("$FreeBSD: stable/11/sys/dev/bxe/bxe_stats.c 339881 2018-10-29 21:09:39Z davidcs $"); |
29 30#include "bxe.h" 31#include "bxe_stats.h" 32 33#ifdef __i386__ 34#define BITS_PER_LONG 32 35#else 36#define BITS_PER_LONG 64 37#endif 38 | 29 30#include "bxe.h" 31#include "bxe_stats.h" 32 33#ifdef __i386__ 34#define BITS_PER_LONG 32 35#else 36#define BITS_PER_LONG 64 37#endif 38 |
39extern int bxe_grc_dump(struct bxe_softc *sc); | |
40 41static inline long 42bxe_hilo(uint32_t *hiref) 43{ 44 uint32_t lo = *(hiref + 1); 45#if (BITS_PER_LONG == 64) 46 uint32_t hi = *hiref; 47 return (HILO_U64(hi, lo)); --- 183 unchanged lines hidden (view full) --- 231bxe_stats_comp(struct bxe_softc *sc) 232{ 233 uint32_t *stats_comp = BXE_SP(sc, stats_comp); 234 int cnt = 10; 235 236 while (*stats_comp != DMAE_COMP_VAL) { 237 if (!cnt) { 238 BLOGE(sc, "Timeout waiting for stats finished\n"); | 39 40static inline long 41bxe_hilo(uint32_t *hiref) 42{ 43 uint32_t lo = *(hiref + 1); 44#if (BITS_PER_LONG == 64) 45 uint32_t hi = *hiref; 46 return (HILO_U64(hi, lo)); --- 183 unchanged lines hidden (view full) --- 230bxe_stats_comp(struct bxe_softc *sc) 231{ 232 uint32_t *stats_comp = BXE_SP(sc, stats_comp); 233 int cnt = 10; 234 235 while (*stats_comp != DMAE_COMP_VAL) { 236 if (!cnt) { 237 BLOGE(sc, "Timeout waiting for stats finished\n"); |
239 if(sc->trigger_grcdump) { 240 /* taking grcdump */ 241 bxe_grc_dump(sc); 242 } | 238 BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); 239 taskqueue_enqueue_timeout(taskqueue_thread, 240 &sc->sp_err_timeout_task, hz/10); |
243 break; | 241 break; |
242 |
|
244 } 245 246 cnt--; 247 DELAY(1000); 248 } 249 250 return (1); 251} --- 666 unchanged lines hidden (view full) --- 918 MISC_REG_CPMU_LP_SM_ENT_CNT_P0; 919 estats->eee_tx_lpi += REG_RD(sc, lpi_reg); 920 } 921 922 if (!BXE_NOMCP(sc)) { 923 nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); 924 if (nig_timer_max != estats->nig_timer_max) { 925 estats->nig_timer_max = nig_timer_max; | 243 } 244 245 cnt--; 246 DELAY(1000); 247 } 248 249 return (1); 250} --- 666 unchanged lines hidden (view full) --- 917 MISC_REG_CPMU_LP_SM_ENT_CNT_P0; 918 estats->eee_tx_lpi += REG_RD(sc, lpi_reg); 919 } 920 921 if (!BXE_NOMCP(sc)) { 922 nig_timer_max = SHMEM_RD(sc, port_mb[SC_PORT(sc)].stat_nig_timer); 923 if (nig_timer_max != estats->nig_timer_max) { 924 estats->nig_timer_max = nig_timer_max; |
925 /*NOTE: not setting error bit */ |
|
926 BLOGE(sc, "invalid NIG timer max (%u)\n", 927 estats->nig_timer_max); 928 } 929 } 930 931 return (0); 932} 933 --- 377 unchanged lines hidden (view full) --- 1311 1312 if (sc->port.pmf) { 1313 bxe_hw_stats_update(sc); 1314 } 1315 1316 if (bxe_storm_stats_update(sc)) { 1317 if (sc->stats_pending++ == 3) { 1318 if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { | 926 BLOGE(sc, "invalid NIG timer max (%u)\n", 927 estats->nig_timer_max); 928 } 929 } 930 931 return (0); 932} 933 --- 377 unchanged lines hidden (view full) --- 1311 1312 if (sc->port.pmf) { 1313 bxe_hw_stats_update(sc); 1314 } 1315 1316 if (bxe_storm_stats_update(sc)) { 1317 if (sc->stats_pending++ == 3) { 1318 if (if_getdrvflags(sc->ifp) & IFF_DRV_RUNNING) { |
1319 if(sc->trigger_grcdump) { 1320 /* taking grcdump */ 1321 bxe_grc_dump(sc); 1322 } 1323 atomic_store_rel_long(&sc->chip_tq_flags, CHIP_TQ_REINIT); 1324 taskqueue_enqueue(sc->chip_tq, &sc->chip_tq_task); | 1319 BLOGE(sc, "Storm stats not updated for 3 times, resetting\n"); 1320 BXE_SET_ERROR_BIT(sc, BXE_ERR_STATS_TO); 1321 taskqueue_enqueue_timeout(taskqueue_thread, 1322 &sc->sp_err_timeout_task, hz/10); |
1325 } 1326 } 1327 return; 1328 } 1329 } else { 1330 /* 1331 * VF doesn't collect HW statistics, and doesn't get completions, 1332 * performs only update. --- 518 unchanged lines hidden --- | 1323 } 1324 } 1325 return; 1326 } 1327 } else { 1328 /* 1329 * VF doesn't collect HW statistics, and doesn't get completions, 1330 * performs only update. --- 518 unchanged lines hidden --- |