From: sf Date: Sun, 26 Apr 2015 12:27:29 +0000 (+0000) Subject: Have vio_start() check if the queue is empty. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=75eb60f4d526de3058ba236c414c1821d1810a8e;p=openbsd Have vio_start() check if the queue is empty. from brad@ --- diff --git a/sys/dev/pci/if_vio.c b/sys/dev/pci/if_vio.c index 9a297e1bca9..7235e863fa3 100644 --- a/sys/dev/pci/if_vio.c +++ b/sys/dev/pci/if_vio.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_vio.c,v 1.29 2015/04/26 12:19:24 sf Exp $ */ +/* $OpenBSD: if_vio.c,v 1.30 2015/04/26 12:27:29 sf Exp $ */ /* * Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg. @@ -726,6 +726,8 @@ vio_start(struct ifnet *ifp) if ((ifp->if_flags & (IFF_RUNNING|IFF_OACTIVE)) != IFF_RUNNING) return; + if (IFQ_IS_EMPTY(&ifp->if_snd)) + return; again: for (;;) { @@ -1117,8 +1119,7 @@ vio_tx_intr(struct virtqueue *vq) int r; r = vio_txeof(vq); - if (!IFQ_IS_EMPTY(&ifp->if_snd)) - vio_start(ifp); + vio_start(ifp); return r; }