diff options
| author | riastradh <riastradh@NetBSD.org> | 2022-08-30 01:13:10 +0000 |
|---|---|---|
| committer | riastradh <riastradh@NetBSD.org> | 2022-08-30 01:13:10 +0000 |
| commit | ecfcf4d90aea49e5e49967c23706e687cec2dc20 (patch) | |
| tree | d55c9de66d7fa6dac497c5cff33487cabc4e4ddd /sys/dev | |
| parent | 848ec183d996ef061a21d92b4f33bb4ae1ef904e (diff) | |
nvme(4): If bp is null or bp->b_ci is not assigned, use curcpu().
curcpu() might be stale by the time we're done, but it's still safe
to pass it to cpu_index, and this is just used as a best-effort
mechanism to keep I/O on queues handled by the same CPU.
bp is not always provided, and bp->b_ci is not always assigned,
e.g. when dumping. (If bp->b_ci is supposed to be always assigned,
then we need to audit all the paths into it to assign it in those
where it's not.)
Fixes dump on nvme.
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ic/nvme.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/ic/nvme.c b/sys/dev/ic/nvme.c index a4b395e30e7..17f5b5f1459 100644 --- a/sys/dev/ic/nvme.c +++ b/sys/dev/ic/nvme.c @@ -1,4 +1,4 @@ -/* $NetBSD: nvme.c,v 1.64 2022/08/20 11:31:38 riastradh Exp $ */ +/* $NetBSD: nvme.c,v 1.65 2022/08/30 01:13:10 riastradh 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.64 2022/08/20 11:31:38 riastradh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: nvme.c,v 1.65 2022/08/30 01:13:10 riastradh Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -1867,7 +1867,7 @@ static struct nvme_ccb * nvme_ccb_get_bio(struct nvme_softc *sc, struct buf *bp, struct nvme_queue **selq) { - u_int cpuindex = cpu_index(bp->b_ci); + u_int cpuindex = cpu_index(bp->b_ci ? bp->b_ci : curcpu()); /* * Find a queue with available ccbs, preferring the originating |
