scsi: mpi3mr: NVMe command size greater than 8K fails
authorRanjan Kumar <ranjan.kumar@broadcom.com>
Tue, 28 Feb 2023 14:08:34 +0000 (06:08 -0800)
committerMartin K. Petersen <martin.petersen@oracle.com>
Mon, 6 Mar 2023 23:33:13 +0000 (18:33 -0500)
A wrong variable is checked while populating PRP entries in the PRP page
and this results in failure. No PRP entries in the PRP page were
successfully created and any NVMe Encapsulated commands with PRP of size
greater than 8K failed.

Signed-off-by: Ranjan Kumar <ranjan.kumar@broadcom.com>
Signed-off-by: Sreekanth Reddy <sreekanth.reddy@broadcom.com>
Link: https://lore.kernel.org/r/20230228140835.4075-6-ranjan.kumar@broadcom.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/scsi/mpi3mr/mpi3mr_app.c

index bff63770239797ce2e9a5e6be4c3d82281d42c14..d10c6afb7f9cdafdd7f2120f552597b88161014f 100644 (file)
@@ -886,7 +886,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
                         * each time through the loop.
                         */
                        *prp_entry = cpu_to_le64(dma_addr);
-                       if (*prp1_entry & sgemod_mask) {
+                       if (*prp_entry & sgemod_mask) {
                                dprint_bsg_err(mrioc,
                                    "%s: PRP address collides with SGE modifier\n",
                                    __func__);
@@ -895,7 +895,7 @@ static int mpi3mr_build_nvme_prp(struct mpi3mr_ioc *mrioc,
                        *prp_entry &= ~sgemod_mask;
                        *prp_entry |= sgemod_val;
                        prp_entry++;
-                       prp_entry_dma++;
+                       prp_entry_dma += prp_size;
                }
 
                /*