diff options
author | Laszlo Ersek <lersek@redhat.com> | 2016-03-13 01:51:29 +0100 |
---|---|---|
committer | Laszlo Ersek <lersek@redhat.com> | 2016-04-06 19:21:50 +0200 |
commit | c6e2d064ab5c34b87c25fa801eadb9f76c15c3ca (patch) | |
tree | de02acb3e3dd5e5c137cde675be8d5a041112103 /OvmfPkg/VirtioNetDxe/VirtioNet.h | |
parent | 39c2d339621bf1bdcb31a5501379e76996ed6bf6 (diff) | |
download | edk2-c6e2d064ab5c34b87c25fa801eadb9f76c15c3ca.tar.gz edk2-c6e2d064ab5c34b87c25fa801eadb9f76c15c3ca.tar.bz2 edk2-c6e2d064ab5c34b87c25fa801eadb9f76c15c3ca.zip |
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>
Diffstat (limited to 'OvmfPkg/VirtioNetDxe/VirtioNet.h')
-rw-r--r-- | OvmfPkg/VirtioNetDxe/VirtioNet.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/VirtioNetDxe/VirtioNet.h b/OvmfPkg/VirtioNetDxe/VirtioNet.h index 2d3f3d87eb..710859bc61 100644 --- a/OvmfPkg/VirtioNetDxe/VirtioNet.h +++ b/OvmfPkg/VirtioNetDxe/VirtioNet.h @@ -89,7 +89,7 @@ typedef struct { UINT16 TxMaxPending; // VirtioNetInitTx
UINT16 TxCurPending; // VirtioNetInitTx
UINT16 *TxFreeStack; // VirtioNetInitTx
- VIRTIO_NET_REQ TxSharedReq; // VirtioNetInitTx
+ VIRTIO_1_0_NET_REQ TxSharedReq; // VirtioNetInitTx
UINT16 TxLastUsed; // VirtioNetInitTx
} VNET_DEV;
|