Useful to identify which network queue is associated with
which vmbus channel.

Signed-off-by: Stephen Hemminger <sthem...@microsoft.com>
---
 drivers/hv/vmbus_drv.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c
index 74e256db7d57..91cba71c0113 100644
--- a/drivers/hv/vmbus_drv.c
+++ b/drivers/hv/vmbus_drv.c
@@ -1255,6 +1255,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,
@@ -1265,6 +1280,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
 };
 
-- 
2.15.1

_______________________________________________
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel

Reply via email to