Date: Mon, 1 Aug 2016 11:24:10 GMT From: vincenzo@FreeBSD.org To: svn-soc-all@FreeBSD.org Subject: socsvn commit: r307059 - soc2016/vincenzo/head/usr.sbin/bhyve Message-ID: <201608011124.u71BOA9e066521@socsvn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: vincenzo Date: Mon Aug 1 11:24:09 2016 New Revision: 307059 URL: http://svnweb.FreeBSD.org/socsvn/?view=rev&rev=307059 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 11:23:53 2016 (r307058) +++ soc2016/vincenzo/head/usr.sbin/bhyve/pci_virtio_net.c Mon Aug 1 11:24:09 2016 (r307059) @@ -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); /*
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608011124.u71BOA9e066521>