]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blobdiff - src/patches/suse-2.6.27.31/patches.arch/s390-10-03-zfcp_els_thread_context.patch
Reenabled linux-xen, added patches for Xen Kernel Version 2.6.27.31,
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.arch / s390-10-03-zfcp_els_thread_context.patch
diff --git a/src/patches/suse-2.6.27.31/patches.arch/s390-10-03-zfcp_els_thread_context.patch b/src/patches/suse-2.6.27.31/patches.arch/s390-10-03-zfcp_els_thread_context.patch
new file mode 100644 (file)
index 0000000..27e0e2b
--- /dev/null
@@ -0,0 +1,148 @@
+From: Gerald Schaefer <geraldsc@de.ibm.com>
+Subject: zfcp: Send ELS ADISC from workqueue
+References: bnc#482818,LTC#51958
+
+Symptom:     Remote port status change not handled
+             with high I/O load on other ports.
+Problem:     The ELS ADISC command used for checking
+             the remote port status could not be sent
+             because of a full request queue.
+Solution:    Move issing the ELS ADISC request to
+             a workqueue that can wait for a slot
+             in the request queue to become free.
+
+Acked-by: John Jolly <jjolly@suse.de>
+---
+ drivers/s390/scsi/zfcp_aux.c |    1 +
+ drivers/s390/scsi/zfcp_def.h |    1 +
+ drivers/s390/scsi/zfcp_ext.h |    1 +
+ drivers/s390/scsi/zfcp_fc.c  |   28 ++++++++++++++++++----------
+ drivers/s390/scsi/zfcp_fsf.c |   18 ++++++------------
+ 5 files changed, 27 insertions(+), 22 deletions(-)
+
+--- a/drivers/s390/scsi/zfcp_aux.c
++++ b/drivers/s390/scsi/zfcp_aux.c
+@@ -611,6 +611,7 @@ struct zfcp_port *zfcp_port_enqueue(stru
+       init_waitqueue_head(&port->remove_wq);
+       INIT_LIST_HEAD(&port->unit_list_head);
+       INIT_WORK(&port->gid_pn_work, zfcp_erp_port_strategy_open_lookup);
++      INIT_WORK(&port->test_link_work, zfcp_fc_link_test_work);
+       port->adapter = adapter;
+       port->d_id = d_id;
+--- a/drivers/s390/scsi/zfcp_def.h
++++ b/drivers/s390/scsi/zfcp_def.h
+@@ -539,6 +539,7 @@ struct zfcp_port {
+       u32                    maxframe_size;
+       u32                    supported_classes;
+       struct work_struct     gid_pn_work;
++      struct work_struct     test_link_work;
+ };
+ struct zfcp_unit {
+--- a/drivers/s390/scsi/zfcp_ext.h
++++ b/drivers/s390/scsi/zfcp_ext.h
+@@ -101,6 +101,7 @@ extern void zfcp_fc_incoming_els(struct 
+ extern int zfcp_fc_ns_gid_pn(struct zfcp_erp_action *);
+ extern void zfcp_fc_plogi_evaluate(struct zfcp_port *, struct fsf_plogi *);
+ extern void zfcp_test_link(struct zfcp_port *);
++extern void zfcp_fc_link_test_work(struct work_struct *);
+ extern void zfcp_fc_nameserver_init(struct zfcp_adapter *);
+ /* zfcp_fsf.c */
+--- a/drivers/s390/scsi/zfcp_fc.c
++++ b/drivers/s390/scsi/zfcp_fc.c
+@@ -415,19 +415,12 @@ static int zfcp_fc_adisc(struct zfcp_por
+       return zfcp_fsf_send_els(&adisc->els);
+ }
+-/**
+- * zfcp_test_link - lightweight link test procedure
+- * @port: port to be tested
+- *
+- * Test status of a link to a remote port using the ELS command ADISC.
+- * If there is a problem with the remote port, error recovery steps
+- * will be triggered.
+- */
+-void zfcp_test_link(struct zfcp_port *port)
++void zfcp_fc_link_test_work(struct work_struct *work)
+ {
++      struct zfcp_port *port =
++              container_of(work, struct zfcp_port, test_link_work);
+       int retval;
+-      zfcp_port_get(port);
+       retval = zfcp_fc_adisc(port);
+       if (retval == 0)
+               return;
+@@ -438,6 +431,21 @@ void zfcp_test_link(struct zfcp_port *po
+               zfcp_erp_port_forced_reopen(port, 0, 65, NULL);
+ }
++/**
++ * zfcp_test_link - lightweight link test procedure
++ * @port: port to be tested
++ *
++ * Test status of a link to a remote port using the ELS command ADISC.
++ * If there is a problem with the remote port, error recovery steps
++ * will be triggered.
++ */
++void zfcp_test_link(struct zfcp_port *port)
++{
++      zfcp_port_get(port);
++      if (!queue_work(zfcp_data.work_queue, &port->test_link_work))
++              zfcp_port_put(port);
++}
++
+ static void zfcp_free_sg_env(struct zfcp_gpn_ft *gpn_ft, int buf_num)
+ {
+       struct scatterlist *sg = &gpn_ft->sg_req;
+--- a/drivers/s390/scsi/zfcp_fsf.c
++++ b/drivers/s390/scsi/zfcp_fsf.c
+@@ -654,14 +654,6 @@ static int zfcp_fsf_sbal_check(struct zf
+       return 0;
+ }
+-static int zfcp_fsf_sbal_available(struct zfcp_adapter *adapter)
+-{
+-      unsigned int count = atomic_read(&adapter->req_q.count);
+-      if (!count)
+-              atomic_inc(&adapter->qdio_outb_full);
+-      return count > 0;
+-}
+-
+ static int zfcp_fsf_req_sbal_get(struct zfcp_adapter *adapter)
+ {
+       long ret;
+@@ -1177,8 +1169,8 @@ int zfcp_fsf_send_els(struct zfcp_send_e
+                      ZFCP_STATUS_COMMON_UNBLOCKED)))
+               return -EBUSY;
+-      spin_lock(&adapter->req_q_lock);
+-      if (!zfcp_fsf_sbal_available(adapter))
++      spin_lock_bh(&adapter->req_q_lock);
++      if (zfcp_fsf_req_sbal_get(adapter))
+               goto out;
+       req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS,
+                                 ZFCP_REQ_AUTO_CLEANUP, NULL);
+@@ -1211,7 +1203,7 @@ int zfcp_fsf_send_els(struct zfcp_send_e
+ failed_send:
+       zfcp_fsf_req_free(req);
+ out:
+-      spin_unlock(&adapter->req_q_lock);
++      spin_unlock_bh(&adapter->req_q_lock);
+       return ret;
+ }
+@@ -2336,8 +2328,10 @@ int zfcp_fsf_send_fcp_command_task(struc
+               return -EBUSY;
+       spin_lock(&adapter->req_q_lock);
+-      if (!zfcp_fsf_sbal_available(adapter))
++      if (atomic_read(&adapter->req_q.count) <= 0) {
++              atomic_inc(&adapter->qdio_outb_full);
+               goto out;
++      }
+       req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
+                                 adapter->pool.fsf_req_scsi);
+       if (IS_ERR(req)) {