* [PATCH] virtio_net: add more ethtool information
[not found] <20091203063225.926337440@vyatta.com>
@ 2009-12-03 6:32 ` Stephen Hemminger
2009-12-04 0:02 ` Rusty Russell
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2009-12-03 6:32 UTC (permalink / raw)
To: David S. Miller, Rusty Russell, Alex Williamson; +Cc: netdev
[-- Attachment #1: vda-speed.patch --]
[-- Type: text/plain, Size: 1457 bytes --]
It is useful for some tools (as well as bonding, and bridging)
for virtio network interface provide more ethtool information.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/drivers/net/virtio_net.c 2009-12-01 14:24:14.766450584 -0800
+++ b/drivers/net/virtio_net.c 2009-12-01 16:49:18.295535415 -0800
@@ -763,7 +763,36 @@ static void virtnet_vlan_rx_kill_vid(str
dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
}
+static void virtnet_get_drvinfo(struct net_device *dev,
+ struct ethtool_drvinfo *info)
+{
+ struct virtnet_info *vi = netdev_priv(dev);
+
+ strcpy(info->driver, "virtnet");
+ strcpy(info->version, "0.1");
+ strcpy(info->fw_version, "N/A");
+ strcpy(info->bus_info, dev_driver_string(&vi->vdev->dev));
+}
+
+static int virtnet_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
+{
+ cmd->supported = SUPPORTED_1000baseT_Full |
+ SUPPORTED_Autoneg | SUPPORTED_FIBRE;
+ cmd->advertising = ADVERTISED_1000baseT_Full |
+ ADVERTISED_Autoneg | ADVERTISED_FIBRE;
+ cmd->speed = SPEED_1000;
+ cmd->duplex = DUPLEX_FULL;
+ cmd->port = PORT_FIBRE;
+ cmd->phy_address = 0;
+ cmd->transceiver = XCVR_INTERNAL;
+ cmd->autoneg = AUTONEG_ENABLE;
+
+ return 0;
+}
+
static const struct ethtool_ops virtnet_ethtool_ops = {
+ .get_settings = virtnet_get_settings,
+ .get_drvinfo = virtnet_get_drvinfo,
.set_tx_csum = virtnet_set_tx_csum,
.set_sg = ethtool_op_set_sg,
.set_tso = ethtool_op_set_tso,
--
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_net: add more ethtool information
2009-12-03 6:32 ` [PATCH] virtio_net: add more ethtool information Stephen Hemminger
@ 2009-12-04 0:02 ` Rusty Russell
2009-12-04 0:33 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Rusty Russell @ 2009-12-04 0:02 UTC (permalink / raw)
To: Stephen Hemminger; +Cc: David S. Miller, Alex Williamson, netdev
On Thu, 3 Dec 2009 05:02:26 pm Stephen Hemminger wrote:
> It is useful for some tools (as well as bonding, and bridging)
> for virtio network interface provide more ethtool information.
Hi Stephen,
Can't see any harm. Some minor questions below:
>
> Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
>
> --- a/drivers/net/virtio_net.c 2009-12-01 14:24:14.766450584 -0800
> +++ b/drivers/net/virtio_net.c 2009-12-01 16:49:18.295535415 -0800
> @@ -763,7 +763,36 @@ static void virtnet_vlan_rx_kill_vid(str
> dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
> }
>
> +static void virtnet_get_drvinfo(struct net_device *dev,
> + struct ethtool_drvinfo *info)
> +{
> + struct virtnet_info *vi = netdev_priv(dev);
> +
> + strcpy(info->driver, "virtnet");
> + strcpy(info->version, "0.1");
> + strcpy(info->fw_version, "N/A");
> + strcpy(info->bus_info, dev_driver_string(&vi->vdev->dev));
0.1 as a version is weird. If we need a number, "0" seems best.
> + cmd->speed = SPEED_1000;
Why 1000? Because it's commong? How about a SPEED_UNLIMITED?
Thanks,
Rusty.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] virtio_net: add more ethtool information
2009-12-04 0:02 ` Rusty Russell
@ 2009-12-04 0:33 ` Stephen Hemminger
0 siblings, 0 replies; 3+ messages in thread
From: Stephen Hemminger @ 2009-12-04 0:33 UTC (permalink / raw)
To: Rusty Russell; +Cc: David S. Miller, Alex Williamson, netdev
On Fri, 4 Dec 2009 10:32:23 +1030
Rusty Russell <rusty@rustcorp.com.au> wrote:
> On Thu, 3 Dec 2009 05:02:26 pm Stephen Hemminger wrote:
> > It is useful for some tools (as well as bonding, and bridging)
> > for virtio network interface provide more ethtool information.
>
> Hi Stephen,
>
> Can't see any harm. Some minor questions below:
>
> >
> > Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
> >
> > --- a/drivers/net/virtio_net.c 2009-12-01 14:24:14.766450584 -0800
> > +++ b/drivers/net/virtio_net.c 2009-12-01 16:49:18.295535415 -0800
> > @@ -763,7 +763,36 @@ static void virtnet_vlan_rx_kill_vid(str
> > dev_warn(&dev->dev, "Failed to kill VLAN ID %d.\n", vid);
> > }
> >
> > +static void virtnet_get_drvinfo(struct net_device *dev,
> > + struct ethtool_drvinfo *info)
> > +{
> > + struct virtnet_info *vi = netdev_priv(dev);
> > +
> > + strcpy(info->driver, "virtnet");
> > + strcpy(info->version, "0.1");
> > + strcpy(info->fw_version, "N/A");
> > + strcpy(info->bus_info, dev_driver_string(&vi->vdev->dev));
>
> 0.1 as a version is weird. If we need a number, "0" seems best.
>
> > + cmd->speed = SPEED_1000;
>
> Why 1000? Because it's commong? How about a SPEED_UNLIMITED?
>
Well until the performance is improved, that is about what I see!
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-12-04 0:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20091203063225.926337440@vyatta.com>
2009-12-03 6:32 ` [PATCH] virtio_net: add more ethtool information Stephen Hemminger
2009-12-04 0:02 ` Rusty Russell
2009-12-04 0:33 ` Stephen Hemminger
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).