Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
[linux-2.6-microblaze.git] / drivers / scsi / lpfc / lpfc_nvme.c
index 918ae18..ba831de 100644 (file)
@@ -282,7 +282,7 @@ lpfc_nvme_delete_queue(struct nvme_fc_local_port *pnvme_lport,
        vport = lport->vport;
 
        lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME,
-                       "6001 ENTER.  lpfc_pnvme %p, qidx x%xi qhandle %p\n",
+                       "6001 ENTER.  lpfc_pnvme %p, qidx x%x qhandle %p\n",
                        lport, qidx, handle);
        kfree(handle);
 }
@@ -2235,13 +2235,11 @@ lpfc_new_nvme_buf(struct lpfc_vport *vport, int num_to_alloc)
        struct sli4_sge *sgl;
        dma_addr_t pdma_phys_sgl;
        uint16_t iotag, lxri = 0;
-       int bcnt, num_posted, sgl_size;
+       int bcnt, num_posted;
        LIST_HEAD(prep_nblist);
        LIST_HEAD(post_nblist);
        LIST_HEAD(nvme_nblist);
 
-       sgl_size = phba->cfg_sg_dma_buf_size;
-
        for (bcnt = 0; bcnt < num_to_alloc; bcnt++) {
                lpfc_ncmd = kzalloc(sizeof(struct lpfc_nvme_buf), GFP_KERNEL);
                if (!lpfc_ncmd)
@@ -2462,17 +2460,10 @@ lpfc_nvme_create_localport(struct lpfc_vport *vport)
        nfcp_info.node_name = wwn_to_u64(vport->fc_nodename.u.wwn);
        nfcp_info.port_name = wwn_to_u64(vport->fc_portname.u.wwn);
 
-       /* Limit to LPFC_MAX_NVME_SEG_CNT.
-        * For now need + 1 to get around NVME transport logic.
+       /* We need to tell the transport layer + 1 because it takes page
+        * alignment into account. When space for the SGL is allocated we
+        * allocate + 3, one for cmd, one for rsp and one for this alignment
         */
-       if (phba->cfg_sg_seg_cnt > LPFC_MAX_NVME_SEG_CNT) {
-               lpfc_printf_vlog(vport, KERN_INFO, LOG_NVME | LOG_INIT,
-                                "6300 Reducing sg segment cnt to %d\n",
-                                LPFC_MAX_NVME_SEG_CNT);
-               phba->cfg_nvme_seg_cnt = LPFC_MAX_NVME_SEG_CNT;
-       } else {
-               phba->cfg_nvme_seg_cnt = phba->cfg_sg_seg_cnt;
-       }
        lpfc_nvme_template.max_sgl_segments = phba->cfg_nvme_seg_cnt + 1;
        lpfc_nvme_template.max_hw_queues = phba->cfg_nvme_io_channel;