[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [cdi-devel] [PATCH] e1000: fix RX/TX descriptor alignment.
On Sat, Mar 19, 2011 at 12:21:47PM +1000, Matthew Iselin wrote:
> This patch fixes the e1000 driver in VMware (and potentially some real
> hardware as well) by enforcing a 16-byte alignment for transmit and
> receive descriptors. Without this fix, the card automatically aligns the
> addresses on a 16-byte boundary, causing corruption in several data
> structures.
>
> The specification specifically states "The * Descriptor Base Address must
> point to a 16-byte aligned block of data". VMware appears to be far more
> pedantic than QEMU and VirtualBox when using these buffers.
>
> Signed-off-by: Matthew Iselin <matthew@xxxxxxxxxxxxxx>
Thanks, good catch. Verified this with tyndur against a patched qemu.
> ---
> e1000/device.c | 6 +++---
> e1000/device.h | 4 ++--
> 2 files changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/e1000/device.c b/e1000/device.c
> index 6ce814c..027c3fe 100644
> --- a/e1000/device.c
> +++ b/e1000/device.c
> @@ -277,6 +277,7 @@ static void reset_nic(struct e1000_device* netcard)
> // Rx/Tx-Ring initialisieren
> reg_outl(netcard, REG_RXDESC_ADDR_HI, 0);
> reg_outl(netcard, REG_RXDESC_ADDR_LO, PHYS(netcard, rx_desc[0]));
> + printf("RX descriptors at %x", PHYS(netcard, rx_desc[0]));
Fixed this one to contain "e1000:" and a \n, and applied the patch.
Kevin