]> git.ipfire.org Git - people/arne_f/kernel.git/commitdiff
scsi: lpfc: Correct WQ creation for pagesize
authorJames Smart <jsmart2021@gmail.com>
Sun, 12 Feb 2017 21:52:25 +0000 (13:52 -0800)
committerJiri Slaby <jslaby@suse.cz>
Mon, 13 Mar 2017 20:40:41 +0000 (21:40 +0100)
commit 8ea73db486cda442f0671f4bc9c03a76be398a28 upstream.

Correct WQ creation for pagesize

The driver was calculating the adapter command pagesize indicator from
the system pagesize. However, the buffers the driver allocates are only
one size (SLI4_PAGE_SIZE), so no calculation was necessary.

Signed-off-by: Dick Kennedy <dick.kennedy@broadcom.com>
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Cc: Mauricio Faria de Oliveira <mauricfo@linux.vnet.ibm.com>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
drivers/scsi/lpfc/lpfc_hw4.h
drivers/scsi/lpfc/lpfc_sli.c

index 086c3f28caa68351017586d10953db49d5d640dc..55aa164fde781baec1bcffb8811ab2d81075b340 100644 (file)
@@ -1180,6 +1180,7 @@ struct lpfc_mbx_wq_create {
 #define lpfc_mbx_wq_create_page_size_SHIFT     0
 #define lpfc_mbx_wq_create_page_size_MASK      0x000000FF
 #define lpfc_mbx_wq_create_page_size_WORD      word1
+#define LPFC_WQ_PAGE_SIZE_4096 0x1
 #define lpfc_mbx_wq_create_wqe_size_SHIFT      8
 #define lpfc_mbx_wq_create_wqe_size_MASK       0x0000000F
 #define lpfc_mbx_wq_create_wqe_size_WORD       word1
@@ -1251,6 +1252,7 @@ struct rq_context {
 #define lpfc_rq_context_page_size_SHIFT        0               /* Version 1 Only */
 #define lpfc_rq_context_page_size_MASK 0x000000FF
 #define lpfc_rq_context_page_size_WORD word0
+#define        LPFC_RQ_PAGE_SIZE_4096  0x1
        uint32_t reserved1;
        uint32_t word2;
 #define lpfc_rq_context_cq_id_SHIFT    16
index 2d1ffd157c2812050b87a8614733c348dd9df0c0..b4e77d21a70183a09647c750c57cecde10d3f0ef 100644 (file)
@@ -12916,7 +12916,7 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
                               LPFC_WQ_WQE_SIZE_128);
                        bf_set(lpfc_mbx_wq_create_page_size,
                               &wq_create->u.request_1,
-                              (PAGE_SIZE/SLI4_PAGE_SIZE));
+                              LPFC_WQ_PAGE_SIZE_4096);
                        page = wq_create->u.request_1.page;
                        break;
                }
@@ -12942,8 +12942,9 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq,
                               LPFC_WQ_WQE_SIZE_128);
                        break;
                }
-               bf_set(lpfc_mbx_wq_create_page_size, &wq_create->u.request_1,
-                      (PAGE_SIZE/SLI4_PAGE_SIZE));
+               bf_set(lpfc_mbx_wq_create_page_size,
+                      &wq_create->u.request_1,
+                      LPFC_WQ_PAGE_SIZE_4096);
                page = wq_create->u.request_1.page;
                break;
        default:
@@ -13129,7 +13130,7 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq,
                       LPFC_RQE_SIZE_8);
                bf_set(lpfc_rq_context_page_size,
                       &rq_create->u.request.context,
-                      (PAGE_SIZE/SLI4_PAGE_SIZE));
+                      LPFC_RQ_PAGE_SIZE_4096);
        } else {
                switch (hrq->entry_count) {
                default: