Bug 643292

Summary: [netfront] ethtool -i should return proper information for netfront device
Product: Red Hat Enterprise Linux 5 Reporter: Yufang Zhang <yuzhang>
Component: kernel-xenAssignee: Laszlo Ersek <lersek>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: low    
Version: 5.6CC: ddutile, drjones, leiwang, mshao, qcai, qwan, xen-maint
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 643872 647187 (view as bug list) Environment:
Last Closed: 2011-07-21 10:26:53 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 514490, 647187    
Attachments:
Description Flags
Add get_drvinfo() support to xen netfront driver.
none
Add get_drvinfo() support to xen netfront driver, v2. none

Description Yufang Zhang 2010-10-15 07:49:33 UTC
Description of problem:
Currently, ethtool -i return error for netfront device. Upstream has a patch to figure out this issue. 
http://lists.xensource.com/archives/html/xen-devel/2010-10/msg00416.html
Would you please consider backporting this patch into RHEL5?

Version-Release number of selected component (if applicable):
kernel-xen-2.6.18-194.el5

How reproducible:
Always. 

Steps to Reproduce:
1. In a RHEL5 PV guest, 
# ethtool -i eth0
Cannot get driver information: Operation not supported

2.
3.
  
Actual results:


Expected results:
"ethtool -i" report something useful:
        # ethtool -i eth0
        driver: xen-netfront
        version:
        firmware-version:
        bus-info: vif-0


Additional info:

Comment 1 Andrew Jones 2010-10-15 08:09:21 UTC
Good idea Yufang, thanks for tracking down the upstream patch. Laszlo, please
backport, test, and post this patch.

Drew

Comment 2 Don Dutile (Red Hat) 2010-10-15 15:05:13 UTC
That patch was borked and updated on xen-changelog only.
Here's the patch to the original patch:

# HG changeset patch
# User Keir Fraser <keir>
# Date 1286877800 -3600
# Node ID 7fcbbb8c828503ae31a4a568c68d491dd8e0fe14
# Parent  578f036ec7dd46f2182849dce3757c709bc9883d
netfront: Fix build failure after previous changeset

From: Ian Campbell <Ian.Campbell>
Signed-off-by: Keir Fraser <keir>
Acked-by: Jan Beulich <jbeulich>
---
 drivers/xen/netfront/netfront.c |    2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)

diff -r 578f036ec7dd -r 7fcbbb8c8285 drivers/xen/netfront/netfront.c
--- a/drivers/xen/netfront/netfront.c	Mon Oct 11 10:25:55 2010 +0100
+++ b/drivers/xen/netfront/netfront.c	Tue Oct 12 11:03:20 2010 +0100
@@ -1776,7 +1776,7 @@ static void netfront_get_drvinfo(struct 
 				 struct ethtool_drvinfo *info)
 {
 	strcpy(info->driver, "netfront");
-	strcpy(info->bus_info, dev_name(dev->dev.parent));
+	strcpy(info->bus_info, dev->class_dev.dev->bus_id);
 }
 
 static int network_connect(struct net_device *dev)
for final patch...

Comment 3 Laszlo Ersek 2010-10-18 09:49:52 UTC
Apologies for the late response!

I reproduced the bug in the PV guest:

[root@localhost ~]# uname -r
2.6.18-194.el5xen

[root@localhost ~]# ethtool -i eth0
Cannot get driver information: Operation not supported

First I tried to backport the originally linked-to patch [0] against jwilson/rhel5/kernel (master branch). To build the patched kernel, I took the kernel config file (config-2.6.18-227.el5) from jwilson's most recent build [1], more specifically the x86_64 normal kernel rpm.

As Don pointed out above, the original patch was broken and my build failed. I assumed this was my fault and that the build barfed due to an internals' divergence between jwilson's kernel and the kernel that [0] was submitted against. So I tried to alter the patch. I'm adding an attachment called "netfront-try0.patch" which contains my modified patch.

Testing it (brew output available under [2]):

[root@localhost ~]# uname -r
2.6.18-227.el5.bz643292xen

[root@localhost ~]# ethtool -i eth0
driver: xen-netfront
version: 
firmware-version: 
bus-info: xen

FWIW, I wrote this up here only for the record. I'll go on with porting back the patch as fixed by Don. Until I'm finished, I'll leave this entry as ASSIGNED.

Paolo tells me there's a similar patch for netback too; I plan to clone this bug with his help and backport the netback patch as well.

[0] http://lists.xensource.com/archives/html/xen-devel/2010-10/msg00416.html
[1] https://brewweb.devel.redhat.com/buildinfo?buildID=146165
[2] https://brewweb.devel.redhat.com/taskinfo?taskID=2828555

Comment 4 Laszlo Ersek 2010-10-18 09:52:03 UTC
Created attachment 454064 [details]
Add get_drvinfo() support to xen netfront driver.

Obsolete as posted.

Comment 5 Laszlo Ersek 2010-10-19 08:53:46 UTC
Testing v2 [0] of the patch:

[root@localhost ~]# uname -r
2.6.18-227.el5.bz643292_v2xen

[root@localhost ~]# ethtool -i eth0
driver: netfront
version: 
firmware-version: 
bus-info: vif-0

Will POST patch after devel_ack.

[0] https://brewweb.devel.redhat.com/taskinfo?taskID=2832368

Comment 6 Laszlo Ersek 2010-10-19 13:45:04 UTC
Created attachment 454356 [details]
Add get_drvinfo() support to xen netfront driver, v2.

Comment 8 RHEL Program Management 2011-02-01 16:51:58 UTC
This request was evaluated by Red Hat Product Management for inclusion in a Red
Hat Enterprise Linux maintenance release.  Product Management has requested
further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed
products.  This request is not yet committed for inclusion in an Update
release.

Comment 10 Jarod Wilson 2011-02-09 14:56:28 UTC
in kernel-2.6.18-243.el5
You can download this test kernel (or newer) from http://people.redhat.com/jwilson/el5

Detailed testing feedback is always welcomed.

Comment 13 Qixiang Wan 2011-02-24 06:59:59 UTC
Verified with 2.6.18-243 build:

[root@localhost ~]# uname -a
Linux localhost 2.6.18-243.el5xen #1 SMP Mon Feb 7 18:58:50 EST 2011 i686 athlon i386 GNU/Linux
[root@localhost ~]# ethtool -i eth0
driver: netfront
version: 
firmware-version: 
bus-info: vif-0

Comment 15 errata-xmlrpc 2011-07-21 10:26:53 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHSA-2011-1065.html