e1000e: Don't zero out buffer address in rx descriptor
commitc89d416a2b0fb6a21224186b10af4c4a3feee31b
authorKevin Wolf <mail@kevin-wolf.de>
Sun, 16 Oct 2016 22:35:07 +0000 (17 00:35 +0200)
committerJason Wang <jasowang@redhat.com>
Wed, 26 Oct 2016 01:57:59 +0000 (26 09:57 +0800)
treee4d0aa11bf9e32a0a6cb2192f7d35d7501fd9eed
parent8caed3d564672e8bc6d2e4c6a35228afd01f4723
e1000e: Don't zero out buffer address in rx descriptor

The e1000e emulation zeroes out any used rx descriptor and then writes a
completely newly constructed value there. By doing this, it doesn't only
update the write-back area of the descriptors (as it's supposed to do),
but it also clears the buffer address, which real hardware doesn't do.

The spec explicitly mentions in chapter 7.1.8 that it is valid for a
driver to reuse a descriptor and only update the status field while
doing so, i.e. reusing the old buffer address:

    If software statically allocates buffers, and uses memory read to
    check for completed descriptors, it simply has to zero the status
    byte in the descriptor to make it ready for reuse by hardware.

This patch fixes the behaviour to leave the buffer address in
descriptors unchanged even after the descriptor has been used.

Signed-off-by: Kevin Wolf <mail@kevin-wolf.de>
Reviewed-by: Dmitry Fleytman <dmitry@daynix.com>
Signed-off-by: Jason Wang <jasowang@redhat.com>
hw/net/e1000e_core.c