Module Name: src Committed By: mlelstv Date: Sat Mar 25 09:03:47 UTC 2023
Modified Files: src/sys/dev/pci: vioscsi.c Log Message: A single SCSI request may require multiple slots in the virtio queue but the queue isn't sized for the theoretical maximum. So just use XS_BUSY to pace the scsipi layer. To generate a diff of this commit: cvs rdiff -u -r1.34 -r1.35 src/sys/dev/pci/vioscsi.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/pci/vioscsi.c diff -u src/sys/dev/pci/vioscsi.c:1.34 src/sys/dev/pci/vioscsi.c:1.35 --- src/sys/dev/pci/vioscsi.c:1.34 Sat Mar 25 08:14:00 2023 +++ src/sys/dev/pci/vioscsi.c Sat Mar 25 09:03:47 2023 @@ -1,4 +1,4 @@ -/* $NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $ */ +/* $NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $ */ /* $OpenBSD: vioscsi.c,v 1.3 2015/03/14 03:38:49 jsg Exp $ */ /* @@ -18,7 +18,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.34 2023/03/25 08:14:00 mlelstv Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vioscsi.c,v 1.35 2023/03/25 09:03:47 mlelstv Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -300,7 +300,7 @@ vioscsi_scsipi_request(struct scsipi_cha */ vr = vioscsi_req_get(sc); if (vr == NULL) { - xs->error = XS_RESOURCE_SHORTAGE; + xs->error = XS_BUSY; scsipi_done(xs); return; } @@ -387,11 +387,9 @@ stuffup: error = virtio_enqueue_reserve(vsc, vq, slot, nsegs); if (error) { - aprint_error_dev(sc->sc_dev, "error reserving %d (nsegs %d)\n", - error, nsegs); bus_dmamap_unload(virtio_dmat(vsc), vr->vr_data); /* slot already freed by virtio_enqueue_reserve() */ - xs->error = XS_RESOURCE_SHORTAGE; + xs->error = XS_BUSY; scsipi_done(xs); return; }