Subject: Re: [PATCH] virtio_net: implements ethtool_ops.get_drvinfo

From: Ben Hutchings <[email-masked]>
Date: Thu, 05 Aug 2010 04:47:21 +0100

On Thu, 2010-08-05 at 13:02 +0930, Rusty Russell wrote:
> I often use "ethtool -i" command to check what driver controls the
> ehternet device.  But because current virtio_net driver doesn't
> support "ethtool -i", it becomes the following:
> 
>         # ethtool -i eth3
>         Cannot get driver information: Operation not supported
> 
> This patch simply adds the "ethtool -i" support. The following is the
> result when using the virtio_net driver with my patch applied to.
> 
>         # ethtool -i eth3
>         driver: virtio_net
>         version: N/A
>         firmware-version: N/A
>         bus-info: virtio0
> 
> Personally, "-i" is one of the most frequently-used option, and most
> network drivers support "ethtool -i", so I think virtio_net also
> should do.
[...]

This information is already available generically through sysfs:
    basename $(readlink /sys/class/net/eth3/device)
    basename $(readlink /sys/class/net/eth3/device/driver)

Given that, we should either recommend that people use that method
instead, or we should add an equivalent default implementation of the
get_drvinfo operation.

Ben.

-- 
Ben Hutchings, Senior Software Engineer, Solarflare Communications
Not speaking for my employer; that's the marketing department's job.
They asked us to note that Solarflare product names are trademarked.