svn commit: r349696 - stable/12/usr.sbin/bhyve

Vincenzo Maffione vmaffione at FreeBSD.org
Wed Jul 3 19:59:49 UTC 2019


Author: vmaffione
Date: Wed Jul  3 19:59:48 2019
New Revision: 349696
URL: https://svnweb.freebsd.org/changeset/base/349696

Log:
  MFC r349175
  
  bhyve: vtnet: fix locking on receive
  
  The vsc_rx_ready and the RX virtqueue is protected by the rx_mtx lock.
  However, pci_vtnet_ping_rxq() (currently called only once after each
  device reset) accesses those without acquiring the lock.
  
  Reviewed by:    markj
  Differential Revision:  https://reviews.freebsd.org/D20609

Modified:
  stable/12/usr.sbin/bhyve/pci_virtio_net.c
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/usr.sbin/bhyve/pci_virtio_net.c
==============================================================================
--- stable/12/usr.sbin/bhyve/pci_virtio_net.c	Wed Jul  3 19:57:23 2019	(r349695)
+++ stable/12/usr.sbin/bhyve/pci_virtio_net.c	Wed Jul  3 19:59:48 2019	(r349696)
@@ -580,10 +580,12 @@ pci_vtnet_ping_rxq(void *vsc, struct vqueue_info *vq)
 	/*
 	 * A qnotify means that the rx process can now begin
 	 */
+	pthread_mutex_lock(&sc->rx_mtx);
 	if (sc->vsc_rx_ready == 0) {
 		sc->vsc_rx_ready = 1;
 		vq_kick_disable(vq);
 	}
+	pthread_mutex_unlock(&sc->rx_mtx);
 }
 
 static void


More information about the svn-src-all mailing list