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 MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D20609
This commit is contained in:
parent
edd96b9fb9
commit
5c2b348a54
@ -583,10 +583,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
|
||||
|
Loading…
x
Reference in New Issue
Block a user