[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 11/23] dp8393x: Clear descriptor in_use field to release packet
From: |
Jason Wang |
Subject: |
[PULL 11/23] dp8393x: Clear descriptor in_use field to release packet |
Date: |
Mon, 2 Mar 2020 15:40:24 +0800 |
From: Finn Thain <address@hidden>
When the SONIC receives a packet into the last available descriptor, it
retains ownership of that descriptor for as long as necessary.
Section 3.4.7 of the datasheet says,
When the system appends more descriptors, the SONIC releases ownership
of the descriptor after writing 0000h to the RXpkt.in_use field.
The packet can now be processed by the host, so raise a PKTRX interrupt,
just like the normal case.
Signed-off-by: Finn Thain <address@hidden>
Tested-by: Laurent Vivier <address@hidden>
Signed-off-by: Jason Wang <address@hidden>
---
hw/net/dp8393x.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/hw/net/dp8393x.c b/hw/net/dp8393x.c
index 22b4d36..08194a4 100644
--- a/hw/net/dp8393x.c
+++ b/hw/net/dp8393x.c
@@ -811,7 +811,17 @@ static ssize_t dp8393x_receive(NetClientState *nc, const
uint8_t * buf,
return -1;
}
/* Link has been updated by host */
+
+ /* Clear in_use */
+ size = sizeof(uint16_t) * width;
+ address = dp8393x_crda(s) + sizeof(uint16_t) * 6 * width;
+ dp8393x_put(s, width, 0, 0);
+ address_space_rw(&s->as, address, MEMTXATTRS_UNSPECIFIED,
+ (uint8_t *)s->data, size, 1);
+
+ /* Move to next descriptor */
s->regs[SONIC_CRDA] = s->regs[SONIC_LLFA];
+ s->regs[SONIC_ISR] |= SONIC_ISR_PKTRX;
}
/* Save current position */
--
2.5.0
- [PULL 02/23] dp8393x: Always use 32-bit accesses, (continued)
- [PULL 02/23] dp8393x: Always use 32-bit accesses, Jason Wang, 2020/03/02
- [PULL 00/23] Net patches, Jason Wang, 2020/03/02
- [PULL 01/23] dp8393x: Mask EOL bit from descriptor addresses, Jason Wang, 2020/03/02
- [PULL 03/23] dp8393x: Clean up endianness hacks, Jason Wang, 2020/03/02
- [PULL 02/23] dp8393x: Always use 32-bit accesses, Jason Wang, 2020/03/02
- [PULL 07/23] dp8393x: Implement packet size limit and RBAE interrupt, Jason Wang, 2020/03/02
- [PULL 04/23] dp8393x: Have dp8393x_receive() return the packet size, Jason Wang, 2020/03/02
- [PULL 05/23] dp8393x: Update LLFA and CRDA registers from rx descriptor, Jason Wang, 2020/03/02
- [PULL 08/23] dp8393x: Don't clobber packet checksum, Jason Wang, 2020/03/02
- [PULL 06/23] dp8393x: Clear RRRA command register bit only when appropriate, Jason Wang, 2020/03/02
- [PULL 11/23] dp8393x: Clear descriptor in_use field to release packet,
Jason Wang <=
- [PULL 10/23] dp8393x: Pad frames to word or long word boundary, Jason Wang, 2020/03/02
- [PULL 13/23] dp8393x: Don't reset Silicon Revision register, Jason Wang, 2020/03/02
- [PULL 16/23] NetRxPkt: Introduce support for additional hash types, Jason Wang, 2020/03/02
- [PULL 18/23] hw: net: cadence_gem: Fix build errors in DB_PRINT(), Jason Wang, 2020/03/02
- [PULL 09/23] dp8393x: Use long-word-aligned RRA pointers in 32-bit mode, Jason Wang, 2020/03/02
- [PULL 15/23] e1000e: Avoid hw_error if legacy mode used, Jason Wang, 2020/03/02
- [PULL 14/23] dp8393x: Don't stop reception upon RBE interrupt assertion, Jason Wang, 2020/03/02
- [PULL 19/23] block/replication.c: Ignore requests after failover, Jason Wang, 2020/03/02
- [PULL 12/23] dp8393x: Always update RRA pointers and sequence numbers, Jason Wang, 2020/03/02
- [PULL 20/23] tests/test-replication.c: Add test for for secondary node continuing replication, Jason Wang, 2020/03/02