etherimx: fix missing barrier for doorbell (thanks sigrid)

the symptom is that ping is apparently skipping
transmits which recover with the next send,
resulting in exactly send-period spikes in
the ping rtt.

It appears that the core seems to reorder writes
to uncached memory, which can result in the doorbell
being written before the descriptor status bits
are written.

put a coherence() barrier before writing doorbell
fixes it.

thanks sigrid for reporting the issue!
This commit is contained in:
cinap_lenrek 2024-07-21 17:35:18 +00:00
parent 3598b7cf36
commit fc859af624

View file

@ -362,6 +362,7 @@ txproc(void *arg)
d->status = BLEN(b) | TD_OWN | TD_R | TD_L | TD_TC;
i++;
}
coherence();
wr(ctlr, ENET_TDAR, TDAR_ACTIVE);
}
}
@ -453,6 +454,7 @@ rxproc(void *arg)
d->status = RD_E;
i++;
}
coherence();
wr(ctlr, ENET_RDAR, RDAR_ACTIVE);
}
}