-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Netmap cannot see VLAN tags #259
Comments
Hi, I was able to reproduce this problem using a simpler setup: a QEMU VM with an e1000 emulated NIC, which receives VLAN tagged ethernet frames. After a while I figured out that the e1000 NIC strips the VLAN id from the packet and put it into a field of the RX descriptor. This feature is called RX VLAN offloading and it is basically an hardware acceleration technique. This is why netmap cannot see the VLAN tag in the packet.
|
Hi, I have tried disabling the RX VLAN offloading with the above command (together with the rest of the offloading settings: tx off rx off gso off tso off gro off lro off) and the netmap program still does not capture the original packet with the VLAN header. In this setup I am using 2 VirtualBox VMs (host1 and host2) that are connected together through another VM with netmap and 2 e1000 NICs (kernel 4.10.13). Both host1 and host2 use VLAN 11 on their interfaces, and the "bridge" application forwards the traffic between them. A TCPDUMP capture at host1 shows that the VLAN header is sent (8100 000b):
However, after "bridge" forwards the packet, host2 receives it without the VLAN header (because that is how it was captured):
I have tried ethtool with rxvlan on and off and in both cases the VLAN header is removed. Any ideas how to capture the original packets? Thanks! |
Netmap is completely unaware of VLANs. The behaviour depends only on how you configured the netmap VM. For sure you need to disable vlan offloadings (rx/tx) on both interfaces in the netmap VM. Did you create vlan interfaces in the netmap VM? Which netmap interfaces is the bridge program using? Are you using the native netmap adapter? |
I did not create VLAN interfaces in the netmap VM.
The offload parameters of the interfaces are the following:
By the way, just for testing purposes, if I stop the bridge program and run TCPDUMP on the receiving interface of the netmap system, if seems like with RX VLAN acceleration disabled TCPDUMP does not get the VLAN header (note that I have manually set the MAC addresses at host1 and host2 to prevent ARP messages):
however, with RX VLAN acceleration enabled, TCPDUMP gets the VLAN header:
I do not know if this is the expected behaviour. |
It's not expected. From your description it seems that Virtual Box VLAN emulation is incorrect with rx-vlan disabled, independently of netmap. |
I tried the same setup with real hardware and ixgbe NICs and it works correctly with VLAN offloading disabled, as you indicated (I will try with QEMU sometime to confirm that the problem was the combination of VirtualBox and e1000). |
I hope it's ok to comment here instead of starting an almost similar thread. When using QEMU in combination with Virtio-Net driver then Netmap application only sees VLAN tags when the patched Virtio-Net driver is used. The VM with the Netmap application doesn't have any VLAN subinterfaces configured. And In the meantime I have disabled also all other offloading features as well. Just to make sure. But with the emulated mode the Netmap application still receives the packets with the VLAN tags stripped off. I'm now trying to understand if this is a known limitation of the emulated Netmap mode. Or if it's just a wrong behavior of the Virtio-Net driver. Of course I could stick with the patched Virtio driver but I thought it's worth to explore this in case others have the same problem. |
Hi, The code location where the emulated mode intercepts packets received from the driver is after this point http://elixir.free-electrons.com/linux/latest/source/net/core/dev.c#L4196, where the VLAN tag is stripped if present (and if this was not already done by the hardware, that's why enabling/disabling rx-vlan-offload has no effect), and put in the Good to know that there is this limitation. |
By the way, although I didn't remember about that, I already found this limitation and documented it https://github.com/luigirizzo/netmap/blob/master/LINUX/README#L267-L268. |
Hello,
I am running bridge from netmap apps. If the traffic is untagged there is no problems.
But when the packets is tagged I am receive it on second port without vlan tag.
The test staging is:
Sender -> Netmap bridge -> Receiver
Is it there some solution for resolving of this problem?
Thanks!
The text was updated successfully, but these errors were encountered: