Hi,
I encounter a problem that the eth can't be up in the VM by using VT-d.
I boot the VM using "virsh create vt_d.xml".
The VM could recongize the NIC which was assigned .then I do in VM as
follows:
#cat /sys/class/net/eth0/operstate
down
#ifconfig eth0 up
#cat /sys/class/net/eth0/operstate
down
#ficonfig eth 10.100.0.5
#cat /sys/class/net/eth0/operstate
down
I look into the qemu log file ,find that :
LC_ALL=C PATH=/usr/local/sbin:/usr/
local/bin:/sbin:/bin:/usr/sbin:/usr/bin HOME=/ QEMU_AUDIO_DRV=none
/usr/bin/kvm -S -M pc-0.12 -enable-kvm -m 512 -smp
1,sockets=1,cores=1,threads=1 -name vt_d_5 -uuid
05f608a3-f64f-2418-a90a-d611982c8336 -nodefaults -chardev
socket,id=monitor,path=/var/lib/libvirt/qemu/vt_d_5.monitor,server,nowait
-mon chardev=monitor,mode=readline -rtc base=utc -boot c -drive
file=/home/qinguan/exp/kvm_vtd/ubuntu_1.img,if=none,id=drive-virtio-disk0,boot=on,format=raw
-device
virtio-blk-pci,bus=pci.0,addr=0x3,drive=drive-virtio-disk0,id=virtio-disk0
-usb -device usb-mouse,id=input0 -vnc 127.0.0.1:0 -vga cirrus -device
pci-assign,host=00:19.0,id=hostdev0,bus=pci.0,addr=0x4 -device
virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x5
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
Perhaps you are assigning a device that shares an IRQ with another device?
Failed to assign irq for "hostdev0": Operation not permitted
maybe the VM can't access to the network because of Failed to assign irg
for "hostdev0"?
in kern.log :
May 1 12:40:07 Optiplex-780 kernel: [ 3172.784803] e1000e 0000:00:19.0: PCI
INT A disabled
May 1 12:40:07 Optiplex-780 kernel: [ 3172.784863] pci-stub 0000:00:19.0:
claimed by stub
May 1 12:40:07 Optiplex-780 kernel: [ 3173.103965] pci-stub 0000:00:19.0:
PCI INT A -> GSI 21 (level, low) -> IRQ 21
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204030] pci-stub 0000:00:19.0:
restoring config space at offset 0x6 (was 0x1, writing 0xece1)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204035] pci-stub 0000:00:19.0:
restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204039] pci-stub 0000:00:19.0:
restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.204045] pci-stub 0000:00:19.0:
restoring config space at offset 0x1 (was 0x100000, writing 0x100103)
May 1 12:40:07 Optiplex-780 kernel: [ 3173.435751] assign device 0:0:19.0
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568526] pci-stub 0000:00:19.0:
restoring config space at offset 0x6 (was 0x1, writing 0xece1)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568532] pci-stub 0000:00:19.0:
restoring config space at offset 0x5 (was 0x0, writing 0xf7ad9000)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568537] pci-stub 0000:00:19.0:
restoring config space at offset 0x4 (was 0x0, writing 0xf7ae0000)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568543] pci-stub 0000:00:19.0:
restoring config space at offset 0x1 (was 0x100000, writing 0x100103)
May 1 12:44:24 Optiplex-780 kernel: [ 3430.568561] pci-stub 0000:00:19.0:
PCI INT A disabled
root@Optiplex-780:/var/log/libvirt/qemu# cat /proc/interrupts
CPU0 CPU1 CPU2 CPU3
0: 97 1 2 1 IO-APIC-edge timer
1: 2 0 0 0 IO-APIC-edge i8042
7: 0 0 0 0 IO-APIC-edge
parport0
8: 1 0 0 0 IO-APIC-edge rtc0
9: 0 0 0 0 IO-APIC-fasteoi acpi
12: 1 2 1 0 IO-APIC-edge i8042
16: 0 0 0 0 IO-APIC-fasteoi
uhci_hcd:usb2
17: 5822 1952 3614 2233 IO-APIC-fasteoi
uhci_hcd:usb4, uhci_hcd:usb7
18: 0 0 0 0 IO-APIC-fasteoi
uhci_hcd:usb8
22: 1 1 1 0 IO-APIC-fasteoi
ehci_hcd:usb1, uhci_hcd:usb5
23: 1461 1299 1153 912 IO-APIC-fasteoi
ehci_hcd:usb3, uhci_hcd:usb6
24: 268579 0 0 0 HPET_MSI-edge hpet2
25: 0 286310 0 0 HPET_MSI-edge hpet3
26: 0 0 210675 0 HPET_MSI-edge hpet4
27: 0 0 0 256688 HPET_MSI-edge hpet5
29: 1 0 0 0 DMAR_MSI-edge dmar1
30: 0 0 0 0 DMAR_MSI-edge dmar0
31: 0 0 0 0 DMAR_MSI-edge dmar2
35: 0 0 0 1 PCI-MSI-edge eth1
36: 1456 916 1323 1657 PCI-MSI-edge
eth1-rx-0
37: 1031 772 1459 895 PCI-MSI-edge
eth1-rx-1
38: 958 965 785 470 PCI-MSI-edge
eth1-rx-2
39: 1319 557 1007 714 PCI-MSI-edge
eth1-rx-3
40: 892 864 417 1134 PCI-MSI-edge
eth1-tx-0
41: 414 749 998 606 PCI-MSI-edge
eth1-tx-1
42: 307 921 375 332 PCI-MSI-edge
eth1-tx-2
43: 966 693 396 502 PCI-MSI-edge
eth1-tx-3
54: 7109 5755 5683 5609 PCI-MSI-edge ahci
55: 74 105 73 84 PCI-MSI-edge
hda_intel
56: 1446 927 1108 870 PCI-MSI-edge i915
NMI: 0 0 0 0 Non-maskable interrupts
LOC: 740 725 703 677 Local timer interrupts
SPU: 0 0 0 0 Spurious interrupts
PMI: 0 0 0 0 Performance monitoring
interrupts
PND: 0 0 0 0 Performance pending work
RES: 665 679 714 547 Rescheduling interrupts
CAL: 5332 408 5619 539 Function call interrupts
TLB: 1880 2843 1788 3202 TLB shootdowns
TRM: 0 0 0 0 Thermal event interrupts
THR: 0 0 0 0 Threshold APIC interrupts
MCE: 0 0 0 0 Machine check exceptions
MCP: 5 5 5 5 Machine check polls
ERR: 3
MIS: 0
root@Optiplex-780:/var/log/libvirt/qemu#
I search the similarly problems that sharing the irg but never find a
answer , and now I have no idea.
How to solve the problem ,can you help me ? thanks.
best regards,
qinguan
vt_d.xml:
<domain type='kvm'>
<name>test</name>
<description>just test using sriov!</description>
<os>
<type>hvm</type>
<boot dev='hd'/>
</os>
<memory>524288</memory>
<currentMemory>524288</
currentMemory>
<on_poweroff>destroy</on_poweroff>
<on_reboot>restart</on_reboot>
<on_crash>restart</on_crash>
<features><pae/><acpi/><apic/></features>
<clock offset='utc'/>
<devices>
<input type='mouse' bus='usb'/>
<disk type='file' device='disk'>
<source file='/home/qinguan/exp/ubuntu_1.img'/>
<target dev='hda' bus='virtio'/>
</disk>
<emulator>/usr/bin/kvm</emulator>
<graphics type='vnc' port='-1'/>
<hostdev mode='subsystem' type='pci' managed='yes'>
<source>
<address bus='0x0' slot='0x19'
function='0x0'/>
</source>
</hostdev>
</devices>
</domain>