Exemplo n.º 1
0
static void
sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int index)
{
	struct sfxge_evq *evq;

	evq = sc->evq[index];

	KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
	    ("evq->init_state != SFXGE_EVQ_STARTED"));

	SFXGE_EVQ_LOCK(evq);
	evq->init_state = SFXGE_EVQ_INITIALIZED;
	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,
	    EFX_EVQ_NBUFS(evq->entries));
	SFXGE_EVQ_UNLOCK(evq);
}
Exemplo n.º 2
0
static void
sfxge_ev_stat_update(struct sfxge_softc *sc)
{
	struct sfxge_evq *evq;
	unsigned int index;
	clock_t now;

	sx_xlock(&sc->softc_lock);

	if (sc->evq[0]->init_state != SFXGE_EVQ_STARTED)
		goto out;

	now = ticks;
	if (now - sc->ev_stats_update_time < hz)
		goto out;

	sc->ev_stats_update_time = now;

	/* Add event counts from each event queue in turn */
	for (index = 0; index < sc->intr.n_alloc; index++) {
		evq = sc->evq[index];
		mtx_lock(&evq->lock);
		efx_ev_qstats_update(evq->common, sc->ev_stats);
		mtx_unlock(&evq->lock);
	}
out:
	sx_xunlock(&sc->softc_lock);
}
Exemplo n.º 3
0
static void
sfxge_ev_stat_update(struct sfxge_softc *sc)
{
	struct sfxge_evq *evq;
	unsigned int index;
	clock_t now;

	SFXGE_ADAPTER_LOCK(sc);

	if (__predict_false(sc->evq[0]->init_state != SFXGE_EVQ_STARTED))
		goto out;

	now = ticks;
	if (now - sc->ev_stats_update_time < hz)
		goto out;

	sc->ev_stats_update_time = now;

	/* Add event counts from each event queue in turn */
	for (index = 0; index < sc->evq_count; index++) {
		evq = sc->evq[index];
		SFXGE_EVQ_LOCK(evq);
		efx_ev_qstats_update(evq->common, sc->ev_stats);
		SFXGE_EVQ_UNLOCK(evq);
	}
out:
	SFXGE_ADAPTER_UNLOCK(sc);
}
Exemplo n.º 4
0
static void
sfxge_ev_qstop(struct sfxge_softc *sc, unsigned int index)
{
	struct sfxge_evq *evq;

	evq = sc->evq[index];

	KASSERT(evq->init_state == SFXGE_EVQ_STARTED,
	    ("evq->init_state != SFXGE_EVQ_STARTED"));

	mtx_lock(&evq->lock);
	evq->init_state = SFXGE_EVQ_INITIALIZED;
	evq->read_ptr = 0;
	evq->exception = B_FALSE;

	/* Add event counts before discarding the common evq state */
	efx_ev_qstats_update(evq->common, sc->ev_stats);

	efx_ev_qdestroy(evq->common);
	efx_sram_buf_tbl_clear(sc->enp, evq->buf_base_id,
	    EFX_EVQ_NBUFS(SFXGE_NEVS));
	mtx_unlock(&evq->lock);
}