From: Christof Schmitt <christof.schmitt@de.ibm.com>
To: James Bottomley <James.Bottomley@HansenPartnership.com>
Cc: linux-scsi@vger.kernel.org, linux-s390@vger.kernel.org,
schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com,
Stefan Raspl <raspl@linux.vnet.ibm.com>,
Martin Peschke <mp3@de.ibm.com>,
Christof Schmitt <christof.schmitt@de.ibm.com>
Subject: [patch 01/13] zfcp: add queue_full sysfs attribute
Date: Wed, 01 Oct 2008 12:42:14 +0200 [thread overview]
Message-ID: <20081001104757.042186000@de.ibm.com> (raw)
In-Reply-To: 20081001104213.585200000@de.ibm.com
[-- Attachment #1: queue_full_sysfs.diff --]
[-- Type: text/plain, Size: 5312 bytes --]
From: Stefan Raspl <raspl@linux.vnet.ibm.com>
Adds a new sysfs attribute queue_full for adapters that records the number
of incidents where a requests could not be submitted due to insufficient
free space on the request queue.
Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com>
Signed-off-by: Martin Peschke <mp3@de.ibm.com>
Signed-off-by: Christof Schmitt <christof.schmitt@de.ibm.com>
---
drivers/s390/scsi/zfcp_def.h | 1 +
drivers/s390/scsi/zfcp_fsf.c | 24 +++++++++++++++++-------
drivers/s390/scsi/zfcp_qdio.c | 1 +
drivers/s390/scsi/zfcp_sysfs.c | 13 +++++++++++++
4 files changed, 32 insertions(+), 7 deletions(-)
--- a/drivers/s390/scsi/zfcp_def.h 2008-09-12 13:16:25.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_def.h 2008-09-12 13:16:59.000000000 +0200
@@ -568,6 +568,7 @@ struct zfcp_adapter {
struct fsf_qtcb_bottom_port *stats_reset_data;
unsigned long stats_reset;
struct work_struct scan_work;
+ atomic_t qdio_outb_full; /* queue full incidents */
};
struct zfcp_port {
--- a/drivers/s390/scsi/zfcp_qdio.c 2008-09-12 13:16:25.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_qdio.c 2008-09-12 13:16:59.000000000 +0200
@@ -282,6 +282,7 @@ static int zfcp_qdio_fill_sbals(struct z
addr += length, remaining -= length) {
sbale = zfcp_qdio_sbale_next(fsf_req, sbtype);
if (!sbale) {
+ atomic_inc(&fsf_req->adapter->qdio_outb_full);
zfcp_qdio_undo_sbals(fsf_req);
return -EINVAL;
}
--- a/drivers/s390/scsi/zfcp_fsf.c 2008-09-12 13:16:25.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_fsf.c 2008-09-12 13:22:30.000000000 +0200
@@ -717,6 +717,14 @@ 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;
@@ -727,6 +735,8 @@ static int zfcp_fsf_req_sbal_get(struct
zfcp_fsf_sbal_check(req_q), 5 * HZ);
if (ret > 0)
return 0;
+ if (!ret)
+ atomic_inc(&adapter->qdio_outb_full);
spin_lock_bh(&req_q->lock);
return -EIO;
@@ -984,7 +994,7 @@ struct zfcp_fsf_req *zfcp_fsf_abort_fcp_
struct zfcp_fsf_req *req = NULL;
spin_lock(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_ABORT_FCP_CMND,
req_flags, adapter->pool.fsf_req_abort);
@@ -1219,7 +1229,7 @@ int zfcp_fsf_send_els(struct zfcp_send_e
return -EBUSY;
spin_lock(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_SEND_ELS,
ZFCP_REQ_AUTO_CLEANUP, NULL);
@@ -1264,7 +1274,7 @@ int zfcp_fsf_exchange_config_data(struct
int retval = -EIO;
spin_lock_bh(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter,
FSF_QTCB_EXCHANGE_CONFIG_DATA,
@@ -1360,7 +1370,7 @@ int zfcp_fsf_exchange_port_data(struct z
return -EOPNOTSUPP;
spin_lock_bh(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA,
ZFCP_REQ_AUTO_CLEANUP,
@@ -1406,7 +1416,7 @@ int zfcp_fsf_exchange_port_data_sync(str
return -EOPNOTSUPP;
spin_lock_bh(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_EXCHANGE_PORT_DATA, 0,
@@ -2224,7 +2234,7 @@ int zfcp_fsf_send_fcp_command_task(struc
return -EBUSY;
spin_lock(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
adapter->pool.fsf_req_scsi);
@@ -2347,7 +2357,7 @@ struct zfcp_fsf_req *zfcp_fsf_send_fcp_c
return NULL;
spin_lock(&adapter->req_q.lock);
- if (!atomic_read(&adapter->req_q.count))
+ if (!zfcp_fsf_sbal_available(adapter))
goto out;
req = zfcp_fsf_req_create(adapter, FSF_QTCB_FCP_CMND, req_flags,
adapter->pool.fsf_req_scsi);
--- a/drivers/s390/scsi/zfcp_sysfs.c 2008-09-12 13:16:25.000000000 +0200
+++ b/drivers/s390/scsi/zfcp_sysfs.c 2008-09-12 13:16:59.000000000 +0200
@@ -487,10 +487,23 @@ ZFCP_SHOST_ATTR(megabytes, "%llu %llu\n"
ZFCP_SHOST_ATTR(seconds_active, "%llu\n",
(unsigned long long) stat_info.seconds_act);
+static ssize_t zfcp_sysfs_adapter_q_full_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ struct Scsi_Host *scsi_host = class_to_shost(dev);
+ struct zfcp_adapter *adapter =
+ (struct zfcp_adapter *) scsi_host->hostdata[0];
+
+ return sprintf(buf, "%d\n", atomic_read(&adapter->qdio_outb_full));
+}
+static DEVICE_ATTR(queue_full, S_IRUGO, zfcp_sysfs_adapter_q_full_show, NULL);
+
struct device_attribute *zfcp_sysfs_shost_attrs[] = {
&dev_attr_utilization,
&dev_attr_requests,
&dev_attr_megabytes,
&dev_attr_seconds_active,
+ &dev_attr_queue_full,
NULL
};
--
next prev parent reply other threads:[~2008-10-01 10:42 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-01 10:42 [patch 00/13] zfcp updates for 2.6.28 Christof Schmitt
2008-10-01 10:42 ` Christof Schmitt [this message]
2008-10-01 10:42 ` [patch 02/13] zfcp: Update message with input from review Christof Schmitt
2008-10-01 10:42 ` [patch 03/13] zfcp: remove unused references, declarations and flags Christof Schmitt
2008-10-01 10:42 ` [patch 04/13] zfcp: attach and release SAN nameserver port on demand Christof Schmitt
2008-10-01 10:42 ` [patch 05/13] zfcp: remove all typedefs and replace them with standards Christof Schmitt
2008-10-01 10:42 ` [patch 06/13] zfcp: Simplify get_adapter_by_busid Christof Schmitt
2008-10-01 10:42 ` [patch 07/13] zfcp: Simplify zfcp data structures Christof Schmitt
2008-10-01 10:42 ` [patch 08/13] zfcp: put threshold data in hba trace Christof Schmitt
2008-10-01 10:42 ` [patch 09/13] zfcp: deadlock via shared work queue tasks Christof Schmitt
2008-10-01 10:42 ` [patch 10/13] zfcp: prevent fc_remote_port_delete calls for unregistered rport Christof Schmitt
2008-10-01 10:42 ` [patch 11/13] zfcp: fix erp list usage without using locks Christof Schmitt
2008-10-01 10:42 ` [patch 12/13] zfcp: wait on SCSI work to be finished before proceeding with init dev Christof Schmitt
2008-10-01 10:42 ` [patch 13/13] zfcp: fix double dbf id usage Christof Schmitt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081001104757.042186000@de.ibm.com \
--to=christof.schmitt@de.ibm.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=heiko.carstens@de.ibm.com \
--cc=linux-s390@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=mp3@de.ibm.com \
--cc=raspl@linux.vnet.ibm.com \
--cc=schwidefsky@de.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.