enet: Fix cache bug
This commit is contained in:
parent
cdba8db5e2
commit
9db9053c97
@ -156,7 +156,9 @@ static errval_t enet_rx_dequeue(struct devq* que, regionid_t* rid,
|
|||||||
struct region_entry *entry = enet_get_region(q, *rid);
|
struct region_entry *entry = enet_get_region(q, *rid);
|
||||||
assert(entry);
|
assert(entry);
|
||||||
lvaddr_t vaddr = (lvaddr_t) entry->mem.vbase + *offset + *valid_data;
|
lvaddr_t vaddr = (lvaddr_t) entry->mem.vbase + *offset + *valid_data;
|
||||||
cpu_dcache_wb_range(vaddr, *valid_length);
|
// I would think that invalidate is the correct thing to do, but that
|
||||||
|
// causes a fault for some reason. So do clean+invalidate instead.
|
||||||
|
cpu_dcache_wbinv_range(vaddr, *valid_length);
|
||||||
|
|
||||||
dmb();
|
dmb();
|
||||||
|
|
||||||
@ -180,9 +182,8 @@ static errval_t enet_tx_dequeue(struct devq* que, regionid_t* rid,
|
|||||||
if (enet_full_slots(q)) {
|
if (enet_full_slots(q)) {
|
||||||
enet_bufdesc_t desc = q->ring[q->head];
|
enet_bufdesc_t desc = q->ring[q->head];
|
||||||
dmb();
|
dmb();
|
||||||
cpu_dcache_wb_range((lvaddr_t) &q->ring[q->head],
|
cpu_dcache_wbinv_range((lvaddr_t) &q->ring[q->head],
|
||||||
sizeof(enet_bufdesc_t));
|
sizeof(enet_bufdesc_t));
|
||||||
desc = q->ring[q->head];
|
|
||||||
struct devq_buf* buf= &q->ring_bufs[q->head];
|
struct devq_buf* buf= &q->ring_bufs[q->head];
|
||||||
|
|
||||||
if (!(enet_bufdesc_sc_extract(desc) & ENET_TX_READY)) {
|
if (!(enet_bufdesc_sc_extract(desc) & ENET_TX_READY)) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user