summaryrefslogtreecommitdiffstats
path: root/drivers/infiniband/hw/hfi1/sysfs.c
diff options
context:
space:
mode:
authorTadeusz Struk <tadeusz.struk@intel.com>2016-09-25 07:44:30 -0700
committerDoug Ledford <dledford@redhat.com>2016-10-02 08:42:18 -0400
commitf191225719c3abd04d12ec59951bc47bdf726d71 (patch)
treef4fd5f0a573c9b0d7b4215449ab7a1d80d1fa014 /drivers/infiniband/hw/hfi1/sysfs.c
parent0cb2aa690c7ef14ad1f544288349abb5434bb75d (diff)
downloadlinux-stable-f191225719c3abd04d12ec59951bc47bdf726d71.tar.gz
linux-stable-f191225719c3abd04d12ec59951bc47bdf726d71.tar.bz2
linux-stable-f191225719c3abd04d12ec59951bc47bdf726d71.zip
IB/hfi1: Add a new VL sysfs attribute for sdma engines
This patch adds a read-only "VL" attribute for the sysfs entry of each sdma engine. It will allow the user to check VL to sdma engine mappings. Reviewed-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Reviewed-by: Sebastian Sanchez <sebastian.sanchez@intel.com> Reviewed-by: Jianxin Xiong <jianxin.xiong@intel.com> Signed-off-by: Tadeusz Struk <tadeusz.struk@intel.com> Signed-off-by: Dennis Dalessandro <dennis.dalessandro@intel.com> Signed-off-by: Doug Ledford <dledford@redhat.com>
Diffstat (limited to 'drivers/infiniband/hw/hfi1/sysfs.c')
-rw-r--r--drivers/infiniband/hw/hfi1/sysfs.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/drivers/infiniband/hw/hfi1/sysfs.c b/drivers/infiniband/hw/hfi1/sysfs.c
index 836eea58e4ff..edba22461a9c 100644
--- a/drivers/infiniband/hw/hfi1/sysfs.c
+++ b/drivers/infiniband/hw/hfi1/sysfs.c
@@ -826,12 +826,25 @@ static ssize_t sde_store_cpu_to_sde_map(struct sdma_engine *sde,
return sdma_set_cpu_to_sde_map(sde, buf, count);
}
+static ssize_t sde_show_vl(struct sdma_engine *sde, char *buf)
+{
+ int vl;
+
+ vl = sdma_engine_get_vl(sde);
+ if (vl < 0)
+ return vl;
+
+ return snprintf(buf, PAGE_SIZE, "%d\n", vl);
+}
+
static SDE_ATTR(cpu_list, S_IWUSR | S_IRUGO,
sde_show_cpu_to_sde_map,
sde_store_cpu_to_sde_map);
+static SDE_ATTR(vl, S_IRUGO, sde_show_vl, NULL);
static struct sde_attribute *sde_attribs[] = {
- &sde_attr_cpu_list
+ &sde_attr_cpu_list,
+ &sde_attr_vl
};
/*