diff options
author | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:45:20 +0000 |
---|---|---|
committer | arybchik <arybchik@FreeBSD.org> | 2015-03-25 13:45:20 +0000 |
commit | 04d32c238f4ecd19d6e7b0b12b442934d7128056 (patch) | |
tree | 28160a5eec47e8f1819c5c470193ea9c2387e573 | |
parent | 71c9b1feb3cf571e1936bc7c66e56de952abdbd9 (diff) | |
download | FreeBSD-src-04d32c238f4ecd19d6e7b0b12b442934d7128056.zip FreeBSD-src-04d32c238f4ecd19d6e7b0b12b442934d7128056.tar.gz |
MFC: 280163
sfxge: prefetch txq->common if TxQ is started only
Transmit may be called when TxQ is not started yet (i.e. txq->common is
invalid). TxQ state is checked below when mbuf is processed and dropped
if TxQ is not started.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
-rw-r--r-- | sys/dev/sfxge/sfxge_tx.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 8fd7c2b..7ea8005 100644 --- a/sys/dev/sfxge/sfxge_tx.c +++ b/sys/dev/sfxge/sfxge_tx.c @@ -423,8 +423,10 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *txq) stdp = &txq->dpl; pushed = txq->added; - prefetch_read_many(sc->enp); - prefetch_read_many(txq->common); + if (__predict_true(txq->init_state == SFXGE_TXQ_STARTED)) { + prefetch_read_many(sc->enp); + prefetch_read_many(txq->common); + } mbuf = stdp->std_get; count = stdp->std_get_count; |