Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/pci A single SCSI request may require multiple slots...



details:   https://anonhg.NetBSD.org/src/rev/9f978425621a
branches:  trunk
changeset: 374021:9f978425621a
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Sat Mar 25 09:03:47 2023 +0000

description:
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.

diffstat:

 sys/dev/pci/vioscsi.c |  10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)

diffs (40 lines):

diff -r dd246293ba67 -r 9f978425621a sys/dev/pci/vioscsi.c
--- a/sys/dev/pci/vioscsi.c     Sat Mar 25 08:14:00 2023 +0000
+++ b/sys/dev/pci/vioscsi.c     Sat Mar 25 09:03:47 2023 +0000
@@ -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;
        }



Home | Main Index | Thread Index | Old Index