From owner-svn-src-head@FreeBSD.ORG Sun Feb 22 18:52:16 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 91DC0860; Sun, 22 Feb 2015 18:52:16 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 6423F6CF; Sun, 22 Feb 2015 18:52:16 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t1MIqGQB097061; Sun, 22 Feb 2015 18:52:16 GMT (envelope-from arybchik@FreeBSD.org) Received: (from arybchik@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t1MIqGGM097060; Sun, 22 Feb 2015 18:52:16 GMT (envelope-from arybchik@FreeBSD.org) Message-Id: <201502221852.t1MIqGGM097060@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: arybchik set sender to arybchik@FreeBSD.org using -f From: Andrew Rybchenko Date: Sun, 22 Feb 2015 18:52:16 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r279177 - head/sys/dev/sfxge X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 22 Feb 2015 18:52:16 -0000 Author: arybchik Date: Sun Feb 22 18:52:15 2015 New Revision: 279177 URL: https://svnweb.freebsd.org/changeset/base/279177 Log: sfxge: assert event queue lock in event handlers It is useful to highlight lock context. Sponsored by: Solarflare Communications, Inc. Approved by: gnn (mentor) Modified: head/sys/dev/sfxge/sfxge_ev.c Modified: head/sys/dev/sfxge/sfxge_ev.c ============================================================================== --- head/sys/dev/sfxge/sfxge_ev.c Sun Feb 22 18:50:59 2015 (r279176) +++ head/sys/dev/sfxge/sfxge_ev.c Sun Feb 22 18:52:15 2015 (r279177) @@ -50,6 +50,8 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq 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, u 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 c 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, uint3 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, uin 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, u 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, uint3 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 ma 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 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);