diff options
author | Krishna Gudipati <kgudipat@brocade.com> | 2012-03-13 20:41:02 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-03-28 04:57:58 -0400 |
commit | bd5a026019bc1f799065b0a39230d1f81bb4ff76 (patch) | |
tree | 08fd936b5b18fbfb59342a8c4aba33717d5d62c6 /drivers | |
parent | ff179e0f4a4da030df52c0632b0615e9a13b5e66 (diff) |
[SCSI] bfa: BSG and User interface fixes.
Made changes to set the rport maxfrsize param to use a value that is
equal to or less than the Buffer-to-Buffer Receive Data_Field size
specified in the Common Service Parameters.
Increased the diag memtest timeout for the Brocade-1860 adapters.
Made changes to enable valid port speed configuration check for all adapters.
Made changes to increase the max hw segments in a request, in order to
support larger data transfers from user space.
Signed-off-by: Krishna Gudipati <kgudipat@brocade.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/bfa/bfa_fcs_rport.c | 5 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_ioc.c | 8 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfa_svc.c | 36 | ||||
-rw-r--r-- | drivers/scsi/bfa/bfad_bsg.c | 7 |
4 files changed, 34 insertions, 22 deletions
diff --git a/drivers/scsi/bfa/bfa_fcs_rport.c b/drivers/scsi/bfa/bfa_fcs_rport.c index 52628d5d3c9b..fe0463a1db04 100644 --- a/drivers/scsi/bfa/bfa_fcs_rport.c +++ b/drivers/scsi/bfa/bfa_fcs_rport.c | |||
@@ -2169,7 +2169,10 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi) | |||
2169 | * - MAX receive frame size | 2169 | * - MAX receive frame size |
2170 | */ | 2170 | */ |
2171 | rport->cisc = plogi->csp.cisc; | 2171 | rport->cisc = plogi->csp.cisc; |
2172 | rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); | 2172 | if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz)) |
2173 | rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz); | ||
2174 | else | ||
2175 | rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz); | ||
2173 | 2176 | ||
2174 | bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); | 2177 | bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred)); |
2175 | bfa_trc(port->fcs, port->fabric->bb_credit); | 2178 | bfa_trc(port->fcs, port->fabric->bb_credit); |
diff --git a/drivers/scsi/bfa/bfa_ioc.c b/drivers/scsi/bfa/bfa_ioc.c index 56cf3f6c6884..14e6284e48e4 100644 --- a/drivers/scsi/bfa/bfa_ioc.c +++ b/drivers/scsi/bfa/bfa_ioc.c | |||
@@ -4449,7 +4449,7 @@ bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type, | |||
4449 | */ | 4449 | */ |
4450 | 4450 | ||
4451 | #define BFA_DIAG_MEMTEST_TOV 50000 /* memtest timeout in msec */ | 4451 | #define BFA_DIAG_MEMTEST_TOV 50000 /* memtest timeout in msec */ |
4452 | #define BFA_DIAG_FWPING_TOV 1000 /* msec */ | 4452 | #define CT2_BFA_DIAG_MEMTEST_TOV (9*30*1000) /* 4.5 min */ |
4453 | 4453 | ||
4454 | /* IOC event handler */ | 4454 | /* IOC event handler */ |
4455 | static void | 4455 | static void |
@@ -4804,6 +4804,8 @@ bfa_diag_memtest(struct bfa_diag_s *diag, struct bfa_diag_memtest_s *memtest, | |||
4804 | u32 pattern, struct bfa_diag_memtest_result *result, | 4804 | u32 pattern, struct bfa_diag_memtest_result *result, |
4805 | bfa_cb_diag_t cbfn, void *cbarg) | 4805 | bfa_cb_diag_t cbfn, void *cbarg) |
4806 | { | 4806 | { |
4807 | u32 memtest_tov; | ||
4808 | |||
4807 | bfa_trc(diag, pattern); | 4809 | bfa_trc(diag, pattern); |
4808 | 4810 | ||
4809 | if (!bfa_ioc_adapter_is_disabled(diag->ioc)) | 4811 | if (!bfa_ioc_adapter_is_disabled(diag->ioc)) |
@@ -4823,8 +4825,10 @@ bfa_diag_memtest(struct bfa_diag_s *diag, struct bfa_diag_memtest_s *memtest, | |||
4823 | /* download memtest code and take LPU0 out of reset */ | 4825 | /* download memtest code and take LPU0 out of reset */ |
4824 | bfa_ioc_boot(diag->ioc, BFI_FWBOOT_TYPE_MEMTEST, BFI_FWBOOT_ENV_OS); | 4826 | bfa_ioc_boot(diag->ioc, BFI_FWBOOT_TYPE_MEMTEST, BFI_FWBOOT_ENV_OS); |
4825 | 4827 | ||
4828 | memtest_tov = (bfa_ioc_asic_gen(diag->ioc) == BFI_ASIC_GEN_CT2) ? | ||
4829 | CT2_BFA_DIAG_MEMTEST_TOV : BFA_DIAG_MEMTEST_TOV; | ||
4826 | bfa_timer_begin(diag->ioc->timer_mod, &diag->timer, | 4830 | bfa_timer_begin(diag->ioc->timer_mod, &diag->timer, |
4827 | bfa_diag_memtest_done, diag, BFA_DIAG_MEMTEST_TOV); | 4831 | bfa_diag_memtest_done, diag, memtest_tov); |
4828 | diag->timer_active = 1; | 4832 | diag->timer_active = 1; |
4829 | return BFA_STATUS_OK; | 4833 | return BFA_STATUS_OK; |
4830 | } | 4834 | } |
diff --git a/drivers/scsi/bfa/bfa_svc.c b/drivers/scsi/bfa/bfa_svc.c index 6583b2d94f64..2e856e6710f7 100644 --- a/drivers/scsi/bfa/bfa_svc.c +++ b/drivers/scsi/bfa/bfa_svc.c | |||
@@ -3576,26 +3576,24 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed) | |||
3576 | return BFA_STATUS_UNSUPP_SPEED; | 3576 | return BFA_STATUS_UNSUPP_SPEED; |
3577 | } | 3577 | } |
3578 | 3578 | ||
3579 | /* For Mezz card, port speed entered needs to be checked */ | 3579 | /* Port speed entered needs to be checked */ |
3580 | if (bfa_mfg_is_mezz(fcport->bfa->ioc.attr->card_type)) { | 3580 | if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { |
3581 | if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) { | 3581 | /* For CT2, 1G is not supported */ |
3582 | /* For CT2, 1G is not supported */ | 3582 | if ((speed == BFA_PORT_SPEED_1GBPS) && |
3583 | if ((speed == BFA_PORT_SPEED_1GBPS) && | 3583 | (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id))) |
3584 | (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id))) | 3584 | return BFA_STATUS_UNSUPP_SPEED; |
3585 | return BFA_STATUS_UNSUPP_SPEED; | ||
3586 | 3585 | ||
3587 | /* Already checked for Auto Speed and Max Speed supp */ | 3586 | /* Already checked for Auto Speed and Max Speed supp */ |
3588 | if (!(speed == BFA_PORT_SPEED_1GBPS || | 3587 | if (!(speed == BFA_PORT_SPEED_1GBPS || |
3589 | speed == BFA_PORT_SPEED_2GBPS || | 3588 | speed == BFA_PORT_SPEED_2GBPS || |
3590 | speed == BFA_PORT_SPEED_4GBPS || | 3589 | speed == BFA_PORT_SPEED_4GBPS || |
3591 | speed == BFA_PORT_SPEED_8GBPS || | 3590 | speed == BFA_PORT_SPEED_8GBPS || |
3592 | speed == BFA_PORT_SPEED_16GBPS || | 3591 | speed == BFA_PORT_SPEED_16GBPS || |
3593 | speed == BFA_PORT_SPEED_AUTO)) | 3592 | speed == BFA_PORT_SPEED_AUTO)) |
3594 | return BFA_STATUS_UNSUPP_SPEED; | 3593 | return BFA_STATUS_UNSUPP_SPEED; |
3595 | } else { | 3594 | } else { |
3596 | if (speed != BFA_PORT_SPEED_10GBPS) | 3595 | if (speed != BFA_PORT_SPEED_10GBPS) |
3597 | return BFA_STATUS_UNSUPP_SPEED; | 3596 | return BFA_STATUS_UNSUPP_SPEED; |
3598 | } | ||
3599 | } | 3597 | } |
3600 | 3598 | ||
3601 | fcport->cfg.speed = speed; | 3599 | fcport->cfg.speed = speed; |
diff --git a/drivers/scsi/bfa/bfad_bsg.c b/drivers/scsi/bfa/bfad_bsg.c index 31a1d8a027b8..e1f4b10df42a 100644 --- a/drivers/scsi/bfa/bfad_bsg.c +++ b/drivers/scsi/bfa/bfad_bsg.c | |||
@@ -2762,9 +2762,16 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job) | |||
2762 | struct bfad_im_port_s *im_port = | 2762 | struct bfad_im_port_s *im_port = |
2763 | (struct bfad_im_port_s *) job->shost->hostdata[0]; | 2763 | (struct bfad_im_port_s *) job->shost->hostdata[0]; |
2764 | struct bfad_s *bfad = im_port->bfad; | 2764 | struct bfad_s *bfad = im_port->bfad; |
2765 | struct request_queue *request_q = job->req->q; | ||
2765 | void *payload_kbuf; | 2766 | void *payload_kbuf; |
2766 | int rc = -EINVAL; | 2767 | int rc = -EINVAL; |
2767 | 2768 | ||
2769 | /* | ||
2770 | * Set the BSG device request_queue size to 256 to support | ||
2771 | * payloads larger than 512*1024K bytes. | ||
2772 | */ | ||
2773 | blk_queue_max_segments(request_q, 256); | ||
2774 | |||
2768 | /* Allocate a temp buffer to hold the passed in user space command */ | 2775 | /* Allocate a temp buffer to hold the passed in user space command */ |
2769 | payload_kbuf = kzalloc(job->request_payload.payload_len, GFP_KERNEL); | 2776 | payload_kbuf = kzalloc(job->request_payload.payload_len, GFP_KERNEL); |
2770 | if (!payload_kbuf) { | 2777 | if (!payload_kbuf) { |