Thread (25 messages) 25 messages, 3 authors, 2024-08-29

Re: [PATCH v3 09/10] nvme: add handling for app_tag

From: Christoph Hellwig <hch@lst.de>
Date: 2024-08-24 08:49:37
Also in: io-uring, linux-nvme, linux-scsi

Possibly related (same subject, not in this thread)

Maybe name this "add support for passin on the application tag" ?
+static void nvme_set_app_tag(struct nvme_command *cmnd, u16 apptag)
+{
+	cmnd->rw.apptag = cpu_to_le16(apptag);
+	/* use 0xfff as mask so that apptag is used in entirety */
+	cmnd->rw.appmask = cpu_to_le16(0xffff);
Can you throw in a patch to rename these field to match the field names
used in the specification?  I also don't think the comment is all that
useful.
quoted hunk ↗ jump to hunk
+}
+
 static void nvme_set_ref_tag(struct nvme_ns *ns, struct nvme_command *cmnd,
 			      struct request *req)
 {
@@ -1010,6 +1017,11 @@ static inline blk_status_t nvme_setup_rw(struct nvme_ns *ns,
 				control |= NVME_RW_APPEND_PIREMAP;
 			nvme_set_ref_tag(ns, cmnd, req);
 		}
+		if (bio_integrity_flagged(req->bio, BIP_CHECK_APPTAG)) {
+			control |= NVME_RW_PRINFO_PRCHK_APP;
+			nvme_set_app_tag(cmnd,
+					 bio_integrity(req->bio)->app_tag);
Passing the request to nvme_set_app_tag would probably be a bit cleaner.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help