diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-01-29 18:54:43 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-01-29 18:54:43 +0000 |
commit | 92c267b4a9a4fa10360316e94acd0a6486a2d4cf (patch) | |
tree | 54bd852b7e0ea2b00ec528bd63d8efb4e8f5cc6a | |
parent | d9ab0883fe0b7c6b515571a2fd95ab26d4284057 (diff) | |
download | FreeBSD-src-92c267b4a9a4fa10360316e94acd0a6486a2d4cf.zip FreeBSD-src-92c267b4a9a4fa10360316e94acd0a6486a2d4cf.tar.gz |
sfxge: Make it possible to build without EVQ statistics
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
-rw-r--r-- | sys/dev/sfxge/common/efx_ev.c | 2 | ||||
-rw-r--r-- | sys/dev/sfxge/common/efx_tx.c | 2 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge.h | 2 | ||||
-rw-r--r-- | sys/dev/sfxge/sfxge_ev.c | 8 |
4 files changed, 14 insertions, 0 deletions
diff --git a/sys/dev/sfxge/common/efx_ev.c b/sys/dev/sfxge/common/efx_ev.c index f8b9aae..515435b 100644 --- a/sys/dev/sfxge/common/efx_ev.c +++ b/sys/dev/sfxge/common/efx_ev.c @@ -995,6 +995,7 @@ fail1: return (rc); } +#if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES /* START MKCONFIG GENERATED EfxEventQueueStatNamesBlock 67e9bdcd920059bd */ static const char __cs * __cs __efx_ev_qstat_name[] = { @@ -1052,6 +1053,7 @@ efx_ev_qstat_name( return (__efx_ev_qstat_name[id]); } #endif /* EFSYS_OPT_NAMES */ +#endif /* EFSYS_OPT_QSTATS */ #if EFSYS_OPT_QSTATS void diff --git a/sys/dev/sfxge/common/efx_tx.c b/sys/dev/sfxge/common/efx_tx.c index a78b761..a7ec361 100644 --- a/sys/dev/sfxge/common/efx_tx.c +++ b/sys/dev/sfxge/common/efx_tx.c @@ -358,6 +358,7 @@ fail1: return (rc); } +#if EFSYS_OPT_QSTATS #if EFSYS_OPT_NAMES /* START MKCONFIG GENERATED EfxTransmitQueueStatNamesBlock 78ca9ab00287fffb */ static const char __cs * __cs __efx_tx_qstat_name[] = { @@ -378,6 +379,7 @@ efx_tx_qstat_name( return (__efx_tx_qstat_name[id]); } #endif /* EFSYS_OPT_NAMES */ +#endif /* EFSYS_OPT_QSTATS */ #if EFSYS_OPT_QSTATS void diff --git a/sys/dev/sfxge/sfxge.h b/sys/dev/sfxge/sfxge.h index 96864b1..4dfe3f2 100644 --- a/sys/dev/sfxge/sfxge.h +++ b/sys/dev/sfxge/sfxge.h @@ -225,8 +225,10 @@ struct sfxge_softc { struct sfxge_evq *evq[SFXGE_RX_SCALE_MAX]; unsigned int ev_moderation; +#if EFSYS_OPT_QSTATS clock_t ev_stats_update_time; uint64_t ev_stats[EV_NQSTATS]; +#endif uma_zone_t rxq_cache; struct sfxge_rxq *rxq[SFXGE_RX_SCALE_MAX]; diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c index bd1c063..f93a67c 100644 --- a/sys/dev/sfxge/sfxge_ev.c +++ b/sys/dev/sfxge/sfxge_ev.c @@ -406,6 +406,8 @@ sfxge_ev_wake_up(void *arg, uint32_t index) return (B_FALSE); } +#if EFSYS_OPT_QSTATS + static void sfxge_ev_stat_update(struct sfxge_softc *sc) { @@ -467,6 +469,8 @@ sfxge_ev_stat_init(struct sfxge_softc *sc) } } +#endif /* EFSYS_OPT_QSTATS */ + static void sfxge_ev_qmoderate(struct sfxge_softc *sc, unsigned int idx, unsigned int us) { @@ -627,8 +631,10 @@ sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int index) evq->read_ptr = 0; evq->exception = B_FALSE; +#if EFSYS_OPT_QSTATS /* Add event counts before discarding the common evq state */ efx_ev_qstats_update(evq->common, sc->ev_stats); +#endif efx_ev_qdestroy(evq->common); efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id, @@ -883,7 +889,9 @@ sfxge_ev_init(struct sfxge_softc *sc) goto fail; } +#if EFSYS_OPT_QSTATS sfxge_ev_stat_init(sc); +#endif return (0); |