svn commit: r280163 - head/sys/dev/sfxge
Andrew Rybchenko
arybchik at FreeBSD.org
Tue Mar 17 08:23:16 UTC 2015
Author: arybchik
Date: Tue Mar 17 08:23:15 2015
New Revision: 280163
URL: https://svnweb.freebsd.org/changeset/base/280163
Log:
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)
Modified:
head/sys/dev/sfxge/sfxge_tx.c
Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c Tue Mar 17 08:21:31 2015 (r280162)
+++ head/sys/dev/sfxge/sfxge_tx.c Tue Mar 17 08:23:15 2015 (r280163)
@@ -423,8 +423,10 @@ sfxge_tx_qdpl_drain(struct sfxge_txq *tx
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;
More information about the svn-src-head
mailing list