Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/hyperv hvs(4), hvn(4): Set correct size for bus_dmam...



details:   https://anonhg.NetBSD.org/src/rev/75b3b2b2c616
branches:  trunk
changeset: 966991:75b3b2b2c616
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Mon Nov 25 08:53:39 2019 +0000

description:
hvs(4), hvn(4): Set correct size for bus_dmamap_sync(9).

diffstat:

 sys/dev/hyperv/hvs.c    |   7 ++++---
 sys/dev/hyperv/if_hvn.c |  16 ++++++++++------
 2 files changed, 14 insertions(+), 9 deletions(-)

diffs (86 lines):

diff -r 7d54f77fa18a -r 75b3b2b2c616 sys/dev/hyperv/hvs.c
--- a/sys/dev/hyperv/hvs.c      Mon Nov 25 05:35:26 2019 +0000
+++ b/sys/dev/hyperv/hvs.c      Mon Nov 25 08:53:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hvs.c,v 1.2 2019/10/01 18:00:08 chs Exp $      */
+/*     $NetBSD: hvs.c,v 1.3 2019/11/25 08:53:39 nonaka Exp $   */
 /*     $OpenBSD: hvs.c,v 1.17 2017/08/10 17:22:48 mikeb Exp $  */
 
 /*-
@@ -37,7 +37,7 @@
 /* #define HVS_DEBUG_IO */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hvs.c,v 1.2 2019/10/01 18:00:08 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hvs.c,v 1.3 2019/11/25 08:53:39 nonaka Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -1084,7 +1084,8 @@
                if (ccb->ccb_dmap == NULL)
                        continue;
 
-               bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap, 0, 0,
+               bus_dmamap_sync(sc->sc_dmat, ccb->ccb_dmap,
+                   0, ccb->ccb_dmap->dm_mapsize,
                    BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
                bus_dmamap_unload(sc->sc_dmat, ccb->ccb_dmap);
                bus_dmamap_destroy(sc->sc_dmat, ccb->ccb_dmap);
diff -r 7d54f77fa18a -r 75b3b2b2c616 sys/dev/hyperv/if_hvn.c
--- a/sys/dev/hyperv/if_hvn.c   Mon Nov 25 05:35:26 2019 +0000
+++ b/sys/dev/hyperv/if_hvn.c   Mon Nov 25 08:53:39 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: if_hvn.c,v 1.9 2019/11/22 12:40:07 nonaka Exp $        */
+/*     $NetBSD: if_hvn.c,v 1.10 2019/11/25 08:53:39 nonaka Exp $       */
 /*     $OpenBSD: if_hvn.c,v 1.39 2018/03/11 14:31:34 mikeb Exp $       */
 
 /*-
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.9 2019/11/22 12:40:07 nonaka Exp $");
+__KERNEL_RCSID(0, "$NetBSD: if_hvn.c,v 1.10 2019/11/25 08:53:39 nonaka Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_inet.h"
@@ -632,7 +632,8 @@
 {
        struct ifnet *ifp = SC2IFP(sc);
 
-       bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+       bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+           0, txd->txd_dmap->dm_mapsize,
            BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
        bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
        txd->txd_buf = NULL;
@@ -667,7 +668,8 @@
        }
        txd->txd_buf = NULL;
 
-       bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+       bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+           0, txd->txd_dmap->dm_mapsize,
            BUS_DMASYNC_POSTREAD | BUS_DMASYNC_POSTWRITE);
        bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
        m_freem(m);
@@ -844,7 +846,8 @@
                txd = &sc->sc_tx_desc[i];
                if (txd->txd_dmap == NULL)
                        continue;
-               bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap, 0, 0,
+               bus_dmamap_sync(sc->sc_dmat, txd->txd_dmap,
+                   0, txd->txd_dmap->dm_mapsize,
                    BUS_DMASYNC_POSTWRITE);
                bus_dmamap_unload(sc->sc_dmat, txd->txd_dmap);
                bus_dmamap_destroy(sc->sc_dmat, txd->txd_dmap);
@@ -855,7 +858,8 @@
                txd->txd_buf = NULL;
        }
        if (sc->sc_tx_rmap) {
-               bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap, 0, 0,
+               bus_dmamap_sync(sc->sc_dmat, sc->sc_tx_rmap,
+                   0, txd->txd_dmap->dm_mapsize,
                    BUS_DMASYNC_POSTWRITE);
                bus_dmamap_unload(sc->sc_dmat, sc->sc_tx_rmap);
                bus_dmamap_destroy(sc->sc_dmat, sc->sc_tx_rmap);



Home | Main Index | Thread Index | Old Index