summaryrefslogtreecommitdiffstats
path: root/sys/dev/nvd/nvd.c
diff options
context:
space:
mode:
authorjimharris <jimharris@FreeBSD.org>2012-10-18 00:32:07 +0000
committerjimharris <jimharris@FreeBSD.org>2012-10-18 00:32:07 +0000
commitc070c3fe817d16552546a6954df85a4731b3e8be (patch)
tree4db66064fe7cf4ae165af763fcf230f22e61d0fc /sys/dev/nvd/nvd.c
parent20df59b294c348ddc1e7d3683cb6b3fdf7858f91 (diff)
downloadFreeBSD-src-c070c3fe817d16552546a6954df85a4731b3e8be.zip
FreeBSD-src-c070c3fe817d16552546a6954df85a4731b3e8be.tar.gz
Add return codes to all functions used for submitting commands to I/O
queues. Sponsored by: Intel
Diffstat (limited to 'sys/dev/nvd/nvd.c')
-rw-r--r--sys/dev/nvd/nvd.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/nvd/nvd.c b/sys/dev/nvd/nvd.c
index 2017d79..889401b 100644
--- a/sys/dev/nvd/nvd.c
+++ b/sys/dev/nvd/nvd.c
@@ -214,9 +214,21 @@ nvd_bioq_process(void *arg, int pending)
err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done);
+ /*
+ * TODO: remove this loop and rely on GEOM's pacing once
+ * nvme(4) returns ENOMEM only for malloc() failures.
+ * Currently nvme(4) returns ENOMEM also for cases when
+ * the submission queue is completely full, and that case
+ * will be handled more elegantly in a future update.
+ */
+ while (err == ENOMEM) {
+ pause("nvd enomem", 1);
+ err = nvme_ns_bio_process(ndisk->ns, bp, nvd_done);
+ }
+
if (err) {
atomic_add_acq_int(&ndisk->cur_depth, -1);
- bp->bio_error = EIO;
+ bp->bio_error = err;
bp->bio_flags |= BIO_ERROR;
bp->bio_resid = bp->bio_bcount;
biodone(bp);
OpenPOWER on IntegriCloud