[SCSI] zfcp: Use status_read_buf_num provided by FCP channel
authorChristof Schmitt <christof.schmitt@de.ibm.com>
Fri, 30 Apr 2010 16:09:36 +0000 (18:09 +0200)
committerJames Bottomley <James.Bottomley@suse.de>
Sun, 2 May 2010 19:42:33 +0000 (15:42 -0400)
The FCP channel provides the number of status read buffers to issue.
Use the provided number instead of the hardcoded number in zfcp.

Reviewed-by: Swen Schillig <swen@vnet.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
drivers/s390/scsi/zfcp_aux.c
drivers/s390/scsi/zfcp_def.h
drivers/s390/scsi/zfcp_erp.c
drivers/s390/scsi/zfcp_fsf.c
drivers/s390/scsi/zfcp_fsf.h

index abf33db647ff138d0dd4213a20206fe8aeae621b..e331df2122f7b2a8eeed71a656c602cebfbcb850 100644 (file)
@@ -425,7 +425,8 @@ int zfcp_status_read_refill(struct zfcp_adapter *adapter)
 {
        while (atomic_read(&adapter->stat_miss) > 0)
                if (zfcp_fsf_status_read(adapter->qdio)) {
-                       if (atomic_read(&adapter->stat_miss) >= 16) {
+                       if (atomic_read(&adapter->stat_miss) >=
+                           adapter->stat_read_buf_num) {
                                zfcp_erp_adapter_reopen(adapter, 0, "axsref1",
                                                        NULL);
                                return 1;
index 0b2ae60a6f9f18dbd559b5d46b3fcf040cb67fe6..9fa1b064893e967119178ef5a27fd08d59362842 100644 (file)
@@ -164,6 +164,7 @@ struct zfcp_adapter {
                                                      stack abort/command
                                                      completion races */
        atomic_t                stat_miss;         /* # missing status reads*/
+       unsigned int            stat_read_buf_num;
        struct work_struct      stat_work;
        atomic_t                status;            /* status of this adapter */
        struct list_head        erp_ready_head;    /* error recovery for this
index 0be5e7ea2828704985e37aa620fe3ca5457aa6da..e3dbeda97179bccc814e424c705a53255ef61f54 100644 (file)
@@ -714,7 +714,7 @@ static int zfcp_erp_adapter_strategy_open_fsf(struct zfcp_erp_action *act)
        if (zfcp_erp_adapter_strategy_open_fsf_xport(act) == ZFCP_ERP_FAILED)
                return ZFCP_ERP_FAILED;
 
-       atomic_set(&act->adapter->stat_miss, 16);
+       atomic_set(&act->adapter->stat_miss, act->adapter->stat_read_buf_num);
        if (zfcp_status_read_refill(act->adapter))
                return ZFCP_ERP_FAILED;
 
index 3822f22b8150c65742da264c964761971d47a46e..9f90b03ac97db4c381b87e8dc54965669c834a8e 100644 (file)
@@ -496,6 +496,7 @@ static int zfcp_fsf_exchange_config_evaluate(struct zfcp_fsf_req *req)
 
        adapter->hydra_version = bottom->adapter_type;
        adapter->timer_ticks = bottom->timer_interval;
+       adapter->stat_read_buf_num = max(bottom->status_read_buf_num, (u16)16);
 
        if (fc_host_permanent_port_name(shost) == -1)
                fc_host_permanent_port_name(shost) = fc_host_port_name(shost);
index 4008bd78679338fa280bc786c89032ad395dee20..519083fd6e89f30e48a88d8dceb2f053121fc360 100644 (file)
@@ -366,7 +366,7 @@ struct fsf_qtcb_bottom_config {
        u32 adapter_type;
        u8 res0;
        u8 peer_d_id[3];
-       u8 res1[2];
+       u16 status_read_buf_num;
        u16 timer_interval;
        u8 res2[9];
        u8 s_id[3];