Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

nvme: add support for passing on the application tag

With user integrity buffer, there is a way to specify the app_tag.
Set the corresponding protocol specific flags and send the app_tag down.

Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Anuj Gupta <anuj20.g@samsung.com>
Signed-off-by: Kanchan Joshi <joshi.k@samsung.com>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Link: https://lore.kernel.org/r/20241128112240.8867-9-anuj20.g@samsung.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>

authored by

Kanchan Joshi and committed by
Jens Axboe
472292cd 2c0487d8

+10
+10
drivers/nvme/host/core.c
··· 885 885 return BLK_STS_OK; 886 886 } 887 887 888 + static void nvme_set_app_tag(struct request *req, struct nvme_command *cmnd) 889 + { 890 + cmnd->rw.lbat = cpu_to_le16(bio_integrity(req->bio)->app_tag); 891 + cmnd->rw.lbatm = cpu_to_le16(0xffff); 892 + } 893 + 888 894 static void nvme_set_ref_tag(struct nvme_ns *ns, struct nvme_command *cmnd, 889 895 struct request *req) 890 896 { ··· 1030 1024 if (op == nvme_cmd_zone_append) 1031 1025 control |= NVME_RW_APPEND_PIREMAP; 1032 1026 nvme_set_ref_tag(ns, cmnd, req); 1027 + } 1028 + if (bio_integrity_flagged(req->bio, BIP_CHECK_APPTAG)) { 1029 + control |= NVME_RW_PRINFO_PRCHK_APP; 1030 + nvme_set_app_tag(req, cmnd); 1033 1031 } 1034 1032 } 1035 1033