svn commit: r277889 - head/sys/dev/sfxge

Andrew Rybchenko arybchik at FreeBSD.org
Thu Jan 29 19:01:11 UTC 2015


Author: arybchik
Date: Thu Jan 29 19:01:09 2015
New Revision: 277889
URL: https://svnweb.freebsd.org/changeset/base/277889

Log:
  sfxge: Add evq argument to sfxge_tx_qcomplete()
  
  It removes necessity to get evq pointer by its index in soft context.
  
  Sponsored by:   Solarflare Communications, Inc.
  Approved by:    gnn (mentor)

Modified:
  head/sys/dev/sfxge/sfxge_ev.c
  head/sys/dev/sfxge/sfxge_tx.c
  head/sys/dev/sfxge/sfxge_tx.h

Modified: head/sys/dev/sfxge/sfxge_ev.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_ev.c	Thu Jan 29 18:59:22 2015	(r277888)
+++ head/sys/dev/sfxge/sfxge_ev.c	Thu Jan 29 19:01:09 2015	(r277889)
@@ -68,7 +68,7 @@ sfxge_ev_qcomplete(struct sfxge_evq *evq
 			    ("txq->evq_index != index"));
 
 			if (txq->pending != txq->completed)
-				sfxge_tx_qcomplete(txq);
+				sfxge_tx_qcomplete(txq, evq);
 
 			txq = next;
 		} while (txq != NULL);
@@ -262,7 +262,7 @@ sfxge_ev_tx(void *arg, uint32_t label, u
 	}
 
 	if (txq->pending - txq->completed >= SFXGE_TX_BATCH)
-		sfxge_tx_qcomplete(txq);
+		sfxge_tx_qcomplete(txq, evq);
 
 done:
 	return (evq->tx_done >= SFXGE_EV_BATCH);

Modified: head/sys/dev/sfxge/sfxge_tx.c
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.c	Thu Jan 29 18:59:22 2015	(r277888)
+++ head/sys/dev/sfxge/sfxge_tx.c	Thu Jan 29 19:01:09 2015	(r277889)
@@ -105,15 +105,10 @@ static int sfxge_tx_queue_tso(struct sfx
 			      const bus_dma_segment_t *dma_seg, int n_dma_seg);
 
 void
-sfxge_tx_qcomplete(struct sfxge_txq *txq)
+sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq)
 {
-	struct sfxge_softc *sc;
-	struct sfxge_evq *evq;
 	unsigned int completed;
 
-	sc = txq->sc;
-	evq = sc->evq[txq->evq_index];
-
 	mtx_assert(&evq->lock, MA_OWNED);
 
 	completed = txq->completed;
@@ -1147,7 +1142,7 @@ sfxge_tx_qstop(struct sfxge_softc *sc, u
 	txq->blocked = 0;
 	txq->pending = txq->added;
 
-	sfxge_tx_qcomplete(txq);
+	sfxge_tx_qcomplete(txq, evq);
 	KASSERT(txq->completed == txq->added,
 	    ("txq->completed != txq->added"));
 

Modified: head/sys/dev/sfxge/sfxge_tx.h
==============================================================================
--- head/sys/dev/sfxge/sfxge_tx.h	Thu Jan 29 18:59:22 2015	(r277888)
+++ head/sys/dev/sfxge/sfxge_tx.h	Thu Jan 29 19:01:09 2015	(r277889)
@@ -175,13 +175,15 @@ struct sfxge_txq {
 	struct sfxge_txq		*next;
 };
 
+struct sfxge_evq;
+
 extern int sfxge_tx_packet_add(struct sfxge_txq *, struct mbuf *);
 
 extern int sfxge_tx_init(struct sfxge_softc *sc);
 extern void sfxge_tx_fini(struct sfxge_softc *sc);
 extern int sfxge_tx_start(struct sfxge_softc *sc);
 extern void sfxge_tx_stop(struct sfxge_softc *sc);
-extern void sfxge_tx_qcomplete(struct sfxge_txq *txq);
+extern void sfxge_tx_qcomplete(struct sfxge_txq *txq, struct sfxge_evq *evq);
 extern void sfxge_tx_qflush_done(struct sfxge_txq *txq);
 #ifdef SFXGE_HAVE_MQ
 extern void sfxge_if_qflush(struct ifnet *ifp);


More information about the svn-src-head mailing list