Module Name:    src
Committed By:   uwe
Date:           Tue Nov 29 21:54:11 UTC 2016

Modified Files:
        src/sys/dev/pci: if_vioif.c

Log Message:
vioif_start() - do not call virtio_enqueue_abort() after error from
virtio_enqueue_reserve(), as it's already done by the latter, so we
ended up with a kind of "double free" that messed up out free list of
vq_entry's.

This is even documented in a "typical usage" comment in virtio.c (and
those quotes are not intended to be sarcastic).

PR 51132 - virtio net device stuck for UDP burst transmission


To generate a diff of this commit:
cvs rdiff -u -r1.26 -r1.27 src/sys/dev/pci/if_vioif.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/pci/if_vioif.c
diff -u src/sys/dev/pci/if_vioif.c:1.26 src/sys/dev/pci/if_vioif.c:1.27
--- src/sys/dev/pci/if_vioif.c:1.26	Tue Sep 27 03:33:32 2016
+++ src/sys/dev/pci/if_vioif.c	Tue Nov 29 21:54:11 2016
@@ -1,4 +1,4 @@
-/*	$NetBSD: if_vioif.c,v 1.26 2016/09/27 03:33:32 pgoyette Exp $	*/
+/*	$NetBSD: if_vioif.c,v 1.27 2016/11/29 21:54:11 uwe Exp $	*/
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.26 2016/09/27 03:33:32 pgoyette Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.27 2016/11/29 21:54:11 uwe Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -823,7 +823,6 @@ retry:
 		r = virtio_enqueue_reserve(vsc, vq, slot,
 					sc->sc_tx_dmamaps[slot]->dm_nsegs + 1);
 		if (r != 0) {
-			virtio_enqueue_abort(vsc, vq, slot);
 			bus_dmamap_unload(vsc->sc_dmat,
 					  sc->sc_tx_dmamaps[slot]);
 			ifp->if_flags |= IFF_OACTIVE;

Reply via email to