[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 01/25] net: cadence_gem: Fix Tx descriptor update
From: |
Michael Tokarev |
Subject: |
[Qemu-devel] [PULL 01/25] net: cadence_gem: Fix Tx descriptor update |
Date: |
Tue, 10 Jun 2014 20:08:19 +0400 |
From: Peter Crosthwaite <address@hidden>
The local variable "desc" was being used to read-modify-write the
first descriptor (of a multi-desc packet) upon packet completion.
desc however continues to be used by the code as the current
descriptor. Give this first desc RMW it's own local variable to
avoid trampling.
Signed-off-by: Peter Crosthwaite <address@hidden>
Signed-off-by: Michael Tokarev <address@hidden>
---
hw/net/cadence_gem.c | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/hw/net/cadence_gem.c b/hw/net/cadence_gem.c
index a26861e..5335db8 100644
--- a/hw/net/cadence_gem.c
+++ b/hw/net/cadence_gem.c
@@ -911,14 +911,16 @@ static void gem_transmit(GemState *s)
/* Last descriptor for this packet; hand the whole thing off */
if (tx_desc_get_last(desc)) {
+ unsigned desc_first[2];
+
/* Modify the 1st descriptor of this packet to be owned by
* the processor.
*/
- cpu_physical_memory_read(s->tx_desc_addr,
- (uint8_t *)&desc[0], sizeof(desc));
- tx_desc_set_used(desc);
- cpu_physical_memory_write(s->tx_desc_addr,
- (uint8_t *)&desc[0], sizeof(desc));
+ cpu_physical_memory_read(s->tx_desc_addr, (uint8_t *)desc_first,
+ sizeof(desc_first));
+ tx_desc_set_used(desc_first);
+ cpu_physical_memory_write(s->tx_desc_addr, (uint8_t *)desc_first,
+ sizeof(desc_first));
/* Advance the hardare current descriptor past this packet */
if (tx_desc_get_wrap(desc)) {
s->tx_desc_addr = s->regs[GEM_TXQBASE];
--
1.7.10.4
- [Qemu-devel] [PULL 05/25] qtest: fix hex2nib for capital characters, (continued)
- [Qemu-devel] [PULL 05/25] qtest: fix hex2nib for capital characters, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 04/25] net: cadence_gem: Remove &desc[0] usages, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 10/25] hw/dma/xilinx_axidma: Remove unused stream_halted() function, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 19/25] smbios: use g_free directly on NULL pointers, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 22/25] libcacard: Clean up dead stores before g_free(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 23/25] migration: Plug memory leak in migrate-set-cache-size command, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 21/25] libcacard: Drop superfluous conditionals around g_free(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 17/25] apb: Fix compiler warnings (large constants), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 14/25] hw/misc/milkymist-softusb: Remove unused softusb_{read, write}_pmem(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 24/25] hw: vmware_vga: don't return cursorx when the driver asks for cursory register, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 01/25] net: cadence_gem: Fix Tx descriptor update,
Michael Tokarev <=
- [Qemu-devel] [PULL 12/25] hw/isa/pc87312: Remove unused function is_parallel_epp(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 03/25] net: cadence_gem: Comment spelling sweep, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 18/25] vdi: remove double conversion, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 11/25] hw/intc/openpic: Remove unused function IRQ_testbit(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 13/25] target-i386/translate.c: Remove unused tcg_gen_lshift(), Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 16/25] hw/net/ne2000-isa: Register vmstate struct, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 07/25] hw/i386/pc.c: Remove unused parallel_io and parallel_irq variables, Michael Tokarev, 2014/06/10
- [Qemu-devel] [PULL 25/25] virtio.c: fix error message, Michael Tokarev, 2014/06/10
- Re: [Qemu-devel] [PULL 00/25] Trivial patches for 2014-06-10, Peter Maydell, 2014/06/10
- [Qemu-devel] [PULL 09/25] util/qemu-sockets.c: Avoid unused variable warnings, Michael Tokarev, 2014/06/10