diff options
author | adrian <adrian@FreeBSD.org> | 2013-04-16 20:21:02 +0000 |
---|---|---|
committer | adrian <adrian@FreeBSD.org> | 2013-04-16 20:21:02 +0000 |
commit | 2f4d81f0936ee8936392573dd361b4260a1f393c (patch) | |
tree | 57b3bd010a7d2d5144c5d19e957a431bafc1a9e5 | |
parent | b7d87713059123f7e6706ff57039292bbbff0ef0 (diff) | |
download | FreeBSD-src-2f4d81f0936ee8936392573dd361b4260a1f393c.zip FreeBSD-src-2f4d81f0936ee8936392573dd361b4260a1f393c.tar.gz |
Use a per-RX-queue deferred list, rather than a single deferred list for
both queues.
Since ath_rx_pkt() does multi-mbuf frame recombining based on the RX queue,
this needs to occur.
Tested:
* AR9380 (XB112), hostap mode
-rw-r--r-- | sys/dev/ath/if_ath.c | 3 | ||||
-rw-r--r-- | sys/dev/ath/if_ath_rx_edma.c | 13 | ||||
-rw-r--r-- | sys/dev/ath/if_athvar.h | 2 |
3 files changed, 13 insertions, 5 deletions
diff --git a/sys/dev/ath/if_ath.c b/sys/dev/ath/if_ath.c index c0d002d..85e2b4e 100644 --- a/sys/dev/ath/if_ath.c +++ b/sys/dev/ath/if_ath.c @@ -842,7 +842,8 @@ ath_attach(u_int16_t devid, struct ath_softc *sc) /* * Initialise the deferred completed RX buffer list. */ - TAILQ_INIT(&sc->sc_rx_rxlist); + TAILQ_INIT(&sc->sc_rx_rxlist[HAL_RX_QUEUE_HP]); + TAILQ_INIT(&sc->sc_rx_rxlist[HAL_RX_QUEUE_LP]); /* * Indicate we need the 802.11 header padded to a diff --git a/sys/dev/ath/if_ath_rx_edma.c b/sys/dev/ath/if_ath_rx_edma.c index 76ce0f3..abfb57d 100644 --- a/sys/dev/ath/if_ath_rx_edma.c +++ b/sys/dev/ath/if_ath_rx_edma.c @@ -398,7 +398,7 @@ ath_edma_recv_proc_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype, * queue. */ re->m_fifo[re->m_fifo_head] = NULL; - TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist, bf, bf_list); + TAILQ_INSERT_TAIL(&sc->sc_rx_rxlist[qtype], bf, bf_list); /* Bump the descriptor FIFO stats */ INCR(re->m_fifo_head, re->m_fifolen); @@ -451,8 +451,15 @@ ath_edma_flush_deferred_queue(struct ath_softc *sc) struct ath_buf *bf, *next; ATH_RX_LOCK_ASSERT(sc); + /* Free in one set, inside the lock */ - TAILQ_FOREACH_SAFE(bf, &sc->sc_rx_rxlist, bf_list, next) { + TAILQ_FOREACH_SAFE(bf, + &sc->sc_rx_rxlist[HAL_RX_QUEUE_LP], bf_list, next) { + /* Free the buffer/mbuf */ + ath_edma_rxbuf_free(sc, bf); + } + TAILQ_FOREACH_SAFE(bf, + &sc->sc_rx_rxlist[HAL_RX_QUEUE_HP], bf_list, next) { /* Free the buffer/mbuf */ ath_edma_rxbuf_free(sc, bf); } @@ -482,7 +489,7 @@ ath_edma_recv_proc_deferred_queue(struct ath_softc *sc, HAL_RX_QUEUE qtype, /* Copy the list over */ ATH_RX_LOCK(sc); - TAILQ_CONCAT(&rxlist, &sc->sc_rx_rxlist, bf_list); + TAILQ_CONCAT(&rxlist, &sc->sc_rx_rxlist[qtype], bf_list); ATH_RX_UNLOCK(sc); /* Handle the completed descriptors */ diff --git a/sys/dev/ath/if_athvar.h b/sys/dev/ath/if_athvar.h index 78580ac..703bb53 100644 --- a/sys/dev/ath/if_athvar.h +++ b/sys/dev/ath/if_athvar.h @@ -542,6 +542,7 @@ struct ath_softc { struct ath_rx_methods sc_rx; struct ath_rx_edma sc_rxedma[HAL_NUM_RX_QUEUES]; /* HP/LP queues */ + ath_bufhead sc_rx_rxlist[HAL_NUM_RX_QUEUES]; /* deferred RX completion */ struct ath_tx_methods sc_tx; struct ath_tx_edma_fifo sc_txedma[HAL_NUM_TX_QUEUES]; @@ -700,7 +701,6 @@ struct ath_softc { struct ath_descdma sc_rxdma; /* RX descriptors */ ath_bufhead sc_rxbuf; /* receive buffer */ - ath_bufhead sc_rx_rxlist; /* deferred RX completion */ u_int32_t *sc_rxlink; /* link ptr in last RX desc */ struct task sc_rxtask; /* rx int processing */ u_int8_t sc_defant; /* current default antenna */ |