[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v4 08/14] dp8393x: Don't clobber packet checksum
From: |
Finn Thain |
Subject: |
[PATCH v4 08/14] dp8393x: Don't clobber packet checksum |
Date: |
Wed, 29 Jan 2020 20:27:49 +1100 |
A received packet consumes pkt_size bytes in the buffer and the frame
checksum that's appended to it consumes another 4 bytes. The Receive
Buffer Address register takes the former quantity into account but
not the latter. So the next packet written to the buffer overwrites
the frame checksum. Fix this.
Signed-off-by: Finn Thain <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
---
hw/net/dp8393x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 0309365fda..947ceef37c 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -816,6 +816,7 @@ static ssize_t dp8393x_receive(NetClientState *nc, const
uint8_t * buf,
address += rx_len;
address_space_rw(&s->as, address,
MEMTXATTRS_UNSPECIFIED, (uint8_t *)&checksum, 4, 1);
+ address += 4;
rx_len += 4;
s->regs[SONIC_CRBA1] = address >> 16;
s->regs[SONIC_CRBA0] = address & 0xffff;
--
2.24.1
- [PATCH v4 00/14] Fixes for DP8393X SONIC device emulation, Finn Thain, 2020/01/29
- [PATCH v4 08/14] dp8393x: Don't clobber packet checksum,
Finn Thain <=
- [PATCH v4 06/14] dp8393x: Clear RRRA command register bit only when appropriate, Finn Thain, 2020/01/29
- [PATCH v4 04/14] dp8393x: Have dp8393x_receive() return the packet size, Finn Thain, 2020/01/29
- [PATCH v4 10/14] dp8393x: Pad frames to word or long word boundary, Finn Thain, 2020/01/29
- [PATCH v4 09/14] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode, Finn Thain, 2020/01/29
- [PATCH v4 02/14] dp8393x: Always use 32-bit accesses, Finn Thain, 2020/01/29
- [PATCH v4 14/14] dp8393x: Don't stop reception upon RBE interrupt assertion, Finn Thain, 2020/01/29
- [PATCH v4 05/14] dp8393x: Update LLFA and CRDA registers from rx descriptor, Finn Thain, 2020/01/29
- [PATCH v4 07/14] dp8393x: Implement packet size limit and RBAE interrupt, Finn Thain, 2020/01/29
- [PATCH v4 11/14] dp8393x: Clear descriptor in_use field to release packet, Finn Thain, 2020/01/29