]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
hv_netvsc: report vmbus name in ethtool
authorStephen Hemminger <sthemmin@microsoft.com>
Tue, 23 Aug 2016 19:17:56 +0000 (12:17 -0700)
committerLuis Henriques <luis.henriques@canonical.com>
Fri, 20 Jan 2017 13:04:58 +0000 (13:04 +0000)
BugLink: http://bugs.launchpad.net/bugs/1650059
Make netvsc on vmbus behave more like PCI.

Signed-off-by: Stephen Hemminger <sthemmin@microsoft.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
(cherry picked from commit e3f74b841d482e962b9f5a907eeb25eeeb09aa60)
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
Acked-by: Brad Figg <brad.figg@canonical.com>
Acked-by: Seth Forshee <seth.forshee@canonical.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
drivers/net/hyperv/netvsc_drv.c
include/linux/hyperv.h

index eea3cad812f7a5e8c28077fc6f6eafd1622e6f8b..7b16a6d45c5d1288ccb87d54e3fc63a83739aae9 100644 (file)
@@ -740,8 +740,12 @@ vf_injection_done:
 static void netvsc_get_drvinfo(struct net_device *net,
                               struct ethtool_drvinfo *info)
 {
+       struct net_device_context *net_device_ctx = netdev_priv(net);
+       struct hv_device *dev = net_device_ctx->device_ctx;
+
        strlcpy(info->driver, KBUILD_MODNAME, sizeof(info->driver));
        strlcpy(info->fw_version, "N/A", sizeof(info->fw_version));
+       strlcpy(info->bus_info, vmbus_dev_name(dev), sizeof(info->bus_info));
 }
 
 static void netvsc_get_channels(struct net_device *net,
index a6bc974def8f953b226e1109271712b9818d5425..b01c8c3dd531f698f6fae6f238ec511d758d27be 100644 (file)
@@ -1114,6 +1114,13 @@ int __must_check __vmbus_driver_register(struct hv_driver *hv_driver,
                                         const char *mod_name);
 void vmbus_driver_unregister(struct hv_driver *hv_driver);
 
+static inline const char *vmbus_dev_name(const struct hv_device *device_obj)
+{
+       const struct kobject *kobj = &device_obj->device.kobj;
+
+       return kobj->name;
+}
+
 void vmbus_hvsock_device_unregister(struct vmbus_channel *channel);
 
 int vmbus_allocate_mmio(struct resource **new, struct hv_device *device_obj,