socsvn commit: r307053 - soc2016/vincenzo/head/usr.sbin/bhyve

vincenzo at FreeBSD.org vincenzo at FreeBSD.org
Mon Aug 1 08:02:32 UTC 2016


Author: vincenzo
Date: Mon Aug  1 08:02:31 2016
New Revision: 307053
URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307053

Log:
   pci_virtio_net: remove useless rx_in_progress flag

Modified:
  soc2016/vincenzo/head/usr.sbin/bhyve/pci_virtio_net.c

Modified: soc2016/vincenzo/head/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- soc2016/vincenzo/head/usr.sbin/bhyve/pci_virtio_net.c	Mon Aug  1 08:02:11 2016	(r307052)
+++ soc2016/vincenzo/head/usr.sbin/bhyve/pci_virtio_net.c	Mon Aug  1 08:02:31 2016	(r307053)
@@ -147,7 +147,6 @@
 	struct virtio_net_config vsc_config;
 
 	pthread_mutex_t	rx_mtx;
-	int		rx_in_progress; /* XXX-VM: useless. */
 	int		rx_vhdrlen;
 	int		rx_merge;	/* merged rx bufs in use */
 
@@ -197,17 +196,13 @@
 
 /*
  * If the receive thread is active then stall until it is done.
+ * It is enough to lock and unlock the RX mutex.
  */
 static void
 pci_vtnet_rxwait(struct pci_vtnet_softc *sc)
 {
 
 	pthread_mutex_lock(&sc->rx_mtx);
-	while (sc->rx_in_progress) {
-		pthread_mutex_unlock(&sc->rx_mtx);
-		usleep(10000);
-		pthread_mutex_lock(&sc->rx_mtx);
-	}
 	pthread_mutex_unlock(&sc->rx_mtx);
 }
 
@@ -584,9 +579,7 @@
 	struct pci_vtnet_softc *sc = param;
 
 	pthread_mutex_lock(&sc->rx_mtx);
-	sc->rx_in_progress = 1;
 	sc->pci_vtnet_rx(sc);
-	sc->rx_in_progress = 0;
 	pthread_mutex_unlock(&sc->rx_mtx);
 
 }
@@ -901,7 +894,6 @@
 
 	sc->rx_merge = 1;
 	sc->rx_vhdrlen = sizeof(struct virtio_net_rxhdr);
-	sc->rx_in_progress = 0;
 	pthread_mutex_init(&sc->rx_mtx, NULL); 
 
 	/* 


More information about the svn-soc-all mailing list