From owner-svn-src-head@FreeBSD.ORG Sun Mar 15 21:23:46 2015 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1B627CF8; Sun, 15 Mar 2015 21:23:46 +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 E1842995; Sun, 15 Mar 2015 21:23:45 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t2FLNjjE090200; Sun, 15 Mar 2015 21:23:45 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t2FLNjsr090199; Sun, 15 Mar 2015 21:23:45 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201503152123.t2FLNjsr090199@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Sun, 15 Mar 2015 21:23:45 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r280110 - head/sys/dev/wpi 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, 15 Mar 2015 21:23:46 -0000 Author: adrian Date: Sun Mar 15 21:23:45 2015 New Revision: 280110 URL: https://svnweb.freebsd.org/changeset/base/280110 Log: Don't use sc->qfullmsk in wpi_start(). PR: kern/197143 Submitted by: Andriy Voskoboinyk Modified: head/sys/dev/wpi/if_wpi.c Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:22:03 2015 (r280109) +++ head/sys/dev/wpi/if_wpi.c Sun Mar 15 21:23:45 2015 (r280110) @@ -2411,6 +2411,7 @@ end: WPI_UNLOCK(sc); static int wpi_cmd2(struct wpi_softc *sc, struct wpi_buf *buf) { + struct ifnet *ifp = sc->sc_ifp; struct ieee80211_frame *wh; struct wpi_tx_cmd *cmd; struct wpi_tx_data *data; @@ -2522,9 +2523,14 @@ wpi_cmd2(struct wpi_softc *sc, struct wp if (ring->qid < WPI_CMD_QUEUE_NUM) { /* Mark TX ring as full if we reach a certain threshold. */ - if (++ring->queued > WPI_TX_RING_HIMARK) + if (++ring->queued > WPI_TX_RING_HIMARK) { sc->qfullmsk |= 1 << ring->qid; + IF_LOCK(&ifp->if_snd); + ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_UNLOCK(&ifp->if_snd); + } + callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); } @@ -2873,24 +2879,18 @@ wpi_start(struct ifnet *ifp) struct ieee80211_node *ni; struct mbuf *m; + WPI_LOCK(sc); DPRINTF(sc, WPI_DEBUG_XMIT, "%s: called\n", __func__); - IF_LOCK(&ifp->if_snd); - if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || - (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { - IF_UNLOCK(&ifp->if_snd); - return; - } - IF_UNLOCK(&ifp->if_snd); - - WPI_LOCK(sc); for (;;) { - if (sc->qfullmsk != 0) { - IF_LOCK(&ifp->if_snd); - ifp->if_drv_flags |= IFF_DRV_OACTIVE; + IF_LOCK(&ifp->if_snd); + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0 || + (ifp->if_drv_flags & IFF_DRV_OACTIVE)) { IF_UNLOCK(&ifp->if_snd); break; } + IF_UNLOCK(&ifp->if_snd); + IFQ_DRV_DEQUEUE(&ifp->if_snd, m); if (m == NULL) break; @@ -2902,9 +2902,9 @@ wpi_start(struct ifnet *ifp) if_inc_counter(ifp, IFCOUNTER_OERRORS, 1); } } - WPI_UNLOCK(sc); DPRINTF(sc, WPI_DEBUG_XMIT, "%s: done\n", __func__); + WPI_UNLOCK(sc); } static void