All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel]  Have multiple virtio-net devices, but only one of them receives all traffic
       [not found] <CGME20181002164516eucas1p146cf7b26519eba34b629625fa60efc16@eucas1p1.samsung.com>
@ 2018-10-02 16:47 ` Ilya Maximets
  0 siblings, 0 replies; 2+ messages in thread
From: Ilya Maximets @ 2018-10-02 16:47 UTC (permalink / raw)
  To: jintack

> 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

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

* [Qemu-devel] Have multiple virtio-net devices, but only one of them receives all traffic
@ 2018-10-02  4:34 Jintack Lim
  0 siblings, 0 replies; 2+ messages in thread
From: Jintack Lim @ 2018-10-02  4:34 UTC (permalink / raw)
  To: QEMU Devel Mailing List, virtio-dev

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.

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

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

end of thread, other threads:[~2018-10-02 16:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20181002164516eucas1p146cf7b26519eba34b629625fa60efc16@eucas1p1.samsung.com>
2018-10-02 16:47 ` [Qemu-devel] Have multiple virtio-net devices, but only one of them receives all traffic Ilya Maximets
2018-10-02  4:34 Jintack Lim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.