diff options
author | Gioh Kim <gi-oh.kim@cloud.ionos.com> | 2021-04-07 14:34:42 +0300 |
---|---|---|
committer | Jason Gunthorpe <jgg@nvidia.com> | 2021-04-14 01:44:54 +0300 |
commit | cc85392bcd27f619a77a953e384998ce413f197b (patch) | |
tree | ac91ee2a9839495b915b2fbdf387e94419576087 /drivers/infiniband | |
parent | dc3b66a0ce70ec40fd60884a835b9ef976765914 (diff) | |
download | linux-cc85392bcd27f619a77a953e384998ce413f197b.tar.xz |
RDMA/rtrs-clt: New sysfs attribute to print the latency of each path
It shows the latest latency that the client checked when sending the
heart-beat.
Link: https://lore.kernel.org/r/20210407113444.150961-3-gi-oh.kim@ionos.com
Signed-off-by: Gioh Kim <gi-oh.kim@ionos.com>
Signed-off-by: Jack Wang <jinpu.wang@ionos.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Diffstat (limited to 'drivers/infiniband')
-rw-r--r-- | drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c b/drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c index a5bf12aced24..7d53d18a5004 100644 --- a/drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c +++ b/drivers/infiniband/ulp/rtrs/rtrs-clt-sysfs.c @@ -355,6 +355,21 @@ static ssize_t rtrs_clt_hca_name_show(struct kobject *kobj, static struct kobj_attribute rtrs_clt_hca_name_attr = __ATTR(hca_name, 0444, rtrs_clt_hca_name_show, NULL); +static ssize_t rtrs_clt_cur_latency_show(struct kobject *kobj, + struct kobj_attribute *attr, + char *page) +{ + struct rtrs_clt_sess *sess; + + sess = container_of(kobj, struct rtrs_clt_sess, kobj); + + return sysfs_emit(page, "%lld ns\n", + ktime_to_ns(sess->s.hb_cur_latency)); +} + +static struct kobj_attribute rtrs_clt_cur_latency_attr = + __ATTR(cur_latency, 0444, rtrs_clt_cur_latency_show, NULL); + static ssize_t rtrs_clt_src_addr_show(struct kobject *kobj, struct kobj_attribute *attr, char *page) @@ -398,6 +413,7 @@ static struct attribute *rtrs_clt_sess_attrs[] = { &rtrs_clt_reconnect_attr.attr, &rtrs_clt_disconnect_attr.attr, &rtrs_clt_remove_path_attr.attr, + &rtrs_clt_cur_latency_attr.attr, NULL, }; |