Message ID | 1577736814-21112-3-git-send-email-haiyangz@microsoft.com |
---|---|
State | Changes Requested |
Delegated to: | David Miller |
Headers | show |
Series | Add vmbus dev_num and enable netvsc async probing | expand |
From: Haiyang Zhang <haiyangz@microsoft.com> Sent: Monday, December 30, 2019 12:14 PM > > It's a number based on the vmbus device offer sequence. Let's use "VMBus" as the capitalization. > Useful for device naming when using Async probing. > > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> > --- > Documentation/ABI/stable/sysfs-bus-vmbus | 8 ++++++++ > drivers/hv/vmbus_drv.c | 13 +++++++++++++ > 2 files changed, 21 insertions(+) > > diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus > b/Documentation/ABI/stable/sysfs-bus-vmbus > index 8e8d167..a42225d 100644 > --- a/Documentation/ABI/stable/sysfs-bus-vmbus > +++ b/Documentation/ABI/stable/sysfs-bus-vmbus > @@ -49,6 +49,14 @@ Contact: Stephen Hemminger <sthemmin@microsoft.com> > Description: This NUMA node to which the VMBUS device is > attached, or -1 if the node is unknown. > > +What: /sys/bus/vmbus/devices/<UUID>/dev_num > +Date: Dec 2019 > +KernelVersion: 5.5 > +Contact: Haiyang Zhang <haiyangz@microsoft.com> > +Description: A number based on the vmbus device offer sequence. The capitalization of "VMBus" is already inconsistent in this file in that we have "VMBus" and "VMBUS" in the text. Let's not introduce another capitalization -- use "VMBus". > + Useful for device naming when using Async probing. > +Users: Debugging tools and userspace drivers > + > What: /sys/bus/vmbus/devices/<UUID>/channels/<N> > Date: September. 2017 > KernelVersion: 4.14 > diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c > index 4ef5a66..fe7aefa 100644 > --- a/drivers/hv/vmbus_drv.c > +++ b/drivers/hv/vmbus_drv.c > @@ -214,6 +214,18 @@ static ssize_t numa_node_show(struct device *dev, > static DEVICE_ATTR_RO(numa_node); > #endif > > +static ssize_t dev_num_show(struct device *dev, > + struct device_attribute *attr, char *buf) > +{ > + struct hv_device *hv_dev = device_to_hv_device(dev); > + > + if (!hv_dev->channel) > + return -ENODEV; > + > + return sprintf(buf, "%d\n", hv_dev->channel->dev_num); > +} > +static DEVICE_ATTR_RO(dev_num); > + > static ssize_t server_monitor_pending_show(struct device *dev, > struct device_attribute *dev_attr, > char *buf) > @@ -598,6 +610,7 @@ static ssize_t driver_override_show(struct device *dev, > #ifdef CONFIG_NUMA > &dev_attr_numa_node.attr, > #endif > + &dev_attr_dev_num.attr, > &dev_attr_server_monitor_pending.attr, > &dev_attr_client_monitor_pending.attr, > &dev_attr_server_monitor_latency.attr, > -- > 1.8.3.1
> -----Original Message----- > From: Michael Kelley <mikelley@microsoft.com> > Sent: Monday, December 30, 2019 8:35 PM > To: Haiyang Zhang <haiyangz@microsoft.com>; sashal@kernel.org; linux- > hyperv@vger.kernel.org; netdev@vger.kernel.org > Cc: Haiyang Zhang <haiyangz@microsoft.com>; KY Srinivasan > <kys@microsoft.com>; Stephen Hemminger <sthemmin@microsoft.com>; > olaf@aepfle.de; vkuznets <vkuznets@redhat.com>; davem@davemloft.net; > linux-kernel@vger.kernel.org > Subject: RE: [PATCH V2,net-next, 2/3] Drivers: hv: vmbus: Add dev_num to sysfs > > From: Haiyang Zhang <haiyangz@microsoft.com> Sent: Monday, December 30, > 2019 12:14 PM > > > > It's a number based on the vmbus device offer sequence. > > Let's use "VMBus" as the capitalization. I will. > > > Useful for device naming when using Async probing. > > > > Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> > > --- > > Documentation/ABI/stable/sysfs-bus-vmbus | 8 ++++++++ > > drivers/hv/vmbus_drv.c | 13 +++++++++++++ > > 2 files changed, 21 insertions(+) > > > > diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus > > b/Documentation/ABI/stable/sysfs-bus-vmbus > > index 8e8d167..a42225d 100644 > > --- a/Documentation/ABI/stable/sysfs-bus-vmbus > > +++ b/Documentation/ABI/stable/sysfs-bus-vmbus > > @@ -49,6 +49,14 @@ Contact: Stephen Hemminger > <sthemmin@microsoft.com> > > Description: This NUMA node to which the VMBUS device is > > attached, or -1 if the node is unknown. > > > > +What: /sys/bus/vmbus/devices/<UUID>/dev_num > > +Date: Dec 2019 > > +KernelVersion: 5.5 > > +Contact: Haiyang Zhang <haiyangz@microsoft.com> > > +Description: A number based on the vmbus device offer sequence. > > The capitalization of "VMBus" is already inconsistent in this file in that > we have "VMBus" and "VMBUS" in the text. Let's not introduce another > capitalization -- use "VMBus". I will use "VMBus". Thanks, - Haiyang
diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus b/Documentation/ABI/stable/sysfs-bus-vmbus index 8e8d167..a42225d 100644 --- a/Documentation/ABI/stable/sysfs-bus-vmbus +++ b/Documentation/ABI/stable/sysfs-bus-vmbus @@ -49,6 +49,14 @@ Contact: Stephen Hemminger <sthemmin@microsoft.com> Description: This NUMA node to which the VMBUS device is attached, or -1 if the node is unknown. +What: /sys/bus/vmbus/devices/<UUID>/dev_num +Date: Dec 2019 +KernelVersion: 5.5 +Contact: Haiyang Zhang <haiyangz@microsoft.com> +Description: A number based on the vmbus device offer sequence. + Useful for device naming when using Async probing. +Users: Debugging tools and userspace drivers + What: /sys/bus/vmbus/devices/<UUID>/channels/<N> Date: September. 2017 KernelVersion: 4.14 diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c index 4ef5a66..fe7aefa 100644 --- a/drivers/hv/vmbus_drv.c +++ b/drivers/hv/vmbus_drv.c @@ -214,6 +214,18 @@ static ssize_t numa_node_show(struct device *dev, static DEVICE_ATTR_RO(numa_node); #endif +static ssize_t dev_num_show(struct device *dev, + struct device_attribute *attr, char *buf) +{ + struct hv_device *hv_dev = device_to_hv_device(dev); + + if (!hv_dev->channel) + return -ENODEV; + + return sprintf(buf, "%d\n", hv_dev->channel->dev_num); +} +static DEVICE_ATTR_RO(dev_num); + static ssize_t server_monitor_pending_show(struct device *dev, struct device_attribute *dev_attr, char *buf) @@ -598,6 +610,7 @@ static ssize_t driver_override_show(struct device *dev, #ifdef CONFIG_NUMA &dev_attr_numa_node.attr, #endif + &dev_attr_dev_num.attr, &dev_attr_server_monitor_pending.attr, &dev_attr_client_monitor_pending.attr, &dev_attr_server_monitor_latency.attr,
It's a number based on the vmbus device offer sequence. Useful for device naming when using Async probing. Signed-off-by: Haiyang Zhang <haiyangz@microsoft.com> --- Documentation/ABI/stable/sysfs-bus-vmbus | 8 ++++++++ drivers/hv/vmbus_drv.c | 13 +++++++++++++ 2 files changed, 21 insertions(+)