Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Jun 2025 15:53:12 GMT
From:      Warner Losh <imp@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 77613ed4e3d6 - main - pass: Update comments about scsi and devstat
Message-ID:  <202506191553.55JFrCiN071070@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=77613ed4e3d635198014fd5b4723fb8eaa35d53e

commit 77613ed4e3d635198014fd5b4723fb8eaa35d53e
Author:     Warner Losh <imp@FreeBSD.org>
AuthorDate: 2025-06-19 14:24:25 +0000
Commit:     Warner Losh <imp@FreeBSD.org>
CommitDate: 2025-06-19 15:52:25 +0000

    pass: Update comments about scsi and devstat
    
    scsi is the only transport to do tag_action, so is the only one that
    needs that support in devstat. Make a note of that. nvme and ata do
    support some ordering, but that's done in the [an]da driver for each of
    these devices and not for passthru commands and not via these tags.
    
    Sponsored by:           Netflix
---
 sys/cam/scsi/scsi_pass.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/sys/cam/scsi/scsi_pass.c b/sys/cam/scsi/scsi_pass.c
index 7bf9fa72b245..c3587421c176 100644
--- a/sys/cam/scsi/scsi_pass.c
+++ b/sys/cam/scsi/scsi_pass.c
@@ -611,9 +611,13 @@ passregister(struct cam_periph *periph, void *arg)
 		softc->flags |= PASS_FLAG_UNMAPPED_CAPABLE;
 
 	/*
-	 * We pass in 0 for a blocksize, since we don't 
-	 * know what the blocksize of this device is, if 
-	 * it even has a blocksize.
+	 * We pass in 0 for a blocksize, since we don't know what the blocksize
+	 * of this device is, if it even has a blocksize.
+	 *
+	 * Note: no_tags is valid only for SCSI peripherals, but we don't do any
+	 * devstat accounting for tags on any other transport. SCSI is the only
+	 * transport that uses the tag_action (ata has only vestigial references
+	 * to it, others ignore it entirely).
 	 */
 	cam_periph_unlock(periph);
 	no_tags = (cgd->inq_data.flags & SID_CmdQue) == 0;
@@ -974,6 +978,7 @@ passdone(struct cam_periph *periph, union ccb *done_ccb)
 			    DEVSTAT_TAG_SIMPLE, DEVSTAT_READ, NULL,
 			    &io_req->start_time);
 			break;
+		/* XXX XPT_NVME_IO and XPT_NVME_ADMIN need cases here for resid */
 		default:
 			devstat_end_transaction(softc->device_stats, 0,
 			    DEVSTAT_TAG_NONE, DEVSTAT_NO_DATA, NULL,



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202506191553.55JFrCiN071070>