diff options
author | James Smart <James.Smart@Emulex.Com> | 2006-12-02 13:34:16 -0500 |
---|---|---|
committer | James Bottomley <jejb@mulgrave.il.steeleye.com> | 2006-12-03 10:29:18 -0500 |
commit | a4bc3379fbc368597024104727fdf14ced483c14 (patch) | |
tree | ed16c3eb403754d7fb9e8928ecc5a286f10a12d3 /drivers/scsi/lpfc/lpfc_sli.c | |
parent | 2fb9bd8b9cbe9a8d70bf5f43a9ee6a4fa565ed5a (diff) |
[SCSI] lpfc 8.1.11 : Fix lpfc_multi_ring_support
It was not accounted for in the fast/slow rings.
Genericize the implementation and control it via sysfs
Signed-off-by: James Smart <James.Smart@emulex.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/lpfc/lpfc_sli.c')
-rw-r--r-- | drivers/scsi/lpfc/lpfc_sli.c | 35 |
1 files changed, 30 insertions, 5 deletions
diff --git a/drivers/scsi/lpfc/lpfc_sli.c b/drivers/scsi/lpfc/lpfc_sli.c index 582f5ea4e84e..120af3db635a 100644 --- a/drivers/scsi/lpfc/lpfc_sli.c +++ b/drivers/scsi/lpfc/lpfc_sli.c | |||
@@ -1098,6 +1098,7 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | |||
1098 | lpfc_sli_pcimem_bcopy((uint32_t *) entry, | 1098 | lpfc_sli_pcimem_bcopy((uint32_t *) entry, |
1099 | (uint32_t *) &rspiocbq.iocb, | 1099 | (uint32_t *) &rspiocbq.iocb, |
1100 | sizeof (IOCB_t)); | 1100 | sizeof (IOCB_t)); |
1101 | INIT_LIST_HEAD(&(rspiocbq.list)); | ||
1101 | irsp = &rspiocbq.iocb; | 1102 | irsp = &rspiocbq.iocb; |
1102 | 1103 | ||
1103 | type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); | 1104 | type = lpfc_sli_iocb_cmd_type(irsp->ulpCommand & CMD_IOCB_MASK); |
@@ -1149,6 +1150,11 @@ lpfc_sli_handle_fast_ring_event(struct lpfc_hba * phba, | |||
1149 | } | 1150 | } |
1150 | } | 1151 | } |
1151 | break; | 1152 | break; |
1153 | case LPFC_UNSOL_IOCB: | ||
1154 | spin_unlock_irqrestore(phba->host->host_lock, iflag); | ||
1155 | lpfc_sli_process_unsol_iocb(phba, pring, &rspiocbq); | ||
1156 | spin_lock_irqsave(phba->host->host_lock, iflag); | ||
1157 | break; | ||
1152 | default: | 1158 | default: |
1153 | if (irsp->ulpCommand == CMD_ADAPTER_MSG) { | 1159 | if (irsp->ulpCommand == CMD_ADAPTER_MSG) { |
1154 | char adaptermsg[LPFC_MAX_ADPTMSG]; | 1160 | char adaptermsg[LPFC_MAX_ADPTMSG]; |
@@ -2472,13 +2478,17 @@ lpfc_extra_ring_setup( struct lpfc_hba *phba) | |||
2472 | psli = &phba->sli; | 2478 | psli = &phba->sli; |
2473 | 2479 | ||
2474 | /* Adjust cmd/rsp ring iocb entries more evenly */ | 2480 | /* Adjust cmd/rsp ring iocb entries more evenly */ |
2481 | |||
2482 | /* Take some away from the FCP ring */ | ||
2475 | pring = &psli->ring[psli->fcp_ring]; | 2483 | pring = &psli->ring[psli->fcp_ring]; |
2476 | pring->numCiocb -= SLI2_IOCB_CMD_R1XTRA_ENTRIES; | 2484 | pring->numCiocb -= SLI2_IOCB_CMD_R1XTRA_ENTRIES; |
2477 | pring->numRiocb -= SLI2_IOCB_RSP_R1XTRA_ENTRIES; | 2485 | pring->numRiocb -= SLI2_IOCB_RSP_R1XTRA_ENTRIES; |
2478 | pring->numCiocb -= SLI2_IOCB_CMD_R3XTRA_ENTRIES; | 2486 | pring->numCiocb -= SLI2_IOCB_CMD_R3XTRA_ENTRIES; |
2479 | pring->numRiocb -= SLI2_IOCB_RSP_R3XTRA_ENTRIES; | 2487 | pring->numRiocb -= SLI2_IOCB_RSP_R3XTRA_ENTRIES; |
2480 | 2488 | ||
2481 | pring = &psli->ring[1]; | 2489 | /* and give them to the extra ring */ |
2490 | pring = &psli->ring[psli->extra_ring]; | ||
2491 | |||
2482 | pring->numCiocb += SLI2_IOCB_CMD_R1XTRA_ENTRIES; | 2492 | pring->numCiocb += SLI2_IOCB_CMD_R1XTRA_ENTRIES; |
2483 | pring->numRiocb += SLI2_IOCB_RSP_R1XTRA_ENTRIES; | 2493 | pring->numRiocb += SLI2_IOCB_RSP_R1XTRA_ENTRIES; |
2484 | pring->numCiocb += SLI2_IOCB_CMD_R3XTRA_ENTRIES; | 2494 | pring->numCiocb += SLI2_IOCB_CMD_R3XTRA_ENTRIES; |
@@ -2488,8 +2498,8 @@ lpfc_extra_ring_setup( struct lpfc_hba *phba) | |||
2488 | pring->iotag_max = 4096; | 2498 | pring->iotag_max = 4096; |
2489 | pring->num_mask = 1; | 2499 | pring->num_mask = 1; |
2490 | pring->prt[0].profile = 0; /* Mask 0 */ | 2500 | pring->prt[0].profile = 0; /* Mask 0 */ |
2491 | pring->prt[0].rctl = FC_UNSOL_DATA; | 2501 | pring->prt[0].rctl = phba->cfg_multi_ring_rctl; |
2492 | pring->prt[0].type = 5; | 2502 | pring->prt[0].type = phba->cfg_multi_ring_type; |
2493 | pring->prt[0].lpfc_sli_rcv_unsol_event = NULL; | 2503 | pring->prt[0].lpfc_sli_rcv_unsol_event = NULL; |
2494 | return 0; | 2504 | return 0; |
2495 | } | 2505 | } |
@@ -2505,7 +2515,7 @@ lpfc_sli_setup(struct lpfc_hba *phba) | |||
2505 | psli->sli_flag = 0; | 2515 | psli->sli_flag = 0; |
2506 | psli->fcp_ring = LPFC_FCP_RING; | 2516 | psli->fcp_ring = LPFC_FCP_RING; |
2507 | psli->next_ring = LPFC_FCP_NEXT_RING; | 2517 | psli->next_ring = LPFC_FCP_NEXT_RING; |
2508 | psli->ip_ring = LPFC_IP_RING; | 2518 | psli->extra_ring = LPFC_EXTRA_RING; |
2509 | 2519 | ||
2510 | psli->iocbq_lookup = NULL; | 2520 | psli->iocbq_lookup = NULL; |
2511 | psli->iocbq_lookup_len = 0; | 2521 | psli->iocbq_lookup_len = 0; |
@@ -2528,7 +2538,7 @@ lpfc_sli_setup(struct lpfc_hba *phba) | |||
2528 | pring->fast_iotag = pring->iotag_max; | 2538 | pring->fast_iotag = pring->iotag_max; |
2529 | pring->num_mask = 0; | 2539 | pring->num_mask = 0; |
2530 | break; | 2540 | break; |
2531 | case LPFC_IP_RING: /* ring 1 - IP */ | 2541 | case LPFC_EXTRA_RING: /* ring 1 - EXTRA */ |
2532 | /* numCiocb and numRiocb are used in config_port */ | 2542 | /* numCiocb and numRiocb are used in config_port */ |
2533 | pring->numCiocb = SLI2_IOCB_CMD_R1_ENTRIES; | 2543 | pring->numCiocb = SLI2_IOCB_CMD_R1_ENTRIES; |
2534 | pring->numRiocb = SLI2_IOCB_RSP_R1_ENTRIES; | 2544 | pring->numRiocb = SLI2_IOCB_RSP_R1_ENTRIES; |
@@ -3238,6 +3248,21 @@ lpfc_intr_handler(int irq, void *dev_id) | |||
3238 | lpfc_sli_handle_fast_ring_event(phba, | 3248 | lpfc_sli_handle_fast_ring_event(phba, |
3239 | &phba->sli.ring[LPFC_FCP_RING], | 3249 | &phba->sli.ring[LPFC_FCP_RING], |
3240 | status); | 3250 | status); |
3251 | |||
3252 | if (phba->cfg_multi_ring_support == 2) { | ||
3253 | /* | ||
3254 | * Process all events on extra ring. Take the optimized path | ||
3255 | * for extra ring IO. Any other IO is slow path and is handled | ||
3256 | * by the worker thread. | ||
3257 | */ | ||
3258 | status = (ha_copy & (HA_RXMASK << (4*LPFC_EXTRA_RING))); | ||
3259 | status >>= (4*LPFC_EXTRA_RING); | ||
3260 | if (status & HA_RXATT) { | ||
3261 | lpfc_sli_handle_fast_ring_event(phba, | ||
3262 | &phba->sli.ring[LPFC_EXTRA_RING], | ||
3263 | status); | ||
3264 | } | ||
3265 | } | ||
3241 | return IRQ_HANDLED; | 3266 | return IRQ_HANDLED; |
3242 | 3267 | ||
3243 | } /* lpfc_intr_handler */ | 3268 | } /* lpfc_intr_handler */ |