diff options
author | Stephen Hemminger <stephen@networkplumber.org> | 2018-01-09 21:29:06 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2018-01-09 21:50:42 +0300 |
commit | f0fa297404c3f8ab90f1d89405a72edaff988825 (patch) | |
tree | a9221a2fbc8bf51b484373bb73d0415fb2a30524 /drivers/hv | |
parent | b4ea81ee4ae807bbaeec22b34f6d790b664e3964 (diff) | |
download | linux-f0fa297404c3f8ab90f1d89405a72edaff988825.tar.xz |
vmbus: add monitor_id and subchannel_id to sysfs per channel
Useful to identify which network queue is associated with
which vmbus channel.
Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/hv')
-rw-r--r-- | drivers/hv/vmbus_drv.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 5f168202755f..bc65c4d79c1f 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -1254,6 +1254,21 @@ static ssize_t channel_events_show(const struct vmbus_channel *channel, char *bu } static VMBUS_CHAN_ATTR(events, S_IRUGO, channel_events_show, NULL); +static ssize_t subchannel_monitor_id_show(const struct vmbus_channel *channel, + char *buf) +{ + return sprintf(buf, "%u\n", channel->offermsg.monitorid); +} +static VMBUS_CHAN_ATTR(monitor_id, S_IRUGO, subchannel_monitor_id_show, NULL); + +static ssize_t subchannel_id_show(const struct vmbus_channel *channel, + char *buf) +{ + return sprintf(buf, "%u\n", + channel->offermsg.offer.sub_channel_index); +} +static VMBUS_CHAN_ATTR_RO(subchannel_id); + static struct attribute *vmbus_chan_attrs[] = { &chan_attr_out_mask.attr, &chan_attr_in_mask.attr, @@ -1264,6 +1279,8 @@ static struct attribute *vmbus_chan_attrs[] = { &chan_attr_latency.attr, &chan_attr_interrupts.attr, &chan_attr_events.attr, + &chan_attr_monitor_id.attr, + &chan_attr_subchannel_id.attr, NULL }; |