Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci Reuse mbuf when retrying in vioif_start



details:   https://anonhg.NetBSD.org/src/rev/c8add68b6063
branches:  trunk
changeset: 805233:c8add68b6063
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Thu Dec 25 06:39:26 2014 +0000

description:
Reuse mbuf when retrying in vioif_start

Otherwise, the old mbuf will leak.

diffstat:

 sys/dev/pci/if_vioif.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (42 lines):

diff -r 95949ab6a575 -r c8add68b6063 sys/dev/pci/if_vioif.c
--- a/sys/dev/pci/if_vioif.c    Thu Dec 25 05:15:42 2014 +0000
+++ b/sys/dev/pci/if_vioif.c    Thu Dec 25 06:39:26 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vioif.c,v 1.13 2014/12/24 02:48:24 ozaki-r Exp $    */
+/*     $NetBSD: if_vioif.c,v 1.14 2014/12/25 06:39:26 ozaki-r Exp $    */
 
 /*
  * Copyright (c) 2010 Minoura Makoto.
@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.13 2014/12/24 02:48:24 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.14 2014/12/25 06:39:26 ozaki-r Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -758,12 +758,13 @@
                if (m == NULL)
                        break;
 
+retry:
                r = virtio_enqueue_prep(vsc, vq, &slot);
                if (r == EAGAIN) {
                        ifp->if_flags |= IFF_OACTIVE;
                        vioif_tx_vq_done_locked(vq);
                        if (retry++ == 0)
-                               continue;
+                               goto retry;
                        else
                                break;
                }
@@ -786,7 +787,7 @@
                        ifp->if_flags |= IFF_OACTIVE;
                        vioif_tx_vq_done_locked(vq);
                        if (retry++ == 0)
-                               continue;
+                               goto retry;
                        else
                                break;
                }



Home | Main Index | Thread Index | Old Index