svn commit: r281717 - projects/em_mq/sys/dev/e1000

Sean Bruno sbruno at FreeBSD.org
Sat Apr 18 23:08:53 UTC 2015


Author: sbruno
Date: Sat Apr 18 23:08:52 2015
New Revision: 281717
URL: https://svnweb.freebsd.org/changeset/base/281717

Log:
  Acquire tx lock when attempting to insert into the buf ring.  An rxeof can
  initiate a transmit and will have the same address of an mbuf as an already
  inserted entry. Attempt to not do that by only allowing one thread to insert
  into the tx buf ring per queue.
  
  Add queue information in a clearer output for the queue debug function.

Modified:
  projects/em_mq/sys/dev/e1000/if_em.c

Modified: projects/em_mq/sys/dev/e1000/if_em.c
==============================================================================
--- projects/em_mq/sys/dev/e1000/if_em.c	Sat Apr 18 21:54:00 2015	(r281716)
+++ projects/em_mq/sys/dev/e1000/if_em.c	Sat Apr 18 23:08:52 2015	(r281717)
@@ -1010,7 +1010,9 @@ em_mq_start(if_t ifp, struct mbuf *m)
 
 	txr = &adapter->tx_rings[i];
 
+	EM_TX_LOCK(txr);
 	error = drbr_enqueue(ifp, txr->br, m);
+	EM_TX_UNLOCK(txr);
 	if (error)
 		return (error);
 
@@ -5915,6 +5917,7 @@ em_print_debug_info(struct adapter *adap
 		printf("and ACTIVE\n");
 
 	for (int i = 0; i < adapter->num_tx_queues; i++, txr++) {
+		device_printf(dev, "TX Queue %d ------\n", i);
 		device_printf(dev, "hw tdh = %d, hw tdt = %d\n",
 	    		E1000_READ_REG(&adapter->hw, E1000_TDH(i)),
 	    		E1000_READ_REG(&adapter->hw, E1000_TDT(i)));
@@ -5925,6 +5928,7 @@ em_print_debug_info(struct adapter *adap
 	    		txr->no_desc_avail);
 	}
 	for (int i = 0; i < adapter->num_rx_queues; i++, rxr++) {
+		device_printf(dev, "RX Queue %d ------\n", i);
 		device_printf(dev, "hw rdh = %d, hw rdt = %d\n",
 	    		E1000_READ_REG(&adapter->hw, E1000_RDH(i)),
 	    		E1000_READ_REG(&adapter->hw, E1000_RDT(i)));


More information about the svn-src-projects mailing list