qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] Have multiple virtio-net devices, but only one of them rec


From: Ilya Maximets
Subject: [Qemu-devel] Have multiple virtio-net devices, but only one of them receives all traffic
Date: Tue, 2 Oct 2018 19:47:32 +0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

> Hi,
> 
> I'm using QEMU 3.0.0 and Linux kernel 4.15.0 on x86 machines. I'm
> observing pretty weird behavior when I have multiple virtio-net
> devices. My KVM VM has two virtio-net devices (vhost=off) and I'm
> using a Linux bridge in the host. The two devices have different
> MAC/IP addresses.
> 
> When I tried to access the VM using two different IP addresses (e.g
> ping or ssh), I found that only one device in VM gets all incoming
> network traffic while I expected that two devices get traffic for
> their own IP addresses.
> 
> I checked it in the several ways.
> 
> 1) I did ping with two IP addresses from the host/other physical
> machines in the same subnet, and only one device's interrupt count is
> increased.
> 2) I checked the ARP table from the ping sources, and two different IP
> addresses have the same MAC address. In fact, I dumped ARP messages
> using tcpdump, and the VM (or the bridge?) replied with the same MAC
> address for two different IP addresses as attached below.
> 3) I monitored the host bridge (# bridge monitor) and found that only
> one device's MAC address is registered.
> 
> It looks like one device's IP/MAC address is not advertised properly,
> but I'm not really sure. When I turned off the device getting all the
> traffic, then the other device starts getting incoming packets; the
> device's MAC address is registered in the host bridge. The active
> device only gets traffic for its own IP address, of course.
> 
> Here's the tcpdump result. IP 10.10.1.100 and 10.10.1.221 are VM's IP
> addresses. IP 10.10.1.221 is assigned to a device having
> 52:54:00:12:34:58, but the log shows it is advertised as having
> ...:57.

I assume that both devices are in the same subnet. In this case kernel
inside guest confused about to which port packets from this subnet should
go. Look at the routing table (route -n) and you'll see that it uses only
one port for sending packets. You just can't have two interfaces in the
same subnet in Linux/any other OS. There is nothing QEMU specific here.

> 
> 23:24:10.983700 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.10.1.100 tell kvm-dest-link-1, length 46
> 23:24:10.983771 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.10.1.100
> is-at 52:54:00:12:34:57 (oui Unknown), length 28
> 23:24:17.794811 ARP, Ethernet (len 6), IPv4 (len 4), Request who-has
> 10.10.1.211 tell kvm-dest-link-1, length 46
> 23:24:17.794869 ARP, Ethernet (len 6), IPv4 (len 4), Reply 10.10.1.211
> is-at 52:54:00:12:34:57 (oui Unknown), length 28
> 
> I would appreciate any help!
> 
> Thanks,
> Jintack



reply via email to

[Prev in Thread] Current Thread [Next in Thread]