Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic in nvme_attach() when creating the admin queue to...



details:   https://anonhg.NetBSD.org/src/rev/5224d2516208
branches:  trunk
changeset: 451996:5224d2516208
user:      mrg <mrg%NetBSD.org@localhost>
date:      Fri Jun 14 04:48:34 2019 +0000

description:
in nvme_attach() when creating the admin queue to probe the device info,
and also in nvme_dmamem_alloc(), allow as many DMA segment as would be
maximally needed for the size, rather than hard coding '2' for the form
and '1' for the latter.

now ld@nvme on i386 doesn't crash and i see at least 1.3GB/sec.

diffstat:

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

diffs (36 lines):

diff -r af1c4fb0ba99 -r 5224d2516208 sys/dev/ic/nvme.c
--- a/sys/dev/ic/nvme.c Fri Jun 14 03:35:31 2019 +0000
+++ b/sys/dev/ic/nvme.c Fri Jun 14 04:48:34 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $        */
+/*     $NetBSD: nvme.c,v 1.43 2019/06/14 04:48:34 mrg Exp $    */
 /*     $OpenBSD: nvme.c,v 1.49 2016/04/18 05:59:50 dlg Exp $ */
 
 /*
@@ -18,7 +18,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.42 2019/04/24 23:39:23 mlelstv Exp $");
+__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.43 2019/06/14 04:48:34 mrg Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -374,7 +374,7 @@
        sc->sc_rdy_to = NVME_CAP_TO(cap);
        sc->sc_mps = 1 << mps;
        sc->sc_mdts = MAXPHYS;
-       sc->sc_max_sgl = 2;
+       sc->sc_max_sgl = btoc(round_page(sc->sc_mdts));
 
        if (nvme_disable(sc) != 0) {
                aprint_error_dev(sc->sc_dev, "unable to disable controller\n");
@@ -1870,7 +1870,7 @@
 
        ndm->ndm_size = size;
 
-       if (bus_dmamap_create(sc->sc_dmat, size, 1, size, 0,
+       if (bus_dmamap_create(sc->sc_dmat, size, btoc(round_page(size)), size, 0,
            BUS_DMA_WAITOK | BUS_DMA_ALLOCNOW, &ndm->ndm_map) != 0)
                goto ndmfree;
 



Home | Main Index | Thread Index | Old Index