diff options
author | Bart Van Assche <bvanassche@acm.org> | 2010-08-03 10:08:45 -0400 |
---|---|---|
committer | Roland Dreier <rolandd@cisco.com> | 2010-08-04 16:02:26 -0400 |
commit | 89de74866b846cc48780fda3de7fd223296aaca9 (patch) | |
tree | bdcaebc89fb60843fb8b881ed4a1dee7e064bc41 /drivers/infiniband | |
parent | c996bb47bb419b7c2f75499e11750142775e5da9 (diff) |
IB/srp: Export req_lim via sysfs
Export req_lim via sysfs for debugging.
Signed-off-by: Bart Van Assche <bart.vanassche@gmail.com>
Acked-by: David Dillow <dave@thedillows.org>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/srp/ib_srp.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c index ffdd2d181f65..7f8f16bad753 100644 --- a/drivers/infiniband/ulp/srp/ib_srp.c +++ b/drivers/infiniband/ulp/srp/ib_srp.c | |||
@@ -1552,6 +1552,18 @@ static ssize_t show_orig_dgid(struct device *dev, | |||
1552 | return sprintf(buf, "%pI6\n", target->orig_dgid); | 1552 | return sprintf(buf, "%pI6\n", target->orig_dgid); |
1553 | } | 1553 | } |
1554 | 1554 | ||
1555 | static ssize_t show_req_lim(struct device *dev, | ||
1556 | struct device_attribute *attr, char *buf) | ||
1557 | { | ||
1558 | struct srp_target_port *target = host_to_target(class_to_shost(dev)); | ||
1559 | |||
1560 | if (target->state == SRP_TARGET_DEAD || | ||
1561 | target->state == SRP_TARGET_REMOVED) | ||
1562 | return -ENODEV; | ||
1563 | |||
1564 | return sprintf(buf, "%d\n", target->req_lim); | ||
1565 | } | ||
1566 | |||
1555 | static ssize_t show_zero_req_lim(struct device *dev, | 1567 | static ssize_t show_zero_req_lim(struct device *dev, |
1556 | struct device_attribute *attr, char *buf) | 1568 | struct device_attribute *attr, char *buf) |
1557 | { | 1569 | { |
@@ -1586,6 +1598,7 @@ static DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); | |||
1586 | static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); | 1598 | static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); |
1587 | static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); | 1599 | static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); |
1588 | static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); | 1600 | static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); |
1601 | static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL); | ||
1589 | static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); | 1602 | static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); |
1590 | static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); | 1603 | static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); |
1591 | static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); | 1604 | static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); |
@@ -1597,6 +1610,7 @@ static struct device_attribute *srp_host_attrs[] = { | |||
1597 | &dev_attr_pkey, | 1610 | &dev_attr_pkey, |
1598 | &dev_attr_dgid, | 1611 | &dev_attr_dgid, |
1599 | &dev_attr_orig_dgid, | 1612 | &dev_attr_orig_dgid, |
1613 | &dev_attr_req_lim, | ||
1600 | &dev_attr_zero_req_lim, | 1614 | &dev_attr_zero_req_lim, |
1601 | &dev_attr_local_ib_port, | 1615 | &dev_attr_local_ib_port, |
1602 | &dev_attr_local_ib_device, | 1616 | &dev_attr_local_ib_device, |