aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2010-08-03 10:08:45 -0400
committerRoland Dreier <rolandd@cisco.com>2010-08-04 16:02:26 -0400
commit89de74866b846cc48780fda3de7fd223296aaca9 (patch)
treebdcaebc89fb60843fb8b881ed4a1dee7e064bc41 /drivers/infiniband
parentc996bb47bb419b7c2f75499e11750142775e5da9 (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.c14
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
1555static 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
1555static ssize_t show_zero_req_lim(struct device *dev, 1567static 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);
1586static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); 1598static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL);
1587static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); 1599static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL);
1588static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); 1600static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL);
1601static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL);
1589static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL); 1602static DEVICE_ATTR(zero_req_lim, S_IRUGO, show_zero_req_lim, NULL);
1590static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL); 1603static DEVICE_ATTR(local_ib_port, S_IRUGO, show_local_ib_port, NULL);
1591static DEVICE_ATTR(local_ib_device, S_IRUGO, show_local_ib_device, NULL); 1604static 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,