nvmet: propagate npwg and awupf topology
Subsystems (2)
PATCH 1/1 nvmet: propagate npwg and awupf topology
Ensure we propagate npwg and awupf to the target as well instead of assuming its the same logical blocks per physical block.
This ensures devices with large IUs and large atomics get their information properly propagated on the target.
--- drivers/nvme/target/io-cmd-bdev.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/nvme/target/io-cmd-bdev.c +3 -2
@@ -26,7 +26,8 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)*/ id->nsfeat |=1 <<1 ; id->nawun = lpp0b; - id->nawupf = lpp0b; + id->nawupf =to0based (bdev_atomic_write_unit_max_bytes (bdev) / +bdev_logical_block_size (bdev)); id->nacwu = lpp0b;/*
@@ -36,7 +37,7 @@ void nvmet_bdev_set_limits(struct block_device *bdev, struct nvme_id_ns *id)*/ id->nsfeat |=1 <<4 ;/* NPWG = Namespace Preferred Write Granularity. 0's based */ - id->npwg = lpp0b; + id->npwg =to0based (bdev_io_min (bdev) /bdev_logical_block_size (bdev));/* NPWA = Namespace Preferred Write Alignment. 0's based */ id->npwa = id->npwg;/* NPDG = Namespace Preferred Deallocate Granularity. 0's based */
Signature · 1 line
2.45.2
Christoph Hellwig
maintainerQuoted 5 lines · Luis Chamberlain
Ensure we propagate npwg and awupf to the target as well instead of assuming its the same logical blocks per physical block.
This ensures devices with large IUs and large atomics get their information properly propagated on the target.
nvmet never sets REQ_ATOMIC and thus won't get atomic writes from say SCSI. So supporting atomic writes is a little more work than just propagating the values.
Quoted 11 lines · Christoph Hellwig
Quoted 5 lines · Luis Chamberlain
Ensure we propagate npwg and awupf to the target as well instead of assuming its the same logical blocks per physical block.
This ensures devices with large IUs and large atomics get their information properly propagated on the target.
nvmet never sets
REQ_ATOMICand thus won't get atomic writes from say SCSI. So supporting atomic writes is a little more work than just propagating the values.
In case missed, Mike had patches for SCSI target code:
https://lore.kernel.org/linux-scsi/[email protected]/
I still need to check them ...
Quoted 1 line · John Garry
I still need to check them ...
We can punt atomics later then.
Luis