NVMe: Using PRACT bit to generate and verify PI by controller
Subsystems (2)
PATCH v2 1/1 NVMe: Using PRACT bit to generate and verify PI by controller
This patch enables the PRCHK and reftag support when PRACT bit is set, and block layer integrity is disabled.
--- drivers/block/nvme-core.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-)
drivers/block/nvme-core.c +9 -6
@@ -815,11 +815,10 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod, cmnd->rw.slba =cpu_to_le64 (nvme_block_nr (ns,blk_rq_pos (req))); cmnd->rw.length =cpu_to_le16 ((blk_rq_bytes (req) >> ns->lba_shift) -1 ); -if (blk_integrity_rq (req)) { - cmnd->rw.metadata =cpu_to_le64 (sg_dma_address (iod->meta_sg)); +if (ns->ms) {switch (ns->pi_type) {case NVME_NS_DPS_PI_TYPE3 : - control |=NVME_RW_PRINFO_PRCHK_GUARD ; + control |=NVME_RW_PRINFO_PRCHK_GUARD ;break ;case NVME_NS_DPS_PI_TYPE1 :case NVME_NS_DPS_PI_TYPE2 :
@@ -829,8 +828,12 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod, nvme_block_nr(ns, blk_rq_pos(req)));break ; } - }else if (ns->ms) - control |=NVME_RW_PRINFO_PRACT ; +if (blk_integrity_rq (req)) + cmnd->rw.metadata = +cpu_to_le64 (sg_dma_address (iod->meta_sg)); +else + control |=NVME_RW_PRINFO_PRACT ; + } cmnd->rw.control =cpu_to_le16 (control); cmnd->rw.dsmgmt =cpu_to_le32 (dsmgmt);
@@ -1989,7 +1992,7 @@ static int nvme_revalidate_disk(struct gendisk *disk) !ns->ext)nvme_init_integrity (ns); -if (ns->ms && !blk_get_integrity (disk)) +if (ns->ms && !(ns->ms ==8 && ns->pi_type) && !blk_get_integrity (disk))set_capacity (disk,0 );else set_capacity (disk,le64_to_cpup (&id->nsze) << (ns->lba_shift -9 ));
Signature · 1 line
1.9.1
PATCH v2 1/1 NVMe: Using PRACT bit to generate and verify PI by controller
Quoted 2 lines · Alok Pandey
This patch enables the PRCHK and reftag support when PRACT bit is set, and block layer integrity is disabled.
Thanks!
Quoted 4 lines
Signed-off-by Alok Pandey <pandey.alok at samsung.com>---
drivers/block/nvme-core.c +0
-0@@ -815,11 +815,10 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod, cmnd->rw.slba =cpu_to_le64 (nvme_block_nr (ns,blk_rq_pos (req)));
drivers/block/nvme-core.c static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod, · line 822
Quoted 10 lines
drivers/block/nvme-core.c +2
-3cmnd->rw.length =cpu_to_le16 ((blk_rq_bytes (req) >> ns->lba_shift) -1 ); -if (blk_integrity_rq (req)) { - cmnd->rw.metadata =cpu_to_le64 (sg_dma_address (iod->meta_sg)); +if (ns->ms) {switch (ns->pi_type) {case NVME_NS_DPS_PI_TYPE3 : - control |=NVME_RW_PRINFO_PRCHK_GUARD ; + control |=NVME_RW_PRINFO_PRCHK_GUARD ;break ;
Though the tab change here must have been an accident.
PATCH v2 1/1 NVMe: Using PRACT bit to generate and verify PI by controller
Can it be picked up.
Thanks,
Alok
-----Original Message-----
From: Linux-nvme [mailto:[email protected]] On Behalf Of Keith Busch
Sent: Friday, July 31, 2015 1:30 AM
To: Alok Pandey
Cc: keith.busch at intel.com; linux-nvme at lists.infradead.org
Subject: Re: [PATCH V2] NVMe: Using PRACT bit to generate and verify PI by controller
Quoted 2 lines · Alok Pandey
This patch enables the PRCHK and reftag support when PRACT bit is set, and block layer integrity is disabled.
Thanks!
Review static int nvme_submit_iod(struct nvme_queue *nvmeq,
Quoted 3 lines
Signed-off-by Alok Pandey <pandey.alok at samsung.com>---
(quoted diff) +0
-0@@ -815,11 +815,10 @@ static int nvme_submit_iod(struct nvme_queue *nvmeq,
struct nvme_iod *iod,
Review static int nvme_submit_iod(struct nvme_queue *nvmeq, · line 821
Quoted 7 lines
(quoted diff) +0
-2cmnd->rw.slba = cpu_to_le64(nvme_block_nr(ns, blk_rq_pos(req))); cmnd->rw.length = cpu_to_le16((blk_rq_bytes(req) >> ns->lba_shift) - 1); - if (blk_integrity_rq(req)) { - cmnd->rw.metadata =
cpu_to_le64(sg_dma_address(iod->meta_sg));
drivers/block/nvme-core.c static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod, · line 822
Quoted 6 lines
drivers/block/nvme-core.c +2
-1+if (ns->ms) {switch (ns->pi_type) {case NVME_NS_DPS_PI_TYPE3 : - control |=NVME_RW_PRINFO_PRCHK_GUARD ; + control |=NVME_RW_PRINFO_PRCHK_GUARD ;break ;
Though the tab change here must have been an accident.
_______________________________________________
Linux-nvme mailing list
Linux-nvme at lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme
Jens Axboe
maintainerPATCH v2 1/1 NVMe: Using PRACT bit to generate and verify PI by controller
Quoted 1 line · Alok
Can it be picked up.
Applied for 4.3:
Please double check the patch, I had to hand apply it due to conflicts. In the future, base patches for revision x.y of the kernel against for-x.y/drivers. Thanks!
Signature · 1 line
Jens Axboe
Jens Axboe
maintainerPATCH v2 1/1 NVMe: Using PRACT bit to generate and verify PI by controller
Quoted 11 lines · Jens Axboe
Quoted 1 line · Alok
Can it be picked up.
Applied for 4.3:
Please double check the patch, I had to hand apply it due to conflicts. In the future, base patches for revision x.y of the kernel against for-x.y/drivers. Thanks!
Ooops, this is the right commit, of course:
Signature · 1 line
Jens Axboe