From owner-svn-src-head@FreeBSD.ORG Tue Jun 5 03:14:50 2012 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A3D3A10657AF; Tue, 5 Jun 2012 03:14:50 +0000 (UTC) (envelope-from adrian@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 8F6F28FC08; Tue, 5 Jun 2012 03:14:50 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.4/8.14.4) with ESMTP id q553Eoj2084782; Tue, 5 Jun 2012 03:14:50 GMT (envelope-from adrian@svn.freebsd.org) Received: (from adrian@localhost) by svn.freebsd.org (8.14.4/8.14.4/Submit) id q553EoPP084778; Tue, 5 Jun 2012 03:14:50 GMT (envelope-from adrian@svn.freebsd.org) Message-Id: <201206050314.q553EoPP084778@svn.freebsd.org> From: Adrian Chadd Date: Tue, 5 Jun 2012 03:14:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r236597 - head/sys/dev/ath X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 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: Tue, 05 Jun 2012 03:14:50 -0000 Author: adrian Date: Tue Jun 5 03:14:49 2012 New Revision: 236597 URL: http://svn.freebsd.org/changeset/base/236597 Log: Create a function - ath_tx_kick() - which is called where ath_start() is called to "kick" along TX. For now, schedule a taskqueue call. Later on I may go back to the direct call of ath_rx_tasklet() - but for now, this will do. I've tested UDP and TCP TX. UDP TX still achieves 240MBit, but TCP TX gets stuck at around 100MBit or so, instead of the 150MBit it should be at. I'll re-test with no ACPI/power/sleep states enabled at startup and see what effect it has. This is in preparation for supporting an if_transmit() path, which will turn ath_tx_kick() into a NUL operation (as there won't be an ifnet queue to service.) Tested: * AR9280 STA TODO: * test on AR5416, AR9160, AR928x STA/AP modes PR: kern/168649 Modified: head/sys/dev/ath/if_ath.c head/sys/dev/ath/if_ath_misc.h head/sys/dev/ath/if_ath_rx.c Modified: head/sys/dev/ath/if_ath.c ============================================================================== --- head/sys/dev/ath/if_ath.c Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath.c Tue Jun 5 03:14:49 2012 (r236597) @@ -142,6 +142,7 @@ static void ath_vap_delete(struct ieee80 static void ath_init(void *); static void ath_stop_locked(struct ifnet *); static void ath_stop(struct ifnet *); +static void ath_tx_tasklet(void *arg, int npending); static int ath_reset_vap(struct ieee80211vap *, u_long); static int ath_media_change(struct ifnet *); static void ath_watchdog(void *); @@ -2330,7 +2331,7 @@ ath_start(struct ifnet *ifp) taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); } -void +static void ath_tx_tasklet(void *arg, int npending) { struct ath_softc *sc = (struct ath_softc *) arg; @@ -3509,8 +3510,7 @@ ath_tx_proc_q0(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - // ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } /* @@ -3560,8 +3560,7 @@ ath_tx_proc_q0123(void *arg, int npendin sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - //ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } /* @@ -3604,8 +3603,7 @@ ath_tx_proc(void *arg, int npending) sc->sc_txproc_cnt--; ATH_PCU_UNLOCK(sc); - //ath_start(ifp); - ath_tx_tasklet(sc, 1); + ath_tx_kick(sc); } #undef TXQACTIVE Modified: head/sys/dev/ath/if_ath_misc.h ============================================================================== --- head/sys/dev/ath/if_ath_misc.h Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath_misc.h Tue Jun 5 03:14:49 2012 (r236597) @@ -83,7 +83,17 @@ extern void ath_setslottime(struct ath_s * we can kill this. */ extern void ath_start(struct ifnet *ifp); -extern void ath_tx_tasklet(void *arg, int npending); +static inline void +ath_tx_kick(struct ath_softc *sc) +{ + + /* + * Use a taskqueue to schedule a TX completion task, + * even if we're in taskqueue context. That way this can + * be called from any context. + */ + taskqueue_enqueue(sc->sc_tq, &sc->sc_txstarttask); +} #endif Modified: head/sys/dev/ath/if_ath_rx.c ============================================================================== --- head/sys/dev/ath/if_ath_rx.c Tue Jun 5 03:14:39 2012 (r236596) +++ head/sys/dev/ath/if_ath_rx.c Tue Jun 5 03:14:49 2012 (r236597) @@ -899,8 +899,7 @@ rx_proc_next: ieee80211_ff_age_all(ic, 100); #endif if (!IFQ_IS_EMPTY(&ifp->if_snd)) - ath_tx_tasklet(sc, 1); - //ath_start(ifp); + ath_tx_kick(sc); } #undef PA2DESC