[SCSI] bfa: BSG and User interface fixes.
authorKrishna Gudipati <kgudipat@brocade.com>
Wed, 14 Mar 2012 00:41:02 +0000 (17:41 -0700)
committerJames Bottomley <JBottomley@Parallels.com>
Wed, 28 Mar 2012 08:57:58 +0000 (09:57 +0100)
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>
drivers/scsi/bfa/bfa_fcs_rport.c
drivers/scsi/bfa/bfa_ioc.c
drivers/scsi/bfa/bfa_svc.c
drivers/scsi/bfa/bfad_bsg.c

index 52628d5d3c9b0663486833db47eda3d449a60aa9..fe0463a1db0456993ac9c9de8de991d6e6ce9941 100644 (file)
@@ -2169,7 +2169,10 @@ bfa_fcs_rport_update(struct bfa_fcs_rport_s *rport, struct fc_logi_s *plogi)
         * - MAX receive frame size
         */
        rport->cisc = plogi->csp.cisc;
-       rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz);
+       if (be16_to_cpu(plogi->class3.rxsz) < be16_to_cpu(plogi->csp.rxsz))
+               rport->maxfrsize = be16_to_cpu(plogi->class3.rxsz);
+       else
+               rport->maxfrsize = be16_to_cpu(plogi->csp.rxsz);
 
        bfa_trc(port->fcs, be16_to_cpu(plogi->csp.bbcred));
        bfa_trc(port->fcs, port->fabric->bb_credit);
index 56cf3f6c68842a2684366b16b94a1990166fa5ea..14e6284e48e4110b4c907b06dacb311c06c26f77 100644 (file)
@@ -4449,7 +4449,7 @@ bfa_flash_read_part(struct bfa_flash_s *flash, enum bfa_flash_part_type type,
  */
 
 #define BFA_DIAG_MEMTEST_TOV   50000   /* memtest timeout in msec */
-#define BFA_DIAG_FWPING_TOV    1000    /* msec */
+#define CT2_BFA_DIAG_MEMTEST_TOV       (9*30*1000)  /* 4.5 min */
 
 /* IOC event handler */
 static void
@@ -4804,6 +4804,8 @@ bfa_diag_memtest(struct bfa_diag_s *diag, struct bfa_diag_memtest_s *memtest,
                u32 pattern, struct bfa_diag_memtest_result *result,
                bfa_cb_diag_t cbfn, void *cbarg)
 {
+       u32     memtest_tov;
+
        bfa_trc(diag, pattern);
 
        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,
        /* download memtest code and take LPU0 out of reset */
        bfa_ioc_boot(diag->ioc, BFI_FWBOOT_TYPE_MEMTEST, BFI_FWBOOT_ENV_OS);
 
+       memtest_tov = (bfa_ioc_asic_gen(diag->ioc) == BFI_ASIC_GEN_CT2) ?
+                      CT2_BFA_DIAG_MEMTEST_TOV : BFA_DIAG_MEMTEST_TOV;
        bfa_timer_begin(diag->ioc->timer_mod, &diag->timer,
-                       bfa_diag_memtest_done, diag, BFA_DIAG_MEMTEST_TOV);
+                       bfa_diag_memtest_done, diag, memtest_tov);
        diag->timer_active = 1;
        return BFA_STATUS_OK;
 }
index 6583b2d94f6426bb6777e4d8bf76334734d1f47c..2e856e6710f7d10b2e7083771cdac865bfd15404 100644 (file)
@@ -3576,26 +3576,24 @@ bfa_fcport_cfg_speed(struct bfa_s *bfa, enum bfa_port_speed speed)
                return BFA_STATUS_UNSUPP_SPEED;
        }
 
-       /* For Mezz card, port speed entered needs to be checked */
-       if (bfa_mfg_is_mezz(fcport->bfa->ioc.attr->card_type)) {
-               if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) {
-                       /* For CT2, 1G is not supported */
-                       if ((speed == BFA_PORT_SPEED_1GBPS) &&
-                           (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id)))
-                               return BFA_STATUS_UNSUPP_SPEED;
+       /* Port speed entered needs to be checked */
+       if (bfa_ioc_get_type(&fcport->bfa->ioc) == BFA_IOC_TYPE_FC) {
+               /* For CT2, 1G is not supported */
+               if ((speed == BFA_PORT_SPEED_1GBPS) &&
+                   (bfa_asic_id_ct2(bfa->ioc.pcidev.device_id)))
+                       return BFA_STATUS_UNSUPP_SPEED;
 
-                       /* Already checked for Auto Speed and Max Speed supp */
-                       if (!(speed == BFA_PORT_SPEED_1GBPS ||
-                             speed == BFA_PORT_SPEED_2GBPS ||
-                             speed == BFA_PORT_SPEED_4GBPS ||
-                             speed == BFA_PORT_SPEED_8GBPS ||
-                             speed == BFA_PORT_SPEED_16GBPS ||
-                             speed == BFA_PORT_SPEED_AUTO))
-                               return BFA_STATUS_UNSUPP_SPEED;
-               } else {
-                       if (speed != BFA_PORT_SPEED_10GBPS)
-                               return BFA_STATUS_UNSUPP_SPEED;
-               }
+               /* Already checked for Auto Speed and Max Speed supp */
+               if (!(speed == BFA_PORT_SPEED_1GBPS ||
+                     speed == BFA_PORT_SPEED_2GBPS ||
+                     speed == BFA_PORT_SPEED_4GBPS ||
+                     speed == BFA_PORT_SPEED_8GBPS ||
+                     speed == BFA_PORT_SPEED_16GBPS ||
+                     speed == BFA_PORT_SPEED_AUTO))
+                       return BFA_STATUS_UNSUPP_SPEED;
+       } else {
+               if (speed != BFA_PORT_SPEED_10GBPS)
+                       return BFA_STATUS_UNSUPP_SPEED;
        }
 
        fcport->cfg.speed = speed;
index 31a1d8a027b86aa1be319d3fa0c0910d270b41f7..e1f4b10df42aaf14cb9d069c9ddc372393c473c3 100644 (file)
@@ -2762,9 +2762,16 @@ bfad_im_bsg_vendor_request(struct fc_bsg_job *job)
        struct bfad_im_port_s *im_port =
                        (struct bfad_im_port_s *) job->shost->hostdata[0];
        struct bfad_s *bfad = im_port->bfad;
+       struct request_queue *request_q = job->req->q;
        void *payload_kbuf;
        int rc = -EINVAL;
 
+       /*
+        * Set the BSG device request_queue size to 256 to support
+        * payloads larger than 512*1024K bytes.
+        */
+       blk_queue_max_segments(request_q, 256);
+
        /* Allocate a temp buffer to hold the passed in user space command */
        payload_kbuf = kzalloc(job->request_payload.payload_len, GFP_KERNEL);
        if (!payload_kbuf) {