summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Fritsch <sf@cvs.openbsd.org>2015-04-24 12:53:36 +0000
committerStefan Fritsch <sf@cvs.openbsd.org>2015-04-24 12:53:36 +0000
commit2bff5ed03b848954b5a92af27142653cffcf02d0 (patch)
tree737e7506c86ab225829721d78091aa978200b281
parent042de432415efe071cc06625809c1c7cafd154cb (diff)
vio: If enqueue fails, drop packet.
From brad@
-rw-r--r--sys/dev/pci/if_vio.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/sys/dev/pci/if_vio.c b/sys/dev/pci/if_vio.c
index 120b2607351..316e7429dce 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.27 2015/04/18 14:38:38 sf Exp $ */
+/* $OpenBSD: if_vio.c,v 1.28 2015/04/24 12:53:35 sf Exp $ */
/*
* Copyright (c) 2012 Stefan Fritsch, Alexander Fiveg.
@@ -740,13 +740,11 @@ again:
panic("enqueue_prep for a tx buffer: %d", r);
r = vio_encap(sc, slot, m);
if (r != 0) {
-#if VIRTIO_DEBUG
- if (r != ENOBUFS)
- printf("%s: error %d\n", __func__, r);
-#endif
virtio_enqueue_abort(vq, slot);
- ifp->if_flags |= IFF_OACTIVE;
- break;
+ IFQ_DEQUEUE(&ifp->if_snd, m);
+ m_freem(m);
+ ifp->if_oerrors++;
+ continue;
}
r = virtio_enqueue_reserve(vq, slot,
sc->sc_tx_dmamaps[slot]->dm_nsegs + 1);