Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci Allocate enough space for the bus_dmamap_t array...



details:   https://anonhg.NetBSD.org/src/rev/20e5c57e60d4
branches:  trunk
changeset: 1018446:20e5c57e60d4
user:      reinoud <reinoud%NetBSD.org@localhost>
date:      Wed Feb 03 20:27:59 2021 +0000

description:
Allocate enough space for the bus_dmamap_t arrays for rxq_hdr_dmamaps[] and
txq_hdr_maps[]

diffstat:

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

diffs (29 lines):

diff -r 437558870b60 -r 20e5c57e60d4 sys/dev/pci/if_vioif.c
--- a/sys/dev/pci/if_vioif.c    Wed Feb 03 18:13:13 2021 +0000
+++ b/sys/dev/pci/if_vioif.c    Wed Feb 03 20:27:59 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_vioif.c,v 1.67 2021/01/31 14:17:48 reinoud Exp $    */
+/*     $NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud 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.67 2021/01/31 14:17:48 reinoud Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_vioif.c,v 1.68 2021/02/03 20:27:59 reinoud Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_net_mpsafe.h"
@@ -574,8 +574,8 @@
                rxq = &sc->sc_rxq[qid];
                txq = &sc->sc_txq[qid];
 
-               allocsize += sc->sc_hdr_size * rxq->rxq_vq->vq_num;
-               allocsize += sc->sc_hdr_size * txq->txq_vq->vq_num;
+               allocsize += sizeof(struct virtio_net_hdr *) *
+                       (rxq->rxq_vq->vq_num + txq->txq_vq->vq_num);
        }
        if (sc->sc_has_ctrl) {
                allocsize += sizeof(struct virtio_net_ctrl_cmd) * 1;



Home | Main Index | Thread Index | Old Index