Skip to contentSkip to conversation

linux-2.6.18/netfront: ethtool -i does not return info about xennet driver

PATCH In review Jan Beulich 2 participants 2 messages Oct 11, 2010

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-2.6.18/netfront: ethtool -i does not return info about xennet driver

drivers/xen/netfront/netfront.c +8 -0
@@ -1755,6 +1755,13 @@ static void xennet_set_features(struct n
 		xennet_set_tso(dev, 1);
 }
 
+static void netfront_get_drvinfo(struct net_device *dev,
+				 struct ethtool_drvinfo *info)
+{
+	strcpy(info->driver, "netfront");
+	strcpy(info->bus_info, dev_name(dev->dev.parent));
+}
+
 static int network_connect(struct net_device *dev)
 {
 	struct netfront_info *np = netdev_priv(dev);
@@ -1863,6 +1870,7 @@ static void netif_uninit(struct net_devi
 
 static struct ethtool_ops network_ethtool_ops =
 {
+	.get_drvinfo = netfront_get_drvinfo,
 	.get_tx_csum = ethtool_op_get_tx_csum,
 	.set_tx_csum = ethtool_op_set_tx_csum,
 	.get_sg = ethtool_op_get_sg,

Subject: netfront: ethtool -i does not return info about xennet driver

drivers/xen/netfront/netfront.c +8 -0
@@ -1755,6 +1755,13 @@ static void xennet_set_features(struct n
 		xennet_set_tso(dev, 1);
 }
 
+static void netfront_get_drvinfo(struct net_device *dev,
+				 struct ethtool_drvinfo *info)
+{
+	strcpy(info->driver, "netfront");
+	strcpy(info->bus_info, dev_name(dev->dev.parent));
+}
+
 static int network_connect(struct net_device *dev)
 {
 	struct netfront_info *np = netdev_priv(dev);
@@ -1863,6 +1870,7 @@ static void netif_uninit(struct net_devi
 
 static struct ethtool_ops network_ethtool_ops =
 {
+	.get_drvinfo = netfront_get_drvinfo,
 	.get_tx_csum = ethtool_op_get_tx_csum,
 	.set_tx_csum = ethtool_op_set_tx_csum,
 	.get_sg = ethtool_op_get_sg,

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

Acked-by on v1 1/1
#1 lore raw
Quoted 2 lines · Jan Beulich

Upstream will shortly get this behaviour through a default drvinfo method (01414802054c382072b6cb9a1bdc6e243c74b2d5, queued for 2.6.37, I think). For consistency it would be useful to merge the following into xen.git's 2.6.32 branch as well which seems to have been missed and I forgot to repost.

Ian.

The following changes since commit 5473680bdedb7a62e641970119e6e9381a8d80f4:
Dongxiao Xu (1):
xen/netfront: Fix save/restore after enabled smart poll feature

are available in the git repository at:

git://xenbits.xen.org/people/ianc/linux-2.6.git for-jeremy/netfront

Ian Campbell (1):
xen: netfront: support the ethtool drvinfo hook.

 drivers/net/xen-netfront.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

---

Quoted 1 line

From 9a0429ca56f56d415a8b34a92dfa4e8737baf348 Mon Sep 17 00:00:00 2001

From: Ian Campbell <[email protected]>
Date: Thu, 19 Aug 2010 09:42:22 +0100
Subject: [PATCH] xen: netfront: support the ethtool drvinfo hook.

Causes "ethtool -i" to report something useful:

	# ethtool -i eth0
	driver: xen-netfront
	version:
	firmware-version:
	bus-info: vif-0
Cc Jeremy Fitzhardinge <[email protected]>
---
 drivers/net/xen-netfront.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)
drivers/net/xen-netfront.c +9 -0
index e894dd2..209bd06 100644
@@ -1747,8 +1747,17 @@ static int xennet_set_coalesce(struct net_device *netdev,
 	return 0;
 }
 
+static void xennet_get_drvinfo(struct net_device *dev,
+			       struct ethtool_drvinfo *info)
+{
+	strcpy(info->driver, "xen-netfront");
+	strcpy(info->bus_info, dev_name(dev->dev.parent));
+}
+
 static struct ethtool_ops xennet_ethtool_ops =
 {
+	.get_drvinfo = xennet_get_drvinfo,
+
 	.set_tx_csum = ethtool_op_set_tx_csum,
 	.set_sg = xennet_set_sg,
 	.set_tso = xennet_set_tso,
Signature · 1 line
1.5.6.5