diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:04:28 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:04:28 +0000 |
commit | 59a10077f4085106c8e09c46896dbe3a3d1d003d (patch) | |
tree | 49c3ef725de167610a82c34b99b9c1b207d1153b | |
parent | 8d456b11c834c4a7e470152c6b9a89b40cc0cef2 (diff) | |
download | FreeBSD-src-59a10077f4085106c8e09c46896dbe3a3d1d003d.zip FreeBSD-src-59a10077f4085106c8e09c46896dbe3a3d1d003d.tar.gz |
MFC: 279177
sfxge: assert event queue lock in event handlers
It is useful to highlight lock context.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
-rw-r--r-- | sys/dev/sfxge/sfxge_ev.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/sys/dev/sfxge/sfxge_ev.c b/sys/dev/sfxge/sfxge_ev.c index 9e3bf9d..997eb9f 100644 --- a/sys/dev/sfxge/sfxge_ev.c +++ b/sys/dev/sfxge/sfxge_ev.c @@ -45,6 +45,8 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq, boolean_t eop) struct sfxge_rxq *rxq; struct sfxge_txq *txq; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; index = evq->index; rxq = sc->rxq[index]; @@ -84,6 +86,8 @@ sfxge_ev_rx(void *arg, uint32_t label, uint32_t id, uint32_t size, struct sfxge_rx_sw_desc *rx_desc; evq = arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; if (evq->exception) @@ -135,6 +139,8 @@ sfxge_ev_exception(void *arg, uint32_t code, uint32_t data) struct sfxge_softc *sc; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; evq->exception = B_TRUE; @@ -160,6 +166,8 @@ sfxge_ev_rxq_flush_done(void *arg, uint32_t rxq_index) uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; rxq = sc->rxq[rxq_index]; @@ -192,6 +200,8 @@ sfxge_ev_rxq_flush_failed(void *arg, uint32_t rxq_index) uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; rxq = sc->rxq[rxq_index]; @@ -233,6 +243,8 @@ sfxge_ev_tx(void *arg, uint32_t label, uint32_t id) unsigned int delta; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + txq = sfxge_get_txq_by_label(evq, label); KASSERT(txq != NULL, ("txq == NULL")); @@ -273,6 +285,8 @@ sfxge_ev_txq_flush_done(void *arg, uint32_t txq_index) uint16_t magic; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; txq = sc->txq[txq_index]; @@ -303,6 +317,8 @@ sfxge_ev_software(void *arg, uint16_t magic) unsigned int label; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; label = magic & SFXGE_MAGIC_DMAQ_LABEL_MASK; @@ -528,6 +544,7 @@ sfxge_ev_initialized(void *arg) struct sfxge_evq *evq; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); KASSERT(evq->init_state == SFXGE_EVQ_STARTING, ("evq not starting")); @@ -544,6 +561,8 @@ sfxge_ev_link_change(void *arg, efx_link_mode_t link_mode) struct sfxge_softc *sc; evq = (struct sfxge_evq *)arg; + SFXGE_EVQ_LOCK_ASSERT_OWNED(evq); + sc = evq->sc; sfxge_mac_link_update(sc, link_mode); |