<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: Arial; font-size: 10pt; color: #000099'><span>Dear Alex / List ,<br><br>I did some changes which i want you to know. I installed ixgbevf on the host and libvirt does<br>attach and detach the VFs from the host and guests. But the connectivity issue is there.<br><br>root@debian-squeeze:~# readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver<br>/sys/bus/pci/drivers/ixgbevf<br>root@debian-squeeze:~# /usr/local/libvirt/bin/virsh  start new-installed<br>Domain new-installed started<br><br>root@debian-squeeze:~# readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver<br>/sys/bus/pci/drivers/pci-stub<br>root@debian-squeeze:~# ping 192.168.101.10<br>PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.<br>From 192.168.100.6 icmp_seq=1 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=2 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=3 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=4 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=5 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=6 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=7 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=8 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=9 Destination Host Unreachable<br>64 bytes from 192.168.101.10: icmp_req=10 ttl=64 time=812 ms<br>64 bytes from 192.168.101.10: icmp_req=11 ttl=64 time=0.351 ms<br>64 bytes from 192.168.101.10: icmp_req=12 ttl=64 time=0.293 ms<br>64 bytes from 192.168.101.10: icmp_req=13 ttl=64 time=0.364 ms<br>^C<br><br>root@debian-squeeze:~# ssh 192.168.101.10<br>root@192.168.101.10's password:<br>root@new-installed:~# halt<br>The system is going down for system halt NOW!s/0) (Tue Aug 21 18:28:27 2012):<br>root@new-installed:~# Connection to 192.168.101.10 closed by remote host.<br>Connection to 192.168.101.10 closed.<br>root@debian-squeeze:~#<br>root@debian-squeeze:~#<br>root@debian-squeeze:~#<br>root@debian-squeeze:~#<br>root@debian-squeeze:~# readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver<br>/sys/bus/pci/drivers/ixgbevf<br>root@debian-squeeze:~# /usr/local/libvirt/bin/virsh  start new-installed<br>Domain new-installed started<br>root@debian-squeeze:~# readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver<br>/sys/bus/pci/drivers/pci-stub<br>root@debian-squeeze:~# ping 192.168.101.10<br>PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.<br>From 192.168.100.6 icmp_seq=1 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=2 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=5 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=6 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=7 Destination Host Unreachable<br>From 192.168.100.6 icmp_seq=8 Destination Host Unreachable<br>^C<br>Never came!<br><br><br>Please suggest if there is any way out.<br>Relevant kernel logs:<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.068511] ixgbevf 0000:04:10.0: enabling device (0000 -> 0002)<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.069216] ixgbevf 0000:04:10.0: enabling bus mastering<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.082458] ixgbevf 0000:04:10.0: irq 127 for MSI/MSI-X<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.082482] ixgbevf 0000:04:10.0: irq 128 for MSI/MSI-X<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.082503] ixgbevf 0000:04:10.0: irq 129 for MSI/MSI-X<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.141706] ixgbe 0000:04:00.0: eth0: Set MAC msg received from VF 0<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.142548] ixgbe 0000:04:00.0: eth0: Set LPE msg received from vf 0<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.150487] IPv6: ADDRCONF(NETDEV_UP): eth2: link is not ready<br>Aug 21 18:28:34 debian-squeeze kernel: [  290.153637] IPv6: ADDRCONF(NETDEV_CHANGE): eth2: link becomes ready<br><br><br>Aug 21 18:28:45 debian-squeeze ntpdate[40135]: step time server 202.190.183.188 offset -0.004582 sec<br>Aug 21 18:28:46 debian-squeeze snmpd[39480]: IfIndex of an interface changed.<br><br><br><br>Aug 21 18:29:39 debian-squeeze kernel: [  355.486987] pci-stub 0000:04:10.0: claimed by stub<br>Aug 21 18:29:39 debian-squeeze kernel: [  355.826741] pci-stub 0000:04:10.0: enabling device (0000 -> 0002)<br>Aug 21 18:29:40 debian-squeeze kernel: [  356.484437] assign device 0:4:10.0<br><br><br>Aug 21 18:29:47 debian-squeeze kernel: [  363.296117] kvm: 40206: cpu0 unhandled rdmsr: 0xc0010001<br><br><br>Aug 21 18:29:55 debian-squeeze kernel: [  371.643998] ixgbe 0000:04:00.0: eth0: Set MAC msg received from VF 0<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.644661] ixgbe 0000:04:00.0: eth0: Set LPE msg received from vf 0<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.663095] pci-stub 0000:04:10.0: irq 127 for MSI/MSI-X<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.694983] pci-stub 0000:04:10.0: irq 127 for MSI/MSI-X<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.695009] pci-stub 0000:04:10.0: irq 128 for MSI/MSI-X<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.758805] pci-stub 0000:04:10.0: irq 127 for MSI/MSI-X<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.758833] pci-stub 0000:04:10.0: irq 128 for MSI/MSI-X<br>Aug 21 18:29:55 debian-squeeze kernel: [  371.758856] pci-stub 0000:04:10.0: irq 129 for MSI/MSI-X<br><br><br><br><br>Regards,<br>Rajesh Kumar Mallah<br>Tel. 91-11-46710500 (Ext:303)<br>Cell +919811255597<br>Website: http://www.tradeindia.com/<br>\|/ \|/ \|/   stop printing   \|/ \|/ \|/<br> |   |   |    start planting   |   |   |<br><br></span><br>----- "Rajesh Kumar Mallah" <mallah@tradeindia.com> wrote:
<br>| From: "Rajesh Kumar Mallah" <mallah@tradeindia.com><br>| To: "Alex Jia" <ajia@redhat.com><br>| Cc: libvirt-users@redhat.com, "vikas pandey" <vikas_pandey@tradeindia.com><br>| Sent: Tuesday, August 21, 2012 11:00:24 AM<br>| Subject: Re: [libvirt-users] automatically detaching PCI host devices from guest for SRIOV usage.<br>|<br>| <style>p { margin: 0; }</style><div style="font-family: Arial; font-size: 10pt; color: #000099">| <span>Dear Alex ,<br>| <br>| Thanks Once again for responding. I tried to replicate your steps. in our case readlink always reveals that the pci device is being <br>| handled by the pci-stub driver (as in our case ixgbevf  is absent in the host)<br>| <br>| Below is an annotaded sequence of events.<br>| <br>| Check status :<br style="background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">/sys/bus/pci/drivers/pci-stub<br>| <br>| <span style="background-color: rgb(255, 255, 255);">Content of the nic.xml:</span><br>| <br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">root@debian-squeeze:/usr/local/libvirt/etc/libvirt/qemu# cat  /root/nic.xml</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">    <hostdev mode='subsystem' type='pci' managed='yes'></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">      <source></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">        <address domain='0x0000' bus='0x04' slot='0x10' function='0x0'/></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">      </source></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">      <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">    </hostdev></span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">/sys/bus/pci/drivers/pci-stub<br>| <br>| <span style="background-color: rgb(255, 255, 255);">corrent connectivity is OK</span><br>| <br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># ping 192.168.101.10</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=1 ttl=64 time=0.491 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=2 ttl=64 time=0.384 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=3 ttl=64 time=0.310 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">^C</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">--- 192.168.101.10 ping statistics ---</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">3 packets transmitted, 3 received, 0% packet loss, time 1998ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">rtt min/avg/max/mdev = 0.310/0.395/0.491/0.074 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">/sys/bus/pci/drivers/pci-stub<br>| <br>| <span style="background-color: rgb(255, 255, 255);">Detach and reattach and check connectivity in running guest.<br>| note: the guest has pci hotplug support , the ethernet interfaces<br>| are configured to allow hotplug and IP is statically assigned.<br>| </span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># virsh detach-device new-installed /root/nic.xml</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Device detached successfully</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">/sys/bus/pci/drivers/pci-stub</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">root@debian-squeeze:/usr/local/libvirt/etc/libvirt/qemu# ping 192.168.101.10</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=9 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=10 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=11 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">^C</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">--- 192.168.101.10 ping statistics ---</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">14 packets transmitted, 0 received, +3 errors, 100% packet loss, time 13096ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">pipe 3</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># virsh attach-device new-installed /root/nic.xml</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Device attached successfully</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># ping 192.168.101.10</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=1 ttl=64 time=0.507 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=2 ttl=64 time=0.388 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=3 ttl=64 time=0.314 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=4 ttl=64 time=0.315 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=5 ttl=64 time=0.335 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">^C</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">--- 192.168.101.10 ping statistics ---</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">5 packets transmitted, 5 received, 0% packet loss, time 3998ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">rtt min/avg/max/mdev = 0.314/0.371/0.507/0.076 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># readlink -f /sys/bus/pci/devices/0000\:04\:10.0/driver</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">/sys/bus/pci/drivers/pci-stub</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br>| Above proves that detach-attach cycle was successful.<br>| <br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);" id="2ce499a3-0ac2-4b2e-9f0b-c4357d301f58"># </span><span id="2ce499a3-0ac2-4b2e-9f0b-c4357d301f58"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">virsh detach-device new-installed /root/nic.xml</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Device detached successfully</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"> <br>| <br>| <span style="background-color: rgb(255, 255, 255);">Please note that guest is being shutdown with nic detached.</span><br>| <br>| <br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"></span><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># virsh shutdown new-installed</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Domain new-installed is being shutdown</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br>| <span style="background-color: rgb(255, 255, 255);">Guest being started again :</span><br>| <br>| # virsh start  new-installed</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Domain new-installed started</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># ping 192.168.101.10</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=1 ttl=64 time=0.583 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=2 ttl=64 time=0.402 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=3 ttl=64 time=0.308 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=4 ttl=64 time=0.316 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=5 ttl=64 time=0.318 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">64 bytes from 192.168.101.10: icmp_req=6 ttl=64 time=0.247 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">^C</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">--- 192.168.101.10 ping statistics ---</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">6 packets transmitted, 6 received, 0% packet loss, time 4997ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">rtt min/avg/max/mdev = 0.247/0.362/0.583/0.109 ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br>| <span style="background-color: rgb(255, 255, 255);">Please note on starting the guest the PCI device came up<br>| and connectivity was established. The device was also defined<br>| inside the guest XML.<br>| </span><br>| <br>| <span style="background-color: rgb(255, 255, 255);">Now shutting down the Guest without detaching.</span><br>| <br>| # virsh shutdown new-installed</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Domain new-installed is being shutdown</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># virsh start  new-installed</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">Domain new-installed started</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><br>| <br>| <br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"># ping 192.168.101.10</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">PING 192.168.101.10 (192.168.101.10) 56(84) bytes of data.</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=9 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=10 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">From 192.168.100.6 icmp_seq=11 Destination Host Unreachable</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">^C</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">--- 192.168.101.10 ping statistics ---</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">14 packets transmitted, 0 received, +3 errors, 100% packet loss, time 13095ms</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);"><span style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 255, 204);">pipe 3</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 204, 255);"><br style="font-family: Courier New,courier,monaco,monospace,sans-serif; background-color: rgb(255, 204, 255);"><span style="background-color: rgb(255, 204, 255);">CONNECTION IS LOST</span><br style="font-family: Courier New,courier,monaco,monospace,sans-serif;"><br>| <br>| We are using latest libvirtd (0.9.13) , lastest ixgbe/ixgbevf (from sf) , lastest stable kernel (3.5.1)<br>| <br>| Regards,<br>| Rajesh Kumar Mallah<br>| Tel. 91-11-46710500 (Ext:303)<br>| Cell +919811255597<br>| Website: http://www.tradeindia.com/<br>| \|/ \|/ \|/   stop printing   \|/ \|/ \|/<br>|  |   |   |    start planting   |   |   |<br>| <br>| </span><br>| ----- "Alex Jia" <ajia@redhat.com> wrote:
<br>| | From: "Alex Jia" <ajia@redhat.com><br>| | To: "Rajesh Kumar Mallah" <mallah@tradeindia.com><br>| | Cc: libvirt-users@redhat.com<br>| | Sent: Tuesday, August 21, 2012 9:34:24 AM<br>| | Subject: Re: [libvirt-users] automatically detaching PCI host devices from guest for SRIOV usage.<br>| |<br>| | 

  
    
  
  
    On 08/21/2012 11:22 AM, Rajesh Kumar Mallah wrote:
    <blockquote cite="mid:6723506.2925041345519327540.JavaMail.root@zmbox01.trade-india-local.com">
      <style>p { margin: 0; }</style>
      <div style="font-family: Arial; font-size: 10pt; color: rgb(0, 0,         153);">| | <br>| | 
        Dear Alex / List  ,<br>| | 
        <br>| | 
        Thanks for the response.<br>| | 
        <br>| | 
        The problem is regarding detaching from the guest not host.<br>| | 
      </div>
    </blockquote>
    <br>| | 
    I see, if you attach a PCI device into guest with 'managed'
    mode(managed='yes') then the device is automatically detached from
    guest and returned to host after guest exiting, for example.<br>| | 
    <br>| | 
    # lspci | grep Eth<br>| | 
    00:19.0 Ethernet controller: Intel Corporation 82566DM-2 Gigabit
    Network Connection (rev 02)<br>| | 
    <br>| | 
    # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f<br>| | 
    /sys/bus/pci/drivers/e1000e<br>| | 
    <br>| | 
    # virsh start foo<br>| | 
    Domain foo started<br>| | 
    <br>| | 
    # ping -c 3 xx.xx.xx.xx<br>| | 
    PING xx.xx.xx.xx (xx.xx.xx.xx) 56(84) bytes of data.<br>| | 
    64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=1 ttl=49
    time=87.8 ms <br>| | 
    64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=2 ttl=49
    time=85.2 ms <br>| | 
    64 bytes from nx-in-f160.1e100.net (xx.xx.xx.xx): icmp_seq=3 ttl=49
    time=91.8 ms<br>| | 
    --- xx.xx.xx.xx ping statistics ---<br>| | 
    3 packets transmitted, 3 received, 0% packet loss, time 2093ms<br>| | 
    rtt min/avg/max/mdev = 85.240/88.327/91.881/2.731 ms<br>| | 
    <br>| | 
    # cat hostdev.xml <br>| | 
    <hostdev mode='subsystem' type='pci' managed='yes'><br>| | 
       <source><br>| | 
          <address domain='0x0000' bus='0x00' slot='0x19'
    function='0x0'/><br>| | 
       </source><br>| | 
    </hostdev><br>| | 
    <br>| | 
    # virsh attach-device foo hostdev.xml <br>| | 
    Device attached successfully<br>| | 
    <br>| | 
    # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f<br>| | 
    /sys/bus/pci/drivers/pci-stub<br>| | 
    <br>| | 
    # ping -c 3 xx.xx.xx.xx<br>| | 
    connect: Network is unreachable<br>| | 
    <br>| | 
    # virsh destroy foo<br>| | 
    Domain foo destroyed<br>| | 
    <br>| | 
    # readlink /sys/bus/pci/devices/0000\:00\:19.0/driver/ -f<br>| | 
    /sys/bus/pci/drivers/e1000e<br>| | 
    <br>| | 
    # ping -c 3 xx.xx.xx.xx<br>| | 
    PING xx.xx.xx.xx (xx.xx.xx.xx) 56(84) bytes of data. <br>| | 
    64 bytes from xx.xx.xx.xx: icmp_seq=1 ttl=49 time=79.7 ms <br>| | 
    64 bytes from xx.xx.xx.xx: icmp_seq=2 ttl=49 time=83.2 ms <br>| | 
    64 bytes from xx.xx.xx.xx: icmp_seq=3 ttl=49 time=84.5 ms <br>| | 
    <br>| | 
    --- xx.xx.xx.xx ping statistics ---<br>| | 
    3 packets transmitted, 3 received, 0% packet loss, time 2087ms<br>| | 
    rtt min/avg/max/mdev = 79.714/82.480/84.513/2.040 ms<br>| | 
    <br>| | 
    Notes, need to wait for local network recovery again then check
    network connectivity.<br>| | 
    <br>| | 
    If your network still is disconnect, it may be a bug IMHO, please
    show your libvirt<br>| | 
    and qemu-kvm version, or my example is not what you want, please let
    me know.<br>| | 
    <br>| | 
    Thanks,<br>| | 
    Alex<br>| | 
    <br>| | 
    <blockquote cite="mid:6723506.2925041345519327540.JavaMail.root@zmbox01.trade-india-local.com">
      <div style="font-family: Arial; font-size: 10pt; color: rgb(0, 0,         153);">| | In our case since ixgbevf driver is NOT present in the
        host hence the virtual <br>| | 
        interfaces never really attach themselves to the host.<br>| | 
        <span><br>| | 
          Regards,<br>| | 
          Rajesh Kumar Mallah<br>| | 
          Tel. 91-11-46710500 (Ext:303)<br>| | 
          Cell +919811255597<br>| | 
          Website: <a class="moz-txt-link-freetext" href="http://www.tradeindia.com/" target="_blank">http://www.tradeindia.com/</a><br>| | 
          \|/ \|/ \|/   stop printing   \|/ \|/ \|/<br>| | 
           |   |   |    start planting   |   |   |<br>| | 
          <br>| | 
        </span><br>| | 
        ----- "Alex Jia" <a class="moz-txt-link-rfc2396E" href="mailto:ajia@redhat.com" target="_blank"><ajia@redhat.com></a> wrote:
        <br>| | 
        | From: "Alex Jia" <a class="moz-txt-link-rfc2396E" href="mailto:ajia@redhat.com" target="_blank"><ajia@redhat.com></a><br>| | 
        | To: "Rajesh Kumar Mallah" <a class="moz-txt-link-rfc2396E" href="mailto:mallah@tradeindia.com" target="_blank"><mallah@tradeindia.com></a><br>| | 
        | Cc: <a class="moz-txt-link-abbreviated" href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a><br>| | 
        | Sent: Tuesday, August 21, 2012 8:31:21 AM<br>| | 
        | Subject: Re: [libvirt-users] automatically detaching PCI host
        devices from guest for SRIOV usage.<br>| | 
        |<br>| | 
        | On 08/20/2012 08:34 PM, Rajesh Kumar Mallah wrote:
        <blockquote cite="mid:25600302.2901631345466078933.JavaMail.root@zmbox01.trade-india-local.com">
          <pre>Dear List ,

We are using intel 82599EB based SRIOV capable 10GbE cards
on the host machine.The VFs are being assigned to the guest 
in pass through mode and are providing the network connectivity 
as expected.

However when we shutdown the guest the connectivity does not
comes back via the VFs on the guest in next boot unless
the VFs are detached from the *guest* *before* initiating a
shutdown of the guests.
</pre>
        </blockquote>
        Dear Rajesh,<br>| | 
        | <br>| | 
        | Please see the following comments.<br>| | 
        | <br>| | 
        |
        <blockquote cite="mid:25600302.2901631345466078933.JavaMail.root@zmbox01.trade-india-local.com">
          <pre>( 
the detach is explicitly done via virsh command 
/usr/local/libvirt/bin/virsh  detach-device guest01   ~/nic.xml
nic.xml contained
<hostdev mode='subsystem' type='pci' managed='yes'>
   <source>
      <address domain='0x0000' bus='0x04' slot='0x10' function='0x0'/>
   </source>
   <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</hostdev>
)

The question is anyone else facing similar problem and
if so what solution was used?

Secondly , is there anyway to automate the detaching of the
VFs from the guest when the guest is put in the shutdown 
sequence ? (or for that matter destroyed).
</pre>
        </blockquote>
        <br>| | 
        | When <b><big><big><code>managed</code></big></big></b> is <b>"yes"</b>
        for a PCI device, it is automatically detached from the host
        before being passed on to the guest, and automatically <b>reattached</b>
        to the host after the <b>guest exits</b> such as shutdown a
        guest.<br>| | 
        | <br>| | 
        | Regards,<br>| | 
        | Alex<br>| | 
        | <br>| | 
        |
        <blockquote cite="mid:25600302.2901631345466078933.JavaMail.root@zmbox01.trade-india-local.com">
          <pre>Regards,
Rajesh Kumar Mallah
Tel. 91-11-46710500 (Ext:303)
Cell +919811255597
Website: <a class="moz-txt-link-freetext" href="http://www.tradeindia.com/" target="_blank">http://www.tradeindia.com/</a>
\|/ \|/ \|/   stop printing   \|/ \|/ \|/
 |   |   |    start planting   |   |   |

_______________________________________________
libvirt-users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:libvirt-users@redhat.com" target="_blank">libvirt-users@redhat.com</a>
<a class="moz-txt-link-freetext" href="https://www.redhat.com/mailman/listinfo/libvirt-users" target="_blank">https://www.redhat.com/mailman/listinfo/libvirt-users</a>
</pre>
        </blockquote>
        <br>| | 
        | </div>
    </blockquote>
    <br>| | 
  

</div></div></body></html>