Bug 643872 - [netback] ethtool -i should return proper information for netback device
Summary: [netback] ethtool -i should return proper information for netback device
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: kernel-xen
Version: 5.6
Hardware: All
OS: Linux
low
medium
Target Milestone: rc
: ---
Assignee: Laszlo Ersek
QA Contact: Virtualization Bugs
URL:
Whiteboard:
Depends On:
Blocks: 514490
TreeView+ depends on / blocked
 
Reported: 2010-10-18 10:52 UTC by Laszlo Ersek
Modified: 2011-07-21 10:26 UTC (History)
8 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of: 643292
Environment:
Last Closed: 2011-07-21 10:26:59 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
add get_drvinfo() ("ethtool -i") support to xen netback and netloop (3.87 KB, patch)
2010-10-21 16:57 UTC, Laszlo Ersek
no flags Details | Diff


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2011:1065 0 normal SHIPPED_LIVE Important: Red Hat Enterprise Linux 5.7 kernel security and bug fix update 2011-07-21 09:21:37 UTC

Description Laszlo Ersek 2010-10-18 10:52:23 UTC
+++ This bug was initially created as a clone of Bug #643292 +++

Description of problem:
Similarly to the situation described in #643292, "ethtool -i"  returns an error for the netback device. Upstream has a patches to fix the issue [0] [1].

Version-Release number of selected component (if applicable):
2.6.18-226.el5xen

How reproducible:
Always. 

Steps to Reproduce:
1. In a RHEL5 xen dom0,

# ethtool -i vif2.0
Cannot get driver information: Operation not supported


Expected results (adapted from clone source):
"ethtool -i" report something useful:
        # ethtool -i eth0
        driver: xen-netback
        version:
        firmware-version:
        bus-info: vif-2

[0] http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/db9857bb0320
[1] http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/3aa9b8a7876b

Comment 1 Laszlo Ersek 2010-10-21 10:09:16 UTC
Upstream changeset 793 (linked under [1] in the previous entry) adds SET_NETDEV_DEV() to backend_create_netif() at a too late place. backend_create_netif() calls netif_alloc() before that. netif_alloc() puts get_drvinfo() in place first, then registers the netdev, which results in a callback from the cnic driver (if loaded) to get_drvinfo(). The latter tries to dereference a null pointer that would only be initialized later by SET_NETDEV_DEV().

Oct 20 17:09:50 lacos-workstation kernel: WARNING: at drivers/xen/netback/interface.c:121 get_drvinfo()
Oct 20 17:09:50 lacos-workstation kernel: 
Oct 20 17:09:50 lacos-workstation kernel: Call Trace:
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8888ccf1>] :netbk:get_drvinfo+0x3b/0x6c
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff885abda8>] :cnic:cnic_netdev_event+0x7c/0x53e
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff802d2c9a>] kmem_cache_zalloc+0x62/0x80
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff80268121>] notifier_call_chain+0x20/0x32
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8042422b>] register_netdevice+0x273/0x27a
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8888cebd>] :netbk:netif_alloc+0x16b/0x18f
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8888c409>] :netbk:backend_create_netif+0x52/0xb0
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8888ca97>] :netbk:netback_probe+0x11b/0x180
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803be1a7>] read_otherend_details+0x6d/0x9e
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803be761>] xenbus_dev_probe+0x5d/0xbc
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803b0fa8>] driver_probe_device+0x52/0xaa
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803b1000>] __device_attach+0x0/0x5
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803b0753>] bus_for_each_drv+0x40/0x72
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803b1057>] device_attach+0x52/0x5f
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803b045a>] bus_attach_device+0x1a/0x35
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803af71a>] device_add+0x261/0x372
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bd879>] xenbus_probe_node+0x11e/0x182
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8029de02>] keventd_create_kthread+0x0/0xc4
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bdf8b>] dev_changed+0x154/0x170
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bbadc>] xenbus_read_driver_state+0x26/0x3b
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff802648f1>] _spin_lock_irqsave+0x9/0x14
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bd3cd>] xenwatch_thread+0x0/0x148
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bc80f>] xenwatch_handle_callback+0x15/0x48
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff803bd4fc>] xenwatch_thread+0x12f/0x148
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8029e01a>] autoremove_wake_function+0x0/0x2e
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8029de02>] keventd_create_kthread+0x0/0xc4
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff80233c76>] kthread+0xfe/0x132
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff80260b2c>] child_rip+0xa/0x12
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff8029de02>] keventd_create_kthread+0x0/0xc4
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff80233b78>] kthread+0x0/0x132
Oct 20 17:09:50 lacos-workstation kernel:  [<ffffffff80260b22>] child_rip+0x0/0x12

Paolo located the upstream patch that fixes this:

http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/820

(Added this note so all related upstream changesets are linked to by the BZ.)

Comment 2 Laszlo Ersek 2010-10-21 16:57:34 UTC
Created attachment 454893 [details]
add get_drvinfo() ("ethtool -i") support to xen netback and netloop

Brew:
  https://brewweb.devel.redhat.com/taskinfo?taskID=2842446

The patch backports the get_drvinfo() ("ethtool -i") parts of upstream changesets 792, 793 and 820.

  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/792
  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/793
  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/820

It furthermore adds "original code" to netloop for the same purpose. This part is being sent back to upstream.

Test output:

  # uname -r
  2.6.18-228.el5.bz643872_v4_xen

  # ethtool -i vif1.0
  driver: netbk
  version: 
  firmware-version: 
  bus-info: vif-1-0

  # ethtool -i vif0.3
  driver: netloop
  version: 
  firmware-version: 
  bus-info: vif-0-3

  # ethtool -i veth3
  driver: netloop
  version: 
  firmware-version: 
  bus-info: vif-0-3

Comment 3 Laszlo Ersek 2010-11-01 10:34:31 UTC
Upstream accepted netloop change:

  http://xenbits.xensource.com/linux-2.6.18-xen.hg?rev/1044

Comment 4 RHEL Program Management 2011-02-01 16:51:46 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 7 Jarod Wilson 2011-02-09 14:56:33 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 9 Qixiang Wan 2011-02-24 07:23:08 UTC
Verified with 2.6.18-243.el5xen build:
[root@localhost ~]# uname -r
2.6.18-243.el5xen
[root@localhost ~]# ethtool -i vif0.0
driver: netloop
version: 
firmware-version: 
bus-info: vif-0-0
[root@localhost ~]# ethtool -i vif0.3
driver: netloop
version: 
firmware-version: 
bus-info: vif-0-3
[root@localhost ~]# ethtool -i veth3
driver: netloop
version: 
firmware-version: 
[root@localhost ~]# ethtool -i vif26.0
driver: netbk
version: 
firmware-version: 
bus-info: vif-26-0

Comment 11 errata-xmlrpc 2011-07-21 10:26:59 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


Note You need to log in before you can comment on or make changes to this bug.