Module Name: src Committed By: reinoud Date: Wed Feb 3 20:28:00 UTC 2021
Modified Files: src/sys/dev/pci: if_vioif.c Log Message: Allocate enough space for the bus_dmamap_t arrays for rxq_hdr_dmamaps[] and txq_hdr_maps[] To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 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.67 src/sys/dev/pci/if_vioif.c:1.68 --- src/sys/dev/pci/if_vioif.c:1.67 Sun Jan 31 14:17:48 2021 +++ src/sys/dev/pci/if_vioif.c Wed Feb 3 20:27:59 2021 @@ -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 @@ vioif_alloc_mems(struct vioif_softc *sc) 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;