public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* Virtio with multiple devices of the same type
@ 2008-02-13  3:32 Will Trives
  2008-02-13  5:17 ` Anthony Liguori
  2008-02-13  7:24 ` Avi Kivity
  0 siblings, 2 replies; 3+ messages in thread
From: Will Trives @ 2008-02-13  3:32 UTC (permalink / raw)
  To: kvm-devel; +Cc: Dor Laor, Avi Kivity

Hello guys,

Bug: A virtual machine/guest can only have one virtio block device and
one virtio network device.

Example command line: 

qemu-system-x86_64 -drive file=disk.qcow2,if=virtio,boot=on -net nic,model=virtio,macaddr=50:18:99:55:4E:43 -net tap -net nic,model=virtio,macaddr=51:17:99:55:4D:43 -net tap 

What will happen is the virtual machine will boot, and slowly grind to a
halt with the two network interfaces not working at all. 

qemu-system-x86_64 -drive file=disk.qcow2,if=virtio,boot=on -drive file=disk2.qcow2,if=virtio

With this one, instead of getting two virtual disks, the kernel hangs on bootup.

qemu-system-x86_64 -drive file=disk.qcow2,if=virtio,boot=on -net nic,model=virtio,macaddr=50:18:99:55:4E:43 -net tap -net nic,model=rtl8139,macaddr=51:17:99:55:4D:43 -net tap

With this one, even though only the first network device is a Virtio one, neither work.

When only using ONE virtio block and ONE virtio net, it works as it's supposed to.


This is observed :

* On a 64 bit host with an Intel Q6600 cpu
* Host is 64 bit, guest 64 bit.
* latest Linux git kernel (which has the new virtio code in it from Rusty) both for host and guest
* the latest KVM userspace (with --with-patched-kernel or by syncing to the latest kvm git tree)
* the behaviour with the network devices is observed regardless of whether the network drive is compiled in or modular.

I was wondering if this is helpful or can be replicated, if not perhaps my guest which is running Archlinux64 is doing something strange.


Regards,

Will Trives




-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
kvm-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kvm-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Virtio with multiple devices of the same type
  2008-02-13  3:32 Virtio with multiple devices of the same type Will Trives
@ 2008-02-13  5:17 ` Anthony Liguori
  2008-02-13  7:24 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Anthony Liguori @ 2008-02-13  5:17 UTC (permalink / raw)
  To: Will Trives; +Cc: kvm-devel, Dor Laor, Avi Kivity

Hi Will,

> Example command line: 
>
> This is observed :
>
> * On a 64 bit host with an Intel Q6600 cpu
> * Host is 64 bit, guest 64 bit.
> * latest Linux git kernel (which has the new virtio code in it from Rusty) both for host and guest
> * the latest KVM userspace (with --with-patched-kernel or by syncing to the latest kvm git tree)
> * the behaviour with the network devices is observed regardless of whether the network drive is compiled in or modular.
>
> I was wondering if this is helpful or can be replicated, if not perhaps my guest which is running Archlinux64 is doing something strange.
>   

Here's what I'm observing:

 * I can create two block devices just fine.
 * There are IRQ routing issues when I try to create 3 block devices, if 
I pass -no-acpi when starting the guest, I can use 24 virtio block 
devices without a problem
 * hw/virtio-net.c needs to be aware of reset to cancel any pending tx 
timers.  I have a patch that fixes this.  I'll send it out tomorrow 
after more testing
 * I can't seem to use more than two virtio_net devices when using -net 
tap.  When using -net user, I can create up to 8 virtio network devices 
(and they seem to work).
 * QEMU has a hard limit of 32 PCI devices.  Right now, we just get a 
SEGV when we exceed this.

So I think our problems are:

 * Something is goofy with ACPI and PCI interrupt routing.  
-no-kvm-irqchip does not help the situation
 * I need to send out a patch to make virtio_net reset aware
 * -net tap is broken for more than 1 network device (at least with virtio)
 * QEMU should allow more than 32 PCI devices.

Please try your tests again with -no-acpi and -net user and let me know 
if that prevents the problem.  Thanks for testing!

Regards,

Anthony Liguori

> Regards,
>
> Will Trives
>
>
>
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> kvm-devel mailing list
> kvm-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/kvm-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Virtio with multiple devices of the same type
  2008-02-13  3:32 Virtio with multiple devices of the same type Will Trives
  2008-02-13  5:17 ` Anthony Liguori
@ 2008-02-13  7:24 ` Avi Kivity
  1 sibling, 0 replies; 3+ messages in thread
From: Avi Kivity @ 2008-02-13  7:24 UTC (permalink / raw)
  To: Will Trives; +Cc: kvm-devel, Dor Laor

Will Trives wrote:
> Hello guys,
>
> Bug: A virtual machine/guest can only have one virtio block device and
> one virtio network device.
>
> Example command line: 
>
> qemu-system-x86_64 -drive file=disk.qcow2,if=virtio,boot=on -net nic,model=virtio,macaddr=50:18:99:55:4E:43 -net tap -net nic,model=virtio,macaddr=51:17:99:55:4D:43 -net tap 
>   

You need to place the two nics on separate qemu vlans:

qemu-system-x86_64 -drive file=disk.qcow2,if=virtio,boot=on -net nic,model=virtio,macaddr=50:18:99:55:4E:43.vlan=0 -net tap,vlan=0 -net nic,model=virtio,macaddr=51:17:99:55:4D:43,vlan=1 -net tap,vlan=1

(a qemu vlan is just a virtual ethernet segment, not 802.3q (or whatever it's called) vlan)). 


Ideally it should work without this, but there's a bug in one of the 
virtio optimizations that prevents it from working correctly.

-- 
Any sufficiently difficult bug is indistinguishable from a feature.


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-02-13  7:24 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-02-13  3:32 Virtio with multiple devices of the same type Will Trives
2008-02-13  5:17 ` Anthony Liguori
2008-02-13  7:24 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox