summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorreyk <reyk@openbsd.org>2013-06-03 15:05:29 +0000
committerreyk <reyk@openbsd.org>2013-06-03 15:05:29 +0000
commit9b2ff244d16688d0d3dc741a12d8d34575cedeb7 (patch)
tree140eaaf03cb00bf9302d8bb170b3c1ca7d29cc85
parentput back the match member to the anchor stack struct - userland (pfctl) (diff)
downloadwireguard-openbsd-9b2ff244d16688d0d3dc741a12d8d34575cedeb7.tar.xz
wireguard-openbsd-9b2ff244d16688d0d3dc741a12d8d34575cedeb7.zip
Use IF_POLL to check for available transmit descriptors before IF_DEQUEUE.
ok uebayasi@ yasuoka@ dlg@
-rw-r--r--sys/dev/pci/if_vmx.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/sys/dev/pci/if_vmx.c b/sys/dev/pci/if_vmx.c
index d7e5e935f07..d9fc9241423 100644
--- a/sys/dev/pci/if_vmx.c
+++ b/sys/dev/pci/if_vmx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vmx.c,v 1.1 2013/05/31 20:14:18 uebayasi Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.2 2013/06/03 15:05:29 reyk Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
@@ -1038,7 +1038,10 @@ vmxnet3_start(struct ifnet *ifp)
if ((ifp->if_flags & (IFF_RUNNING | IFF_OACTIVE)) != IFF_RUNNING)
return;
- while (IFQ_LEN(&ifp->if_snd) > 0) {
+ for (;;) {
+ IFQ_POLL(&ifp->if_snd, m);
+ if (m == NULL)
+ break;
if ((ring->next - ring->head - 1) % NTXDESC < 8) {
ifp->if_flags |= IFF_OACTIVE;
break;