mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-21 11:13:30 +00:00
sfxge: assert event queue lock in event handlers
It is useful to highlight lock context. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor)
This commit is contained in:
parent
1a4bd60bf9
commit
7f979e0e92
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=279177
@ -50,6 +50,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];
|
||||
@ -89,6 +91,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)
|
||||
@ -140,6 +144,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;
|
||||
@ -165,6 +171,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];
|
||||
|
||||
@ -197,6 +205,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];
|
||||
|
||||
@ -238,6 +248,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"));
|
||||
@ -278,6 +290,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];
|
||||
|
||||
@ -308,6 +322,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;
|
||||
@ -533,6 +549,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"));
|
||||
@ -549,6 +566,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);
|
||||
|
Loading…
Reference in New Issue
Block a user