From owner-svn-src-projects@FreeBSD.ORG Sat Apr 18 23:08:53 2015 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 85055A79; Sat, 18 Apr 2015 23:08:53 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 736EBE94; Sat, 18 Apr 2015 23:08:53 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id t3IN8rvE069009; Sat, 18 Apr 2015 23:08:53 GMT (envelope-from sbruno@FreeBSD.org) Received: (from sbruno@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id t3IN8rZu069008; Sat, 18 Apr 2015 23:08:53 GMT (envelope-from sbruno@FreeBSD.org) Message-Id: <201504182308.t3IN8rZu069008@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: sbruno set sender to sbruno@FreeBSD.org using -f From: Sean Bruno Date: Sat, 18 Apr 2015 23:08:53 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r281717 - projects/em_mq/sys/dev/e1000 X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Apr 2015 23:08:53 -0000 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)));