summaryrefslogtreecommitdiff
path: root/sys/dev
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2016-04-14 06:20:35 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2016-04-14 06:20:35 +0000
commite0d60a5cb8dbc453e468b8b7b3afc09bea5918ea (patch)
tree054260db452c7bc9c74521fa28ce356153276d66 /sys/dev
parent955b04ec08697a0cd1db25e63f1af0418af1b99d (diff)
reallocate the ccbs after we figure out how big the sgls can be
we run with 2 entries for the nvme controller identify, and then bump it up to cover the maxphys divided by the page size we negotiate.
Diffstat (limited to 'sys/dev')
-rw-r--r--sys/dev/ic/nvme.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c
index 94dd77a82c2..0d47e298871 100644
--- a/sys/dev/ic/nvme.c
+++ b/sys/dev/ic/nvme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nvme.c,v 1.41 2016/04/14 06:17:14 dlg Exp $ */
+/* $OpenBSD: nvme.c,v 1.42 2016/04/14 06:20:34 dlg Exp $ */
/*
* Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
@@ -346,6 +346,15 @@ nvme_attach(struct nvme_softc *sc)
goto disable;
}
+ /* we know how big things are now */
+ sc->sc_max_sgl = sc->sc_mdts / sc->sc_mps;
+
+ nvme_ccbs_free(sc);
+ if (nvme_ccbs_alloc(sc, 64) != 0) {
+ printf("%s: unable to allocate ccbs\n", DEVNAME(sc));
+ goto free_admin_q;
+ }
+
sc->sc_q = nvme_q_alloc(sc, 1, 128, dstrd);
if (sc->sc_q == NULL) {
printf("%s: unable to allocate io q\n", DEVNAME(sc));