diff options
author | James Smart <james.smart@emulex.com> | 2013-07-15 18:33:23 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2013-08-23 13:18:56 -0400 |
commit | 0c651878ba3018bb4bbfa2ccd0a876bebb618768 (patch) | |
tree | 26f9fa463388844b69ed0a856bb40f3ddba08205 /drivers/scsi/lpfc | |
parent | 1d1c296ffbef872f39b85314ca1f6b5eaae6b61d (diff) |
[SCSI] lpfc 8.3.41: Fixed support for 128 byte WQEs
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 13 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 1 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 48 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli4.h | 6 |
4 files changed, 65 insertions, 3 deletions
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index 4ec3d7c044c2..086c3f28caa6 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -234,6 +234,9 @@ struct ulp_bde64 { | |||
234 | uint32_t addrHigh; | 234 | uint32_t addrHigh; |
235 | }; | 235 | }; |
236 | 236 | ||
237 | /* Maximun size of immediate data that can fit into a 128 byte WQE */ | ||
238 | #define LPFC_MAX_BDE_IMM_SIZE 64 | ||
239 | |||
237 | struct lpfc_sli4_flags { | 240 | struct lpfc_sli4_flags { |
238 | uint32_t word0; | 241 | uint32_t word0; |
239 | #define lpfc_idx_rsrc_rdy_SHIFT 0 | 242 | #define lpfc_idx_rsrc_rdy_SHIFT 0 |
@@ -2585,6 +2588,9 @@ struct lpfc_sli4_parameters { | |||
2585 | #define cfg_mqv_WORD word6 | 2588 | #define cfg_mqv_WORD word6 |
2586 | uint32_t word7; | 2589 | uint32_t word7; |
2587 | uint32_t word8; | 2590 | uint32_t word8; |
2591 | #define cfg_wqsize_SHIFT 8 | ||
2592 | #define cfg_wqsize_MASK 0x0000000f | ||
2593 | #define cfg_wqsize_WORD word8 | ||
2588 | #define cfg_wqv_SHIFT 14 | 2594 | #define cfg_wqv_SHIFT 14 |
2589 | #define cfg_wqv_MASK 0x00000003 | 2595 | #define cfg_wqv_MASK 0x00000003 |
2590 | #define cfg_wqv_WORD word8 | 2596 | #define cfg_wqv_WORD word8 |
@@ -3622,6 +3628,13 @@ union lpfc_wqe { | |||
3622 | struct gen_req64_wqe gen_req; | 3628 | struct gen_req64_wqe gen_req; |
3623 | }; | 3629 | }; |
3624 | 3630 | ||
3631 | union lpfc_wqe128 { | ||
3632 | uint32_t words[32]; | ||
3633 | struct lpfc_wqe_generic generic; | ||
3634 | struct xmit_seq64_wqe xmit_sequence; | ||
3635 | struct gen_req64_wqe gen_req; | ||
3636 | }; | ||
3637 | |||
3625 | #define LPFC_GROUP_OJECT_MAGIC_NUM 0xfeaa0001 | 3638 | #define LPFC_GROUP_OJECT_MAGIC_NUM 0xfeaa0001 |
3626 | #define LPFC_FILE_TYPE_GROUP 0xf7 | 3639 | #define LPFC_FILE_TYPE_GROUP 0xf7 |
3627 | #define LPFC_FILE_ID_GROUP 0xa2 | 3640 | #define LPFC_FILE_ID_GROUP 0xa2 |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index a7f3328424f8..f7b9c126e157 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -9168,6 +9168,7 @@ lpfc_get_sli4_parameters(struct lpfc_hba *phba, LPFC_MBOXQ_t *mboxq) | |||
9168 | sli4_params->mqv = bf_get(cfg_mqv, mbx_sli4_parameters); | 9168 | sli4_params->mqv = bf_get(cfg_mqv, mbx_sli4_parameters); |
9169 | sli4_params->wqv = bf_get(cfg_wqv, mbx_sli4_parameters); | 9169 | sli4_params->wqv = bf_get(cfg_wqv, mbx_sli4_parameters); |
9170 | sli4_params->rqv = bf_get(cfg_rqv, mbx_sli4_parameters); | 9170 | sli4_params->rqv = bf_get(cfg_rqv, mbx_sli4_parameters); |
9171 | sli4_params->wqsize = bf_get(cfg_wqsize, mbx_sli4_parameters); | ||
9171 | sli4_params->sgl_pages_max = bf_get(cfg_sgl_page_cnt, | 9172 | sli4_params->sgl_pages_max = bf_get(cfg_sgl_page_cnt, |
9172 | mbx_sli4_parameters); | 9173 | mbx_sli4_parameters); |
9173 | sli4_params->sgl_pp_align = bf_get(cfg_sgl_pp_align, | 9174 | sli4_params->sgl_pp_align = bf_get(cfg_sgl_pp_align, |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index a4e3f4757405..0392e114531c 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -12869,10 +12869,44 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, | |||
12869 | wq->page_count); | 12869 | wq->page_count); |
12870 | bf_set(lpfc_mbx_wq_create_cq_id, &wq_create->u.request, | 12870 | bf_set(lpfc_mbx_wq_create_cq_id, &wq_create->u.request, |
12871 | cq->queue_id); | 12871 | cq->queue_id); |
12872 | |||
12873 | /* wqv is the earliest version supported, NOT the latest */ | ||
12872 | bf_set(lpfc_mbox_hdr_version, &shdr->request, | 12874 | bf_set(lpfc_mbox_hdr_version, &shdr->request, |
12873 | phba->sli4_hba.pc_sli4_params.wqv); | 12875 | phba->sli4_hba.pc_sli4_params.wqv); |
12874 | 12876 | ||
12875 | if (phba->sli4_hba.pc_sli4_params.wqv == LPFC_Q_CREATE_VERSION_1) { | 12877 | switch (phba->sli4_hba.pc_sli4_params.wqv) { |
12878 | case LPFC_Q_CREATE_VERSION_0: | ||
12879 | switch (wq->entry_size) { | ||
12880 | default: | ||
12881 | case 64: | ||
12882 | /* Nothing to do, version 0 ONLY supports 64 byte */ | ||
12883 | page = wq_create->u.request.page; | ||
12884 | break; | ||
12885 | case 128: | ||
12886 | if (!(phba->sli4_hba.pc_sli4_params.wqsize & | ||
12887 | LPFC_WQ_SZ128_SUPPORT)) { | ||
12888 | status = -ERANGE; | ||
12889 | goto out; | ||
12890 | } | ||
12891 | /* If we get here the HBA MUST also support V1 and | ||
12892 | * we MUST use it | ||
12893 | */ | ||
12894 | bf_set(lpfc_mbox_hdr_version, &shdr->request, | ||
12895 | LPFC_Q_CREATE_VERSION_1); | ||
12896 | |||
12897 | bf_set(lpfc_mbx_wq_create_wqe_count, | ||
12898 | &wq_create->u.request_1, wq->entry_count); | ||
12899 | bf_set(lpfc_mbx_wq_create_wqe_size, | ||
12900 | &wq_create->u.request_1, | ||
12901 | LPFC_WQ_WQE_SIZE_128); | ||
12902 | bf_set(lpfc_mbx_wq_create_page_size, | ||
12903 | &wq_create->u.request_1, | ||
12904 | (PAGE_SIZE/SLI4_PAGE_SIZE)); | ||
12905 | page = wq_create->u.request_1.page; | ||
12906 | break; | ||
12907 | } | ||
12908 | break; | ||
12909 | case LPFC_Q_CREATE_VERSION_1: | ||
12876 | bf_set(lpfc_mbx_wq_create_wqe_count, &wq_create->u.request_1, | 12910 | bf_set(lpfc_mbx_wq_create_wqe_count, &wq_create->u.request_1, |
12877 | wq->entry_count); | 12911 | wq->entry_count); |
12878 | switch (wq->entry_size) { | 12912 | switch (wq->entry_size) { |
@@ -12883,6 +12917,11 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, | |||
12883 | LPFC_WQ_WQE_SIZE_64); | 12917 | LPFC_WQ_WQE_SIZE_64); |
12884 | break; | 12918 | break; |
12885 | case 128: | 12919 | case 128: |
12920 | if (!(phba->sli4_hba.pc_sli4_params.wqsize & | ||
12921 | LPFC_WQ_SZ128_SUPPORT)) { | ||
12922 | status = -ERANGE; | ||
12923 | goto out; | ||
12924 | } | ||
12886 | bf_set(lpfc_mbx_wq_create_wqe_size, | 12925 | bf_set(lpfc_mbx_wq_create_wqe_size, |
12887 | &wq_create->u.request_1, | 12926 | &wq_create->u.request_1, |
12888 | LPFC_WQ_WQE_SIZE_128); | 12927 | LPFC_WQ_WQE_SIZE_128); |
@@ -12891,9 +12930,12 @@ lpfc_wq_create(struct lpfc_hba *phba, struct lpfc_queue *wq, | |||
12891 | bf_set(lpfc_mbx_wq_create_page_size, &wq_create->u.request_1, | 12930 | bf_set(lpfc_mbx_wq_create_page_size, &wq_create->u.request_1, |
12892 | (PAGE_SIZE/SLI4_PAGE_SIZE)); | 12931 | (PAGE_SIZE/SLI4_PAGE_SIZE)); |
12893 | page = wq_create->u.request_1.page; | 12932 | page = wq_create->u.request_1.page; |
12894 | } else { | 12933 | break; |
12895 | page = wq_create->u.request.page; | 12934 | default: |
12935 | status = -ERANGE; | ||
12936 | goto out; | ||
12896 | } | 12937 | } |
12938 | |||
12897 | list_for_each_entry(dmabuf, &wq->page_list, list) { | 12939 | list_for_each_entry(dmabuf, &wq->page_list, list) { |
12898 | memset(dmabuf->virt, 0, hw_page_size); | 12940 | memset(dmabuf->virt, 0, hw_page_size); |
12899 | page[dmabuf->buffer_tag].addr_lo = putPaddrLow(dmabuf->phys); | 12941 | page[dmabuf->buffer_tag].addr_lo = putPaddrLow(dmabuf->phys); |
diff --git a/drivers/scsi/lpfc/lpfc_sli4.h b/drivers/scsi/lpfc/lpfc_sli4.h index d710b87a4417..5bcc38223ac9 100644 --- a/drivers/scsi/lpfc/lpfc_sli4.h +++ b/drivers/scsi/lpfc/lpfc_sli4.h | |||
@@ -117,6 +117,7 @@ union sli4_qe { | |||
117 | struct lpfc_rcqe_complete *rcqe_complete; | 117 | struct lpfc_rcqe_complete *rcqe_complete; |
118 | struct lpfc_mqe *mqe; | 118 | struct lpfc_mqe *mqe; |
119 | union lpfc_wqe *wqe; | 119 | union lpfc_wqe *wqe; |
120 | union lpfc_wqe128 *wqe128; | ||
120 | struct lpfc_rqe *rqe; | 121 | struct lpfc_rqe *rqe; |
121 | }; | 122 | }; |
122 | 123 | ||
@@ -325,12 +326,14 @@ struct lpfc_bmbx { | |||
325 | #define LPFC_EQE_SIZE_16B 16 | 326 | #define LPFC_EQE_SIZE_16B 16 |
326 | #define LPFC_CQE_SIZE 16 | 327 | #define LPFC_CQE_SIZE 16 |
327 | #define LPFC_WQE_SIZE 64 | 328 | #define LPFC_WQE_SIZE 64 |
329 | #define LPFC_WQE128_SIZE 128 | ||
328 | #define LPFC_MQE_SIZE 256 | 330 | #define LPFC_MQE_SIZE 256 |
329 | #define LPFC_RQE_SIZE 8 | 331 | #define LPFC_RQE_SIZE 8 |
330 | 332 | ||
331 | #define LPFC_EQE_DEF_COUNT 1024 | 333 | #define LPFC_EQE_DEF_COUNT 1024 |
332 | #define LPFC_CQE_DEF_COUNT 1024 | 334 | #define LPFC_CQE_DEF_COUNT 1024 |
333 | #define LPFC_WQE_DEF_COUNT 256 | 335 | #define LPFC_WQE_DEF_COUNT 256 |
336 | #define LPFC_WQE128_DEF_COUNT 128 | ||
334 | #define LPFC_MQE_DEF_COUNT 16 | 337 | #define LPFC_MQE_DEF_COUNT 16 |
335 | #define LPFC_RQE_DEF_COUNT 512 | 338 | #define LPFC_RQE_DEF_COUNT 512 |
336 | 339 | ||
@@ -416,6 +419,9 @@ struct lpfc_pc_sli4_params { | |||
416 | uint8_t mqv; | 419 | uint8_t mqv; |
417 | uint8_t wqv; | 420 | uint8_t wqv; |
418 | uint8_t rqv; | 421 | uint8_t rqv; |
422 | uint8_t wqsize; | ||
423 | #define LPFC_WQ_SZ64_SUPPORT 1 | ||
424 | #define LPFC_WQ_SZ128_SUPPORT 2 | ||
419 | }; | 425 | }; |
420 | 426 | ||
421 | struct lpfc_iov { | 427 | struct lpfc_iov { |