Commit 4a07750b authored by Harald Freudenberger's avatar Harald Freudenberger Committed by Martin Schwidefsky

s390/zcrypt: Show load of cards and queues in sysfs

Show the current load value of cards and queues in sysfs.
The load value for each card and queue is maintained by
the zcrypt device driver for dispatching and load
balancing requests over the available devices.

This patch provides the load value to userspace via a
new read only sysfs attribute 'load' per card and queue.
Signed-off-by: default avatarHarald Freudenberger <freude@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent df80c038
...@@ -83,9 +83,21 @@ static ssize_t zcrypt_card_online_store(struct device *dev, ...@@ -83,9 +83,21 @@ static ssize_t zcrypt_card_online_store(struct device *dev,
static DEVICE_ATTR(online, 0644, zcrypt_card_online_show, static DEVICE_ATTR(online, 0644, zcrypt_card_online_show,
zcrypt_card_online_store); zcrypt_card_online_store);
static ssize_t zcrypt_card_load_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct zcrypt_card *zc = to_ap_card(dev)->private;
return snprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&zc->load));
}
static DEVICE_ATTR(load, 0444, zcrypt_card_load_show, NULL);
static struct attribute *zcrypt_card_attrs[] = { static struct attribute *zcrypt_card_attrs[] = {
&dev_attr_type.attr, &dev_attr_type.attr,
&dev_attr_online.attr, &dev_attr_online.attr,
&dev_attr_load.attr,
NULL, NULL,
}; };
......
...@@ -75,8 +75,20 @@ static ssize_t zcrypt_queue_online_store(struct device *dev, ...@@ -75,8 +75,20 @@ static ssize_t zcrypt_queue_online_store(struct device *dev,
static DEVICE_ATTR(online, 0644, zcrypt_queue_online_show, static DEVICE_ATTR(online, 0644, zcrypt_queue_online_show,
zcrypt_queue_online_store); zcrypt_queue_online_store);
static ssize_t zcrypt_queue_load_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct zcrypt_queue *zq = to_ap_queue(dev)->private;
return snprintf(buf, PAGE_SIZE, "%d\n", atomic_read(&zq->load));
}
static DEVICE_ATTR(load, 0444, zcrypt_queue_load_show, NULL);
static struct attribute *zcrypt_queue_attrs[] = { static struct attribute *zcrypt_queue_attrs[] = {
&dev_attr_online.attr, &dev_attr_online.attr,
&dev_attr_load.attr,
NULL, NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment