]> git.proxmox.com Git - mirror_edk2.git/commit - OvmfPkg/VirtioNetDxe/SnpInitialize.c
OvmfPkg/VirtioNetDxe: alloc RxBuf using AllocateSharedPages()
authorBrijesh Singh <brijesh.singh@amd.com>
Thu, 14 Sep 2017 21:22:42 +0000 (16:22 -0500)
committerLaszlo Ersek <lersek@redhat.com>
Thu, 14 Sep 2017 21:54:07 +0000 (23:54 +0200)
commit46b11f00ac704ed4a1e3c8c1c3439f914e2dfadc
tree1dd769f7b42341364f9633203764324c3ca52256
parent940baec09c8f4664b34842d13a30ce243d0b7b4b
OvmfPkg/VirtioNetDxe: alloc RxBuf using AllocateSharedPages()

When device is behind the IOMMU, VirtioNetDxe is required to use the
device address in bus master operations. RxBuf is allocated using
AllocatePool() which returns the system physical address.

The patch uses VIRTIO_DEVICE_PROTOCOL.AllocateSharedPages() to allocate
the RxBuf and map with VirtioMapAllBytesInSharedBuffer() so that we can
obtain the device address for RxBuf.

Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jordan Justen <jordan.l.justen@intel.com>
Cc: Tom Lendacky <thomas.lendacky@amd.com>
Cc: Laszlo Ersek <lersek@redhat.com>
Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
Regression-tested-by: Laszlo Ersek <lersek@redhat.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
OvmfPkg/VirtioNetDxe/SnpInitialize.c
OvmfPkg/VirtioNetDxe/SnpReceive.c
OvmfPkg/VirtioNetDxe/SnpSharedHelpers.c
OvmfPkg/VirtioNetDxe/TechNotes.txt
OvmfPkg/VirtioNetDxe/VirtioNet.h