aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/ulp/srp
diff options
context:
space:
mode:
authorBart Van Assche <bvanassche@acm.org>2013-10-26 08:38:12 -0400
committerRoland Dreier <roland@purestorage.com>2013-11-08 17:43:16 -0500
commit848b3082dba4215e886c8a595b61f5b70247b341 (patch)
tree04a5badcdca77f12893c77f2bd0cfd31a29cd3ba /drivers/infiniband/ulp/srp
parenta95cadb9dafef41a755b11680529c2b49e7f59bd (diff)
IB/srp: Export sgid to sysfs
On an initiator system with multiple IB ports it is not yet possible to figure out what the originating port of an SRP connection is. Hence make the source GID available in sysfs. Signed-off-by: Bart Van Assche <bvanassche@acm.org> Acked-by: David Dillow <dillowda@ornl.gov> Signed-off-by: Roland Dreier <roland@purestorage.com>
Diffstat (limited to 'drivers/infiniband/ulp/srp')
-rw-r--r--drivers/infiniband/ulp/srp/ib_srp.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
index ebbe01bdd306..62e1f2a1c522 100644
--- a/drivers/infiniband/ulp/srp/ib_srp.c
+++ b/drivers/infiniband/ulp/srp/ib_srp.c
@@ -1965,6 +1965,14 @@ static ssize_t show_pkey(struct device *dev, struct device_attribute *attr,
1965 return sprintf(buf, "0x%04x\n", be16_to_cpu(target->path.pkey)); 1965 return sprintf(buf, "0x%04x\n", be16_to_cpu(target->path.pkey));
1966} 1966}
1967 1967
1968static ssize_t show_sgid(struct device *dev, struct device_attribute *attr,
1969 char *buf)
1970{
1971 struct srp_target_port *target = host_to_target(class_to_shost(dev));
1972
1973 return sprintf(buf, "%pI6\n", target->path.sgid.raw);
1974}
1975
1968static ssize_t show_dgid(struct device *dev, struct device_attribute *attr, 1976static ssize_t show_dgid(struct device *dev, struct device_attribute *attr,
1969 char *buf) 1977 char *buf)
1970{ 1978{
@@ -2049,6 +2057,7 @@ static DEVICE_ATTR(id_ext, S_IRUGO, show_id_ext, NULL);
2049static DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL); 2057static DEVICE_ATTR(ioc_guid, S_IRUGO, show_ioc_guid, NULL);
2050static DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL); 2058static DEVICE_ATTR(service_id, S_IRUGO, show_service_id, NULL);
2051static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL); 2059static DEVICE_ATTR(pkey, S_IRUGO, show_pkey, NULL);
2060static DEVICE_ATTR(sgid, S_IRUGO, show_sgid, NULL);
2052static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL); 2061static DEVICE_ATTR(dgid, S_IRUGO, show_dgid, NULL);
2053static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL); 2062static DEVICE_ATTR(orig_dgid, S_IRUGO, show_orig_dgid, NULL);
2054static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL); 2063static DEVICE_ATTR(req_lim, S_IRUGO, show_req_lim, NULL);
@@ -2065,6 +2074,7 @@ static struct device_attribute *srp_host_attrs[] = {
2065 &dev_attr_ioc_guid, 2074 &dev_attr_ioc_guid,
2066 &dev_attr_service_id, 2075 &dev_attr_service_id,
2067 &dev_attr_pkey, 2076 &dev_attr_pkey,
2077 &dev_attr_sgid,
2068 &dev_attr_dgid, 2078 &dev_attr_dgid,
2069 &dev_attr_orig_dgid, 2079 &dev_attr_orig_dgid,
2070 &dev_attr_req_lim, 2080 &dev_attr_req_lim,