Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci vioif(4): fix missing virtio_enqueue_abort for e...



details:   https://anonhg.NetBSD.org/src/rev/d9a59f34bb0c
branches:  trunk
changeset: 373959:d9a59f34bb0c
user:      yamaguchi <yamaguchi%NetBSD.org@localhost>
date:      Thu Mar 23 01:46:30 2023 +0000

description:
vioif(4): fix missing virtio_enqueue_abort for error handling

diffstat:

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

diffs (40 lines):

diff -r 8f6ad3e80ecb -r d9a59f34bb0c sys/dev/pci/if_vioif.c
--- a/sys/dev/pci/if_vioif.c    Thu Mar 23 01:42:32 2023 +0000
+++ b/sys/dev/pci/if_vioif.c    Thu Mar 23 01:46:30 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $  */
+/*     $NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $  */
 
 /*
  * Copyright (c) 2020 The NetBSD Foundation, Inc.
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.89 2023/03/23 01:42:32 yamaguchi Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.90 2023/03/23 01:46:30 yamaguchi Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -1545,11 +1545,13 @@
                if (m == NULL) {
                        MGETHDR(m, M_DONTWAIT, MT_DATA);
                        if (m == NULL) {
+                               virtio_enqueue_abort(vsc, vq, slot);
                                rxq->rxq_mbuf_enobufs.ev_count++;
                                break;
                        }
                        MCLGET(m, M_DONTWAIT);
                        if ((m->m_flags & M_EXT) == 0) {
+                               virtio_enqueue_abort(vsc, vq, slot);
                                m_freem(m);
                                rxq->rxq_mbuf_enobufs.ev_count++;
                                break;
@@ -1562,6 +1564,7 @@
                            rxq->rxq_dmamaps[slot], m, BUS_DMA_READ | BUS_DMA_NOWAIT);
 
                        if (r != 0) {
+                               virtio_enqueue_abort(vsc, vq, slot);
                                m_freem(m);
                                rxq->rxq_mbuf_load_failed.ev_count++;
                                break;



Home | Main Index | Thread Index | Old Index