]> git.proxmox.com Git - mirror_edk2.git/commit
OvmfPkg: VirtioNetDxe: adapt virtio-net packet header size to virtio-1.0
authorLaszlo Ersek <lersek@redhat.com>
Sun, 13 Mar 2016 00:51:29 +0000 (01:51 +0100)
committerLaszlo Ersek <lersek@redhat.com>
Wed, 6 Apr 2016 17:21:50 +0000 (19:21 +0200)
commitc6e2d064ab5c34b87c25fa801eadb9f76c15c3ca
treede02acb3e3dd5e5c137cde675be8d5a041112103
parent39c2d339621bf1bdcb31a5501379e76996ed6bf6
OvmfPkg: VirtioNetDxe: adapt virtio-net packet header size to virtio-1.0

In virtio-0.9.5, the size of the virtio-net packet header depends on
whether the VIRTIO_NET_F_MRG_RXBUF feature is negotiated -- the
"num_buffers" field is only appended to the header if the feature is
negotiated.

Since we never negotiate this feature, VirtioNetDxe never allocates room
for the "num_buffers" field.

With virtio-1.0, the "num_buffers" field is always there (although it
doesn't carry useful information without VIRTIO_NET_F_MRG_RXBUF). Adapt
the buffers that depend on the virtio-net header size (otherwise we have
skewed / truncated packets).

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
OvmfPkg/VirtioNetDxe/SnpInitialize.c
OvmfPkg/VirtioNetDxe/VirtioNet.h