Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 4 Jul 2017 00:06:57 +0000 (UTC)
From:      Zbigniew Bodek <zbb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r320630 - head/sys/dev/ena
Message-ID:  <201707040006.v6406vqA083048@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: zbb
Date: Tue Jul  4 00:06:56 2017
New Revision: 320630
URL: https://svnweb.freebsd.org/changeset/base/320630

Log:
  Remove RX mtx from ENA driver
  
  RX lock is no longer required. There can only be one RX cleanup task
  running at a time, RX cleanup cannot be executed if interface is not
  yet initialized and ena_down() will not free any RX resources if any io
  interrupt is being handled - RX cleanup task is only called from an
  interrupt handler.
  
  Submitted by:   Michal Krawczyk <mk@semihalf.com>
  Obtained from:  Semihalf
  Sponsored by:   Amazon.com Inc.

Modified:
  head/sys/dev/ena/ena.c

Modified: head/sys/dev/ena/ena.c
==============================================================================
--- head/sys/dev/ena/ena.c	Tue Jul  4 00:04:31 2017	(r320629)
+++ head/sys/dev/ena/ena.c	Tue Jul  4 00:06:56 2017	(r320630)
@@ -476,7 +476,6 @@ ena_init_io_rings(struct ena_adapter *adapter)
 		    device_get_nameunit(adapter->pdev), i);
 
 		mtx_init(&txr->ring_mtx, txr->mtx_name, NULL, MTX_DEF);
-		mtx_init(&rxr->ring_mtx, rxr->mtx_name, NULL, MTX_DEF);
 
 		que = &adapter->que[i];
 		que->adapter = adapter;
@@ -509,7 +508,6 @@ ena_free_io_ring_resources(struct ena_adapter *adapter
 	    sizeof(rxr->rx_stats));
 
 	mtx_destroy(&txr->ring_mtx);
-	mtx_destroy(&rxr->ring_mtx);
 
 	drbr_free(txr->br, M_DEVBUF);
 
@@ -947,10 +945,8 @@ ena_alloc_rx_mbuf(struct ena_adapter *adapter,
 	if (rx_info->mbuf != NULL)
 		return (0);
 
-	ENA_RING_MTX_LOCK(rx_ring);
 	/* Get mbuf using UMA allocator */
 	rx_info->mbuf = m_getjcl(M_NOWAIT, MT_DATA, M_PKTHDR, MJUM16BYTES);
-	ENA_RING_MTX_UNLOCK(rx_ring);
 
 	if (!rx_info->mbuf) {
 		counter_u64_add(rx_ring->rx_stats.mbuf_alloc_fail, 1);



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