From: arybchik Date: Tue, 17 Mar 2015 08:23:15 +0000 (+0000) Subject: sfxge: prefetch txq->common if TxQ is started only X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=26943bdbf39d9b3b32140814a3868c4e5b2a04f3;p=people%2Fjulieng%2Ffreebsd.git 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) --- diff --git a/sys/dev/sfxge/sfxge_tx.c b/sys/dev/sfxge/sfxge_tx.c index 1169ecb0984e..00ffda321a91 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;