diff options
author | James Smart <james.smart@emulex.com> | 2011-04-16 11:03:33 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2011-05-01 12:07:33 -0400 |
commit | c31098cef5e091e22a02ff255f911e0ad71cc393 (patch) | |
tree | 426fa3ea6b39ee703a999db55e5d8283c1920603 /drivers/scsi/lpfc | |
parent | 9589b062f53e314ea3abfaca8de7a260b4ef69c2 (diff) |
[SCSI] lpfc 8.3.23: Fixes related to new hardware
Fixes related to new hardware
- Restrict driver to look at BAR2 or BAR4 only for if_type 0.
- Allow SLI4 with FCOE_MODE not set for new SLI4 FC adapters.
- Add Temporary RPI field to the ELS request WQE.
- Do not override CT field in issue_els_flogi for SLI4 IF type 2
- For RQ_CREATE_V2 mbx cmd: fill in the rqe_size and page_size for RQ_CREATE.
Signed-off-by: Alex Iannicelli <alex.iannicelli@emulex.com>
Signed-off-by: James Smart <james.smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers/scsi/lpfc')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_els.c | 17 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_hw4.h | 14 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_init.c | 12 | ||||
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 25 |
4 files changed, 48 insertions, 20 deletions
diff --git a/drivers/scsi/lpfc/lpfc_els.c b/drivers/scsi/lpfc/lpfc_els.c index 04a5aeb41470..e2c452467c8b 100644 --- a/drivers/scsi/lpfc/lpfc_els.c +++ b/drivers/scsi/lpfc/lpfc_els.c | |||
@@ -1086,14 +1086,15 @@ lpfc_issue_els_flogi(struct lpfc_vport *vport, struct lpfc_nodelist *ndlp, | |||
1086 | if (sp->cmn.fcphHigh < FC_PH3) | 1086 | if (sp->cmn.fcphHigh < FC_PH3) |
1087 | sp->cmn.fcphHigh = FC_PH3; | 1087 | sp->cmn.fcphHigh = FC_PH3; |
1088 | 1088 | ||
1089 | if ((phba->sli_rev == LPFC_SLI_REV4) && | 1089 | if (phba->sli_rev == LPFC_SLI_REV4) { |
1090 | (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) == | 1090 | if (bf_get(lpfc_sli_intf_if_type, &phba->sli4_hba.sli_intf) == |
1091 | LPFC_SLI_INTF_IF_TYPE_0)) { | 1091 | LPFC_SLI_INTF_IF_TYPE_0) { |
1092 | elsiocb->iocb.ulpCt_h = ((SLI4_CT_FCFI >> 1) & 1); | 1092 | elsiocb->iocb.ulpCt_h = ((SLI4_CT_FCFI >> 1) & 1); |
1093 | elsiocb->iocb.ulpCt_l = (SLI4_CT_FCFI & 1); | 1093 | elsiocb->iocb.ulpCt_l = (SLI4_CT_FCFI & 1); |
1094 | /* FLOGI needs to be 3 for WQE FCFI */ | 1094 | /* FLOGI needs to be 3 for WQE FCFI */ |
1095 | /* Set the fcfi to the fcfi we registered with */ | 1095 | /* Set the fcfi to the fcfi we registered with */ |
1096 | elsiocb->iocb.ulpContext = phba->fcf.fcfi; | 1096 | elsiocb->iocb.ulpContext = phba->fcf.fcfi; |
1097 | } | ||
1097 | } else if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { | 1098 | } else if (phba->sli3_options & LPFC_SLI3_NPIV_ENABLED) { |
1098 | sp->cmn.request_multiple_Nport = 1; | 1099 | sp->cmn.request_multiple_Nport = 1; |
1099 | /* For FLOGI, Let FLOGI rsp set the NPortID for VPI 0 */ | 1100 | /* For FLOGI, Let FLOGI rsp set the NPortID for VPI 0 */ |
diff --git a/drivers/scsi/lpfc/lpfc_hw4.h b/drivers/scsi/lpfc/lpfc_hw4.h index a8e2c6993d41..4dff668ebdad 100644 --- a/drivers/scsi/lpfc/lpfc_hw4.h +++ b/drivers/scsi/lpfc/lpfc_hw4.h | |||
@@ -1059,6 +1059,11 @@ struct rq_context { | |||
1059 | #define lpfc_rq_context_rqe_size_SHIFT 8 /* Version 1 Only */ | 1059 | #define lpfc_rq_context_rqe_size_SHIFT 8 /* Version 1 Only */ |
1060 | #define lpfc_rq_context_rqe_size_MASK 0x0000000F | 1060 | #define lpfc_rq_context_rqe_size_MASK 0x0000000F |
1061 | #define lpfc_rq_context_rqe_size_WORD word0 | 1061 | #define lpfc_rq_context_rqe_size_WORD word0 |
1062 | #define LPFC_RQE_SIZE_8 2 | ||
1063 | #define LPFC_RQE_SIZE_16 3 | ||
1064 | #define LPFC_RQE_SIZE_32 4 | ||
1065 | #define LPFC_RQE_SIZE_64 5 | ||
1066 | #define LPFC_RQE_SIZE_128 6 | ||
1062 | #define lpfc_rq_context_page_size_SHIFT 0 /* Version 1 Only */ | 1067 | #define lpfc_rq_context_page_size_SHIFT 0 /* Version 1 Only */ |
1063 | #define lpfc_rq_context_page_size_MASK 0x000000FF | 1068 | #define lpfc_rq_context_page_size_MASK 0x000000FF |
1064 | #define lpfc_rq_context_page_size_WORD word0 | 1069 | #define lpfc_rq_context_page_size_WORD word0 |
@@ -2493,6 +2498,9 @@ struct wqe_common { | |||
2493 | #define wqe_reqtag_SHIFT 0 | 2498 | #define wqe_reqtag_SHIFT 0 |
2494 | #define wqe_reqtag_MASK 0x0000FFFF | 2499 | #define wqe_reqtag_MASK 0x0000FFFF |
2495 | #define wqe_reqtag_WORD word9 | 2500 | #define wqe_reqtag_WORD word9 |
2501 | #define wqe_temp_rpi_SHIFT 16 | ||
2502 | #define wqe_temp_rpi_MASK 0x0000FFFF | ||
2503 | #define wqe_temp_rpi_WORD word9 | ||
2496 | #define wqe_rcvoxid_SHIFT 16 | 2504 | #define wqe_rcvoxid_SHIFT 16 |
2497 | #define wqe_rcvoxid_MASK 0x0000FFFF | 2505 | #define wqe_rcvoxid_MASK 0x0000FFFF |
2498 | #define wqe_rcvoxid_WORD word9 | 2506 | #define wqe_rcvoxid_WORD word9 |
@@ -2623,7 +2631,11 @@ struct xmit_els_rsp64_wqe { | |||
2623 | uint32_t rsvd4; | 2631 | uint32_t rsvd4; |
2624 | struct wqe_did wqe_dest; | 2632 | struct wqe_did wqe_dest; |
2625 | struct wqe_common wqe_com; /* words 6-11 */ | 2633 | struct wqe_common wqe_com; /* words 6-11 */ |
2626 | uint32_t rsvd_12_15[4]; | 2634 | uint32_t word12; |
2635 | #define wqe_rsp_temp_rpi_SHIFT 0 | ||
2636 | #define wqe_rsp_temp_rpi_MASK 0x0000FFFF | ||
2637 | #define wqe_rsp_temp_rpi_WORD word12 | ||
2638 | uint32_t rsvd_13_15[3]; | ||
2627 | }; | 2639 | }; |
2628 | 2640 | ||
2629 | struct xmit_bls_rsp64_wqe { | 2641 | struct xmit_bls_rsp64_wqe { |
diff --git a/drivers/scsi/lpfc/lpfc_init.c b/drivers/scsi/lpfc/lpfc_init.c index 7b6a089796d7..7dda036a1af3 100644 --- a/drivers/scsi/lpfc/lpfc_init.c +++ b/drivers/scsi/lpfc/lpfc_init.c | |||
@@ -3209,9 +3209,9 @@ lpfc_sli4_async_link_evt(struct lpfc_hba *phba, | |||
3209 | phba->sli4_hba.link_state.logical_speed = | 3209 | phba->sli4_hba.link_state.logical_speed = |
3210 | bf_get(lpfc_acqe_logical_link_speed, acqe_link); | 3210 | bf_get(lpfc_acqe_logical_link_speed, acqe_link); |
3211 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, | 3211 | lpfc_printf_log(phba, KERN_INFO, LOG_SLI, |
3212 | "2900 Async FCoE Link event - Speed:%dGBit duplex:x%x " | 3212 | "2900 Async FC/FCoE Link event - Speed:%dGBit " |
3213 | "LA Type:x%x Port Type:%d Port Number:%d Logical " | 3213 | "duplex:x%x LA Type:x%x Port Type:%d Port Number:%d " |
3214 | "speed:%dMbps Fault:%d\n", | 3214 | "Logical speed:%dMbps Fault:%d\n", |
3215 | phba->sli4_hba.link_state.speed, | 3215 | phba->sli4_hba.link_state.speed, |
3216 | phba->sli4_hba.link_state.topology, | 3216 | phba->sli4_hba.link_state.topology, |
3217 | phba->sli4_hba.link_state.status, | 3217 | phba->sli4_hba.link_state.status, |
@@ -7007,7 +7007,8 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba) | |||
7007 | lpfc_sli4_bar0_register_memmap(phba, if_type); | 7007 | lpfc_sli4_bar0_register_memmap(phba, if_type); |
7008 | } | 7008 | } |
7009 | 7009 | ||
7010 | if (pci_resource_start(pdev, 2)) { | 7010 | if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && |
7011 | (pci_resource_start(pdev, 2))) { | ||
7011 | /* | 7012 | /* |
7012 | * Map SLI4 if type 0 HBA Control Register base to a kernel | 7013 | * Map SLI4 if type 0 HBA Control Register base to a kernel |
7013 | * virtual address and setup the registers. | 7014 | * virtual address and setup the registers. |
@@ -7024,7 +7025,8 @@ lpfc_sli4_pci_mem_setup(struct lpfc_hba *phba) | |||
7024 | lpfc_sli4_bar1_register_memmap(phba); | 7025 | lpfc_sli4_bar1_register_memmap(phba); |
7025 | } | 7026 | } |
7026 | 7027 | ||
7027 | if (pci_resource_start(pdev, 4)) { | 7028 | if ((if_type == LPFC_SLI_INTF_IF_TYPE_0) && |
7029 | (pci_resource_start(pdev, 4))) { | ||
7028 | /* | 7030 | /* |
7029 | * Map SLI4 if type 0 HBA Doorbell Register base to a kernel | 7031 | * Map SLI4 if type 0 HBA Doorbell Register base to a kernel |
7030 | * virtual address and setup the registers. | 7032 | * virtual address and setup the registers. |
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 580b00bc35ce..837d272cb2d6 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -4769,8 +4769,7 @@ lpfc_sli4_hba_setup(struct lpfc_hba *phba) | |||
4769 | else | 4769 | else |
4770 | phba->hba_flag &= ~HBA_FIP_SUPPORT; | 4770 | phba->hba_flag &= ~HBA_FIP_SUPPORT; |
4771 | 4771 | ||
4772 | if (phba->sli_rev != LPFC_SLI_REV4 || | 4772 | if (phba->sli_rev != LPFC_SLI_REV4) { |
4773 | !(phba->hba_flag & HBA_FCOE_MODE)) { | ||
4774 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, | 4773 | lpfc_printf_log(phba, KERN_ERR, LOG_MBOX | LOG_SLI, |
4775 | "0376 READ_REV Error. SLI Level %d " | 4774 | "0376 READ_REV Error. SLI Level %d " |
4776 | "FCoE enabled %d\n", | 4775 | "FCoE enabled %d\n", |
@@ -6403,6 +6402,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
6403 | uint32_t els_id = LPFC_ELS_ID_DEFAULT; | 6402 | uint32_t els_id = LPFC_ELS_ID_DEFAULT; |
6404 | int numBdes, i; | 6403 | int numBdes, i; |
6405 | struct ulp_bde64 bde; | 6404 | struct ulp_bde64 bde; |
6405 | struct lpfc_nodelist *ndlp; | ||
6406 | 6406 | ||
6407 | fip = phba->hba_flag & HBA_FIP_SUPPORT; | 6407 | fip = phba->hba_flag & HBA_FIP_SUPPORT; |
6408 | /* The fcp commands will set command type */ | 6408 | /* The fcp commands will set command type */ |
@@ -6448,6 +6448,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
6448 | 6448 | ||
6449 | switch (iocbq->iocb.ulpCommand) { | 6449 | switch (iocbq->iocb.ulpCommand) { |
6450 | case CMD_ELS_REQUEST64_CR: | 6450 | case CMD_ELS_REQUEST64_CR: |
6451 | ndlp = (struct lpfc_nodelist *)iocbq->context1; | ||
6451 | if (!iocbq->iocb.ulpLe) { | 6452 | if (!iocbq->iocb.ulpLe) { |
6452 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, | 6453 | lpfc_printf_log(phba, KERN_ERR, LOG_SLI, |
6453 | "2007 Only Limited Edition cmd Format" | 6454 | "2007 Only Limited Edition cmd Format" |
@@ -6473,6 +6474,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
6473 | els_id = ((iocbq->iocb_flag & LPFC_FIP_ELS_ID_MASK) | 6474 | els_id = ((iocbq->iocb_flag & LPFC_FIP_ELS_ID_MASK) |
6474 | >> LPFC_FIP_ELS_ID_SHIFT); | 6475 | >> LPFC_FIP_ELS_ID_SHIFT); |
6475 | } | 6476 | } |
6477 | bf_set(wqe_temp_rpi, &wqe->els_req.wqe_com, ndlp->nlp_rpi); | ||
6476 | bf_set(wqe_els_id, &wqe->els_req.wqe_com, els_id); | 6478 | bf_set(wqe_els_id, &wqe->els_req.wqe_com, els_id); |
6477 | bf_set(wqe_dbde, &wqe->els_req.wqe_com, 1); | 6479 | bf_set(wqe_dbde, &wqe->els_req.wqe_com, 1); |
6478 | bf_set(wqe_iod, &wqe->els_req.wqe_com, LPFC_WQE_IOD_READ); | 6480 | bf_set(wqe_iod, &wqe->els_req.wqe_com, LPFC_WQE_IOD_READ); |
@@ -6605,6 +6607,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
6605 | command_type = OTHER_COMMAND; | 6607 | command_type = OTHER_COMMAND; |
6606 | break; | 6608 | break; |
6607 | case CMD_XMIT_ELS_RSP64_CX: | 6609 | case CMD_XMIT_ELS_RSP64_CX: |
6610 | ndlp = (struct lpfc_nodelist *)iocbq->context1; | ||
6608 | /* words0-2 BDE memcpy */ | 6611 | /* words0-2 BDE memcpy */ |
6609 | /* word3 iocb=iotag32 wqe=response_payload_len */ | 6612 | /* word3 iocb=iotag32 wqe=response_payload_len */ |
6610 | wqe->xmit_els_rsp.response_payload_len = xmit_len; | 6613 | wqe->xmit_els_rsp.response_payload_len = xmit_len; |
@@ -6627,6 +6630,7 @@ lpfc_sli4_iocb2wqe(struct lpfc_hba *phba, struct lpfc_iocbq *iocbq, | |||
6627 | bf_set(wqe_lenloc, &wqe->xmit_els_rsp.wqe_com, | 6630 | bf_set(wqe_lenloc, &wqe->xmit_els_rsp.wqe_com, |
6628 | LPFC_WQE_LENLOC_WORD3); | 6631 | LPFC_WQE_LENLOC_WORD3); |
6629 | bf_set(wqe_ebde_cnt, &wqe->xmit_els_rsp.wqe_com, 0); | 6632 | bf_set(wqe_ebde_cnt, &wqe->xmit_els_rsp.wqe_com, 0); |
6633 | bf_set(wqe_rsp_temp_rpi, &wqe->xmit_els_rsp, ndlp->nlp_rpi); | ||
6630 | command_type = OTHER_COMMAND; | 6634 | command_type = OTHER_COMMAND; |
6631 | break; | 6635 | break; |
6632 | case CMD_CLOSE_XRI_CN: | 6636 | case CMD_CLOSE_XRI_CN: |
@@ -10523,8 +10527,8 @@ lpfc_cq_create(struct lpfc_hba *phba, struct lpfc_queue *cq, | |||
10523 | bf_set(lpfc_mbox_hdr_version, &shdr->request, | 10527 | bf_set(lpfc_mbox_hdr_version, &shdr->request, |
10524 | phba->sli4_hba.pc_sli4_params.cqv); | 10528 | phba->sli4_hba.pc_sli4_params.cqv); |
10525 | if (phba->sli4_hba.pc_sli4_params.cqv == LPFC_Q_CREATE_VERSION_2) { | 10529 | if (phba->sli4_hba.pc_sli4_params.cqv == LPFC_Q_CREATE_VERSION_2) { |
10526 | bf_set(lpfc_mbx_cq_create_page_size, &cq_create->u.request, | 10530 | /* FW only supports 1. Should be PAGE_SIZE/SLI4_PAGE_SIZE */ |
10527 | (PAGE_SIZE/SLI4_PAGE_SIZE)); | 10531 | bf_set(lpfc_mbx_cq_create_page_size, &cq_create->u.request, 1); |
10528 | bf_set(lpfc_cq_eq_id_2, &cq_create->u.request.context, | 10532 | bf_set(lpfc_cq_eq_id_2, &cq_create->u.request.context, |
10529 | eq->queue_id); | 10533 | eq->queue_id); |
10530 | } else { | 10534 | } else { |
@@ -10968,6 +10972,12 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, | |||
10968 | &rq_create->u.request.context, | 10972 | &rq_create->u.request.context, |
10969 | hrq->entry_count); | 10973 | hrq->entry_count); |
10970 | rq_create->u.request.context.buffer_size = LPFC_HDR_BUF_SIZE; | 10974 | rq_create->u.request.context.buffer_size = LPFC_HDR_BUF_SIZE; |
10975 | bf_set(lpfc_rq_context_rqe_size, | ||
10976 | &rq_create->u.request.context, | ||
10977 | LPFC_RQE_SIZE_8); | ||
10978 | bf_set(lpfc_rq_context_page_size, | ||
10979 | &rq_create->u.request.context, | ||
10980 | (PAGE_SIZE/SLI4_PAGE_SIZE)); | ||
10971 | } else { | 10981 | } else { |
10972 | switch (hrq->entry_count) { | 10982 | switch (hrq->entry_count) { |
10973 | default: | 10983 | default: |
@@ -11043,9 +11053,12 @@ lpfc_rq_create(struct lpfc_hba *phba, struct lpfc_queue *hrq, | |||
11043 | phba->sli4_hba.pc_sli4_params.rqv); | 11053 | phba->sli4_hba.pc_sli4_params.rqv); |
11044 | if (phba->sli4_hba.pc_sli4_params.rqv == LPFC_Q_CREATE_VERSION_1) { | 11054 | if (phba->sli4_hba.pc_sli4_params.rqv == LPFC_Q_CREATE_VERSION_1) { |
11045 | bf_set(lpfc_rq_context_rqe_count_1, | 11055 | bf_set(lpfc_rq_context_rqe_count_1, |
11046 | &rq_create->u.request.context, | 11056 | &rq_create->u.request.context, hrq->entry_count); |
11047 | hrq->entry_count); | ||
11048 | rq_create->u.request.context.buffer_size = LPFC_DATA_BUF_SIZE; | 11057 | rq_create->u.request.context.buffer_size = LPFC_DATA_BUF_SIZE; |
11058 | bf_set(lpfc_rq_context_rqe_size, &rq_create->u.request.context, | ||
11059 | LPFC_RQE_SIZE_8); | ||
11060 | bf_set(lpfc_rq_context_page_size, &rq_create->u.request.context, | ||
11061 | (PAGE_SIZE/SLI4_PAGE_SIZE)); | ||
11049 | } else { | 11062 | } else { |
11050 | switch (drq->entry_count) { | 11063 | switch (drq->entry_count) { |
11051 | default: | 11064 | default: |