[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 34/78] dp8393x: Don't clobber packet checksum
From: |
Michael Roth |
Subject: |
[PATCH 34/78] dp8393x: Don't clobber packet checksum |
Date: |
Tue, 16 Jun 2020 09:15:03 -0500 |
From: Finn Thain <fthain@telegraphics.com.au>
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 <fthain@telegraphics.com.au>
Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>
Tested-by: Laurent Vivier <laurent@vivier.eu>
Signed-off-by: Jason Wang <jasowang@redhat.com>
(cherry picked from commit bae112b80c9c42cea21ee7623c283668c3451c2e)
*drop context dep. on 19f70347731
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
hw/net/dp8393x.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index ca8088c839..315b4ad844 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.17.1
- [PATCH 22/78] virtio-net: delete also control queue when TX/RX deleted, (continued)
- [PATCH 22/78] virtio-net: delete also control queue when TX/RX deleted, Michael Roth, 2020/06/16
- [PATCH 23/78] intel_iommu: a fix to vtd_find_as_from_bus_num(), Michael Roth, 2020/06/16
- [PATCH 26/78] qcow2-bitmaps: fix qcow2_can_store_new_dirty_bitmap, Michael Roth, 2020/06/16
- [PATCH 30/78] dp8393x: Have dp8393x_receive() return the packet size, Michael Roth, 2020/06/16
- [PATCH 02/78] block/nbd: fix memory leak in nbd_open(), Michael Roth, 2020/06/16
- [PATCH 29/78] dp8393x: Clean up endianness hacks, Michael Roth, 2020/06/16
- [PATCH 24/78] intel_iommu: add present bit check for pasid table entries, Michael Roth, 2020/06/16
- [PATCH 25/78] vfio/pci: Don't remove irqchip notifier if not registered, Michael Roth, 2020/06/16
- [PATCH 32/78] dp8393x: Clear RRRA command register bit only when appropriate, Michael Roth, 2020/06/16
- [PATCH 31/78] dp8393x: Update LLFA and CRDA registers from rx descriptor, Michael Roth, 2020/06/16
- [PATCH 34/78] dp8393x: Don't clobber packet checksum,
Michael Roth <=
- [PATCH 28/78] dp8393x: Always use 32-bit accesses, Michael Roth, 2020/06/16
- [PATCH 33/78] dp8393x: Implement packet size limit and RBAE interrupt, Michael Roth, 2020/06/16
- [PATCH 35/78] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode, Michael Roth, 2020/06/16
- [PATCH 36/78] dp8393x: Pad frames to word or long word boundary, Michael Roth, 2020/06/16
- [PATCH 37/78] dp8393x: Clear descriptor in_use field to release packet, Michael Roth, 2020/06/16
- [PATCH 38/78] dp8393x: Always update RRA pointers and sequence numbers, Michael Roth, 2020/06/16
- [PATCH 39/78] dp8393x: Don't reset Silicon Revision register, Michael Roth, 2020/06/16
- [PATCH 40/78] dp8393x: Don't stop reception upon RBE interrupt assertion, Michael Roth, 2020/06/16
- [PATCH 03/78] i386: Resolve CPU models to v1 by default, Michael Roth, 2020/06/16
- [PATCH 44/78] qcow2: update_refcount(): Reset old_table_index after qcow2_cache_put(), Michael Roth, 2020/06/16