Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1370005

Summary: Fail to get network device info(eth0) in guest with virtio-net-pci/vhostforce
Product: Red Hat Enterprise Linux 7 Reporter: Pei Zhang <pezhang>
Component: qemu-kvm-rhevAssignee: Maxime Coquelin <maxime.coquelin>
Status: CLOSED ERRATA QA Contact: Pei Zhang <pezhang>
Severity: high Docs Contact:
Priority: urgent    
Version: 7.3CC: ailan, chayang, jasowang, juzhang, knoel, marcel, maxime.coquelin, michen, pezhang, tlavigne, virt-maint, xfu
Target Milestone: rcKeywords: Regression
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: qemu-kvm-rhev-2.6.0-26.el7 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-07 21:31:39 UTC Type: Bug
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: 1286492, 1355902, 1358653    

Description Pei Zhang 2016-08-25 03:37:46 UTC
Description of problem:
Boot guest with virtio-net-pci/vhostforce, can not find network device by '# ifconfig -a'

Version-Release number of selected component (if applicable):
Host:
3.10.0-495.rt56.397.el7.x86_64
qemu-kvm-rhev-2.6.0-22.el7.x86_64

Guest:
3.10.0-495.rt56.397.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Run a slirp/vlan in a background process
# /usr/libexec/qemu-kvm -enable-kvm \
-net none \
-net socket,vlan=0,udp=localhost:4444,localaddr=localhost:5555 \
-net user,vlan=0

2. Start qemu with vhost-user as server
# /usr/libexec/qemu-kvm -m 1024 -smp 2 \
-object memory-backend-file,id=mem,size=1024M,mem-path=/dev/hugepages,share=on \
-numa node,memdev=mem -mem-prealloc \
-chardev socket,id=char0,path=/tmp/vubr.sock,server \
-netdev type=vhost-user,id=mynet1,chardev=char0,vhostforce \
-device virtio-net-pci,netdev=mynet1,mac=54:52:00:1a:2c:01 \
/home/pezhang/rhel7.3-1.qcow2 \
-monitor stdio \
-vga std -vnc :10 \
-serial unix:/tmp/socket,server,nowait \

QEMU waiting for connection on: disconnected:unix:/tmp/vubr.sock,server

3. Start vubr as client
# ./vhost-user-bridge  -c

4. Check network in guest, fail to find network device(eth0) by 'ifconfig -a'
# lspci | grep Eth
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device

# lspci -vvv -s 00:03.0
lspci -vvv -s 00:03.0
00:03.0 Ethernet controller: Red Hat, Inc Virtio network device
	Subsystem: Red Hat, Inc Device 0001
	Physical Slot: 3
	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR+ FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0
	Interrupt: pin A routed to IRQ 11
	Region 0: I/O ports at c000 [size=32]
	Region 1: Memory at febd1000 (32-bit, non-prefetchable) [size=4K]
	Region 4: Memory at fe000000 (64-bit, prefetchable) [size=8M]
	Expansion ROM at feb80000 [disabled] [size=256K]
	Capabilities: [98] MSI-X: Enable- Count=3 Masked-
		Vector table: BAR=1 offset=00000000
		PBA: BAR=1 offset=00000800
	Capabilities: [84] Vendor Specific Information: VirtIO: <unknown>
		BAR=0 offset=00000000 size=00000000
	Capabilities: [70] Vendor Specific Information: VirtIO: Notify
		BAR=4 offset=00003000 size=00400000 multiplier=00001000
	Capabilities: [60] Vendor Specific Information: VirtIO: DeviceCfg
		BAR=4 offset=00002000 size=00001000
	Capabilities: [50] Vendor Specific Information: VirtIO: ISR
		BAR=4 offset=00001000 size=00001000
	Capabilities: [40] Vendor Specific Information: VirtIO: CommonCfg
		BAR=4 offset=00000000 size=00001000
	Kernel driver in use: virtio-pci
	Kernel modules: virtio_pci

# ifconfig -a
lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1  (Local Loopback)
        RX packets 88  bytes 8056 (7.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 88  bytes 8056 (7.8 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 00:00:00:00:00:00  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:5b:c7:7a  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

# cat /proc/interrupts | grep virtio
Nothing show

Actual results:
Fail to get network device by 'ifconfig -a'.

Expected results:
Should find the network device(eth0).

Additional info:
1. This is a regression bug.
qemu-kvm-rhev-2.6.0-12.el7.x86_64   work
qemu-kvm-rhev-2.6.0-17.el7.x86_64   work
qemu-kvm-rhev-2.6.0-18.el7.x86_64   work
qemu-kvm-rhev-2.6.0-19.el7.x86_64   doesn't work
qemu-kvm-rhev-2.6.0-22.el7.x86_64   doesn't work

Comment 10 jason wang 2016-09-06 10:28:27 UTC
cc Marcel for more ideas.

Comment 11 Maxime Coquelin 2016-09-09 15:32:13 UTC
Issue reproduced and root cause identified.

From dmesg, we can see virtio's pci modern probe failed without falling back to
legacy probe:
virtio_net virtio0: virtio: device uses modern interface but does not have VIRTIO_F_VERSION_1.

The fix in Qemu consists in only exposing the modern capabilities if VIRTIO_F_VERSION_1 is supported by the backend.
Fix is being reviewed upstream:
https://patchwork.ozlabs.org/patch/668034/
https://patchwork.ozlabs.org/patch/668036/

Regards,
Maxime

Comment 12 Maxime Coquelin 2016-09-10 17:14:46 UTC
Upstream version updated.
Single patch now (applies on Michael's pci branch):
https://patchwork.ozlabs.org/patch/668344/

Comment 13 Miroslav Rezanina 2016-09-20 12:29:54 UTC
Fix included in qemu-kvm-rhev-2.6.0-26.el7

Comment 15 Pei Zhang 2016-09-21 06:24:00 UTC
==Verification==
Versions:
Host:
3.10.0-508.rt56.413.el7.x86_64
qemu-kvm-rhev-2.6.0-26.el7.x86_64

Guest:
3.10.0-508.rt56.413.el7.x86_64

Steps:
1. Run a slirp/vlan in a background process

2. Start qemu with vhost-user as server

3. Start vubr as client

4. Check network in guest, eth0 shows in guest.
# ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 54:52:00:1a:2c:01  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
[...]


So this bug has been fixed well. Thank you.

Comment 16 Pei Zhang 2016-09-21 06:24:39 UTC
Set this bug as 'VERIFIED' as Comment 15.

Comment 18 errata-xmlrpc 2016-11-07 21:31:39 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-2673.html