From owner-svn-src-all@freebsd.org Thu Oct 8 00:52:43 2015 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 30DFE9D1F8A; Thu, 8 Oct 2015 00:52:43 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::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 E474E833; Thu, 8 Oct 2015 00:52:42 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id t980qgFI034704; Thu, 8 Oct 2015 00:52:42 GMT (envelope-from adrian@FreeBSD.org) Received: (from adrian@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id t980qf7P034702; Thu, 8 Oct 2015 00:52:41 GMT (envelope-from adrian@FreeBSD.org) Message-Id: <201510080052.t980qf7P034702@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: adrian set sender to adrian@FreeBSD.org using -f From: Adrian Chadd Date: Thu, 8 Oct 2015 00:52:41 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r288999 - 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-all@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 08 Oct 2015 00:52:43 -0000 Author: adrian Date: Thu Oct 8 00:52:41 2015 New Revision: 288999 URL: https://svnweb.freebsd.org/changeset/base/288999 Log: wpi(4): remove software queues Use direct dispatch into the destination hardware ring instead of using a staging queue. Submitted by: Differential Revision: https://reviews.freebsd.org/D3757 Modified: head/sys/dev/wpi/if_wpi.c head/sys/dev/wpi/if_wpivar.h Modified: head/sys/dev/wpi/if_wpi.c ============================================================================== --- head/sys/dev/wpi/if_wpi.c Thu Oct 8 00:48:29 2015 (r288998) +++ head/sys/dev/wpi/if_wpi.c Thu Oct 8 00:52:41 2015 (r288999) @@ -206,7 +206,6 @@ static int wpi_tx_data_raw(struct wpi_so static int wpi_raw_xmit(struct ieee80211_node *, struct mbuf *, const struct ieee80211_bpf_params *); static int wpi_transmit(struct ieee80211com *, struct mbuf *); -static void wpi_start(void *, int); static void wpi_watchdog_rfkill(void *); static void wpi_scan_timeout(void *); static void wpi_tx_timeout(void *); @@ -525,7 +524,6 @@ wpi_attach(device_t dev) TASK_INIT(&sc->sc_reinittask, 0, wpi_hw_reset, sc); TASK_INIT(&sc->sc_radiooff_task, 0, wpi_radio_off, sc); TASK_INIT(&sc->sc_radioon_task, 0, wpi_radio_on, sc); - TASK_INIT(&sc->sc_start_task, 0, wpi_start, sc); sc->sc_tq = taskqueue_create("wpi_taskq", M_WAITOK, taskqueue_thread_enqueue, &sc->sc_tq); @@ -685,7 +683,6 @@ wpi_detach(device_t dev) if (ic->ic_vap_create == wpi_vap_create) { ieee80211_draintask(ic, &sc->sc_radioon_task); - ieee80211_draintask(ic, &sc->sc_start_task); wpi_stop(sc); @@ -1165,7 +1162,6 @@ wpi_alloc_tx_ring(struct wpi_softc *sc, ring->queued = 0; ring->cur = 0; ring->update = 0; - mbufq_init(&ring->snd, ifqmaxlen); DPRINTF(sc, WPI_DEBUG_TRACE, TRACE_STR_BEGIN, __func__); @@ -1293,8 +1289,6 @@ wpi_reset_tx_ring(struct wpi_softc *sc, memset(ring->desc, 0, ring->desc_dma.size); bus_dmamap_sync(ring->desc_dma.tag, ring->desc_dma.map, BUS_DMASYNC_PREWRITE); - mbufq_drain(&ring->snd); - sc->qfullmsk &= ~(1 << ring->qid); ring->queued = 0; ring->cur = 0; ring->update = 0; @@ -2104,16 +2098,9 @@ wpi_tx_done(struct wpi_softc *sc, struct ieee80211_tx_complete(ni, m, (status & WPI_TX_STATUS_FAIL) != 0); WPI_TXQ_STATE_LOCK(sc); - ring->queued -= 1; - if (ring->queued > 0) { + if (--ring->queued > 0) callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); - - if ((sc->qfullmsk & (1 << ring->qid)) != 0 && - ring->queued < WPI_TX_RING_LOMARK) { - sc->qfullmsk &= ~(1 << ring->qid); - ieee80211_runtask(ic, &sc->sc_start_task); - } - } else + else callout_stop(&sc->tx_timeout); WPI_TXQ_STATE_UNLOCK(sc); @@ -2692,10 +2679,8 @@ wpi_cmd2(struct wpi_softc *sc, struct wp sc->sc_update_tx_ring(sc, ring); if (ring->qid < WPI_CMD_QUEUE_NUM) { - /* Mark TX ring as full if we reach a certain threshold. */ WPI_TXQ_STATE_LOCK(sc); - if (++ring->queued > WPI_TX_RING_HIMARK) - sc->qfullmsk |= 1 << ring->qid; + ring->queued++; callout_reset(&sc->tx_timeout, 5*hz, wpi_tx_timeout, sc); WPI_TXQ_STATE_UNLOCK(sc); } @@ -3063,7 +3048,6 @@ wpi_transmit(struct ieee80211com *ic, st { struct wpi_softc *sc = ic->ic_softc; struct ieee80211_node *ni; - struct mbufq *sndq; int ac, error; WPI_TX_LOCK(sc); @@ -3077,10 +3061,8 @@ wpi_transmit(struct ieee80211com *ic, st /* Check for available space. */ ac = M_WME_GETAC(m); - sndq = &sc->txq[ac].snd; - if (wpi_tx_ring_is_full(sc, ac) || mbufq_len(sndq) != 0) { - /* wpi_tx_done() will dequeue it. */ - error = mbufq_enqueue(sndq, m); + if (wpi_tx_ring_is_full(sc, ac)) { + error = ENOBUFS; goto unlock; } @@ -3097,44 +3079,6 @@ unlock: WPI_TX_UNLOCK(sc); return (error); } -/** - * Process data waiting to be sent on the output queue - */ -static void -wpi_start(void *arg0, int pending) -{ - struct wpi_softc *sc = arg0; - struct ieee80211_node *ni; - struct mbuf *m; - uint8_t i; - - WPI_TX_LOCK(sc); - if (sc->sc_running == 0) - goto unlock; - - DPRINTF(sc, WPI_DEBUG_XMIT, "%s: called\n", __func__); - - for (i = 0; i < WPI_CMD_QUEUE_NUM; i++) { - struct mbufq *sndq = &sc->txq[i].snd; - - for (;;) { - if (wpi_tx_ring_is_full(sc, i)) - break; - - if ((m = mbufq_dequeue(sndq)) == NULL) - break; - - ni = (struct ieee80211_node *)m->m_pkthdr.rcvif; - if (wpi_tx_data(sc, m, ni) != 0) { - wpi_handle_tx_failure(ni); - } - } - } - - DPRINTF(sc, WPI_DEBUG_XMIT, "%s: done\n", __func__); -unlock: WPI_TX_UNLOCK(sc); -} - static void wpi_watchdog_rfkill(void *arg) { Modified: head/sys/dev/wpi/if_wpivar.h ============================================================================== --- head/sys/dev/wpi/if_wpivar.h Thu Oct 8 00:48:29 2015 (r288998) +++ head/sys/dev/wpi/if_wpivar.h Thu Oct 8 00:52:41 2015 (r288999) @@ -72,7 +72,6 @@ struct wpi_tx_ring { struct wpi_tx_cmd *cmd; struct wpi_tx_data data[WPI_TX_RING_COUNT]; bus_dma_tag_t data_dmat; - struct mbufq snd; int qid; int queued; int cur; @@ -188,7 +187,6 @@ struct wpi_softc { /* TX Thermal Callibration. */ struct callout calib_to; - int calib_cnt; struct callout scan_timeout; struct callout tx_timeout; @@ -212,7 +210,6 @@ struct wpi_softc { struct mtx rxon_mtx; int temp; - uint32_t qfullmsk; uint32_t nodesmsk; struct mtx nt_mtx; @@ -235,7 +232,6 @@ struct wpi_softc { struct task sc_reinittask; struct task sc_radiooff_task; struct task sc_radioon_task; - struct task sc_start_task; /* Taskqueue */ struct taskqueue *sc_tq;