Hello,
From what I can guess you are dealing with a QEMU-KVM guest that
uses virtio-net device(s) and runs netmap over that device(s).
Then, you connect the guest to the host (gentoo) network stack using a
standard linux bridge: a TAP device is used by QEMU to forward guest
traffic from/to the host network stack.
Is that correct?
Following Luigi's explanations, the virtio-net header is part of the
virtio standard, and its purpose is to carry offloading info
(checksum, TSO) across the guests and host kernels. For instance, your
guest kernel can offload the TCP checksum to the virtio-net device,
which in turn uses the virtio-net header (that requires TAP driver
support) to postpone the checksum to the host kernel. If packets
arrive to a physical NIC that supports checksum offloading (e.g. a
r8169 NIC attached to the same bridge to which the TAP is attached),
you have effectively offloaded the checksum computation from the guest
kernel straight to the physical NIC in the physical host.
If you see the virtio-net header with "pkt-gen -f rx", it means that
you are using netmap in "native" mode, that is you use the specific
virtio netmap adapter to send/receive packets from the (virtual) NIC.
If you used netmap over virtio-net in "emulated" mode you wouldn't see
the virtio-net header, because netmap would be using the standard
driver (slow) datapath under the hood: In the rx datapath, the driver
converts the virtio-net header into skbuffs/mbufs metadata, so you
don't see it.
I don't remember having tried to make QEMU use a TAP with no
virtio-net-header extension, but I see that it is possible to disable
it invoking qemu from command line
$ x86_64-softmmu/qemu-system-x86_64 --help | grep tap
-net tap[,vlan=n][,name=str][,fd=h][,fds=x:y:...:z][,ifname=name][,script=file][,downscript=dfile][,helper=helper][,sndbuf=nbytes][,vnet_hdr=on|off][,vhost=on|off][,vhostfd=h][,vhostfds=x:y:...:z][,vhostforce=on|off][,queues=n]
use vnet_hdr=off to avoid enabling the IFF_VNET_HDR tap flag
-netdev [user|tap|bridge|vde|netmap|vhost-user|socket|hubport],id=str[,option][,option][,...]
where you see that you can specify "vnet_hdr=off" when declaring the
qemu "backend" associated to the virtio-net guest device.
Never tried, but it should work. In the worst case you can recompile
the tap driver without IFF_VNET_HDR extension, so that QEMU does not
find it.
Cheers,
Vincenzo
--
Vincenzo Maffione