From 181aa517b67152fddacaf403324243217fa46ca0 Mon Sep 17 00:00:00 2001 From: bryanv Date: Sat, 5 Oct 2013 18:07:24 +0000 Subject: [PATCH] Do not hold the vtnet Rx queue lock when calling up into the stack This matches other similar drivers and avoids various LOR warnings. Approved by: re (marius) --- sys/dev/virtio/network/if_vtnet.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/virtio/network/if_vtnet.c b/sys/dev/virtio/network/if_vtnet.c index 93c60075ebce..3276ae2ced1a 100644 --- a/sys/dev/virtio/network/if_vtnet.c +++ b/sys/dev/virtio/network/if_vtnet.c @@ -1700,9 +1700,9 @@ vtnet_rxq_input(struct vtnet_rxq *rxq, struct mbuf *m, rxq->vtnrx_stats.vrxs_ipackets++; rxq->vtnrx_stats.vrxs_ibytes += m->m_pkthdr.len; - /* VTNET_RXQ_UNLOCK(rxq); */ + VTNET_RXQ_UNLOCK(rxq); (*ifp->if_input)(ifp, m); - /* VTNET_RXQ_LOCK(rxq); */ + VTNET_RXQ_LOCK(rxq); } static int @@ -1782,6 +1782,10 @@ vtnet_rxq_eof(struct vtnet_rxq *rxq) m_adj(m, adjsz); vtnet_rxq_input(rxq, m, hdr); + + /* Must recheck after dropping the Rx lock. */ + if ((ifp->if_drv_flags & IFF_DRV_RUNNING) == 0) + break; } if (deq > 0)