Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 18 Apr 2015 23:08:53 +0000 (UTC)
From:      Sean Bruno <sbruno@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-projects@freebsd.org
Subject:   svn commit: r281717 - projects/em_mq/sys/dev/e1000
Message-ID:  <201504182308.t3IN8rZu069008@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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)));



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201504182308.t3IN8rZu069008>