[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH arm-devs v1 09/13] net/cadence_gem: Fix rx multi-fra
From: |
Peter Crosthwaite |
Subject: |
[Qemu-devel] [PATCH arm-devs v1 09/13] net/cadence_gem: Fix rx multi-fragment packets |
Date: |
Sun, 1 Dec 2013 23:14:09 -0800 |
Bytes_to_copy was being updated before its final use where it
advances the rx buffer pointer. This was causing total mayhem,
where packet data for any subsequent fragments was being fetched
from the wrong place.
Reported-by: Deepika Dhamija <address@hidden>
Signed-off-by: Peter Crosthwaite <address@hidden>
---
hw/net/cadence_gem.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index c6eb9ab..eb0fa95 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -735,8 +735,8 @@ static ssize_t gem_receive(NetClientState *nc, const
uint8_t *buf, size_t size)
/* Copy packet data to emulated DMA buffer */
cpu_physical_memory_write(rx_desc_get_buffer(s->rx_desc) +
rxbuf_offset,
rxbuf_ptr, MIN(bytes_to_copy, rxbufsize));
- bytes_to_copy -= MIN(bytes_to_copy, rxbufsize);
rxbuf_ptr += MIN(bytes_to_copy, rxbufsize);
+ bytes_to_copy -= MIN(bytes_to_copy, rxbufsize);
/* Update the descriptor. */
if (first_desc) {
--
1.8.4.4
- Re: [Qemu-devel] [PATCH arm-devs v1 05/13] net/cadence_gem: Prefetch rx descriptors ASAP, (continued)
- [Qemu-devel] [PATCH arm-devs v1 06/13] net/cadence_gem: Implement RX descriptor match mode flags, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 07/13] net/cadence_gem: Implement SAR match bit in rx desc, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 08/13] net/cadence_gem: Implement SAR (de)activation, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 09/13] net/cadence_gem: Fix rx multi-fragment packets,
Peter Crosthwaite <=
- [Qemu-devel] [PATCH arm-devs v1 10/13] net/cadence_gem: Fix small packet FCS stripping, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 11/13] net/cadence_gem: Fix register w1c logic, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 12/13] net/cadence_gem: Improve can_receive debug printfery, Peter Crosthwaite, 2013/12/02
- [Qemu-devel] [PATCH arm-devs v1 13/13] net/cadence_gem: Dont rx packets when no rx buffer available, Peter Crosthwaite, 2013/12/02