[En-Nut-Discussion] Realtek driver fix for Tx packet loss

Damian Slee damian at commtech.com.au
Thu Feb 26 10:44:45 CET 2004


Will give more details on the fix tommorrow after some more testing.

Here are my findings after lots of debuging and tracing today;

- I haven't applied the TCP SM fix from yesterday, so I could use the
browser page load fail as a visual indication of the SYN ACK packet
being dropped on Tx from realtek.


I eventually found that when ever I had a html page fail to load, that
an NicInterrupt() was being generated with interrupt status register
(ISR) bit NIC_ISR_RXE (receive error bit) being set.  This corresponded
very very closely to the point in time where the SYN ACK was failing to
be transmitted.

I was also getting the ISR receive error bit set at some other times.
These turned out later to be at the same time other packets where being
dropped.  Some FIN packets, and data packets.

Traced the cause of the receive error through the receive status
register to be DFR bit (0x80) in receive status register.  "Defferring.
Set when a carrier or a collision is detected."  Not sure why it still
happens on a crossover LAN cable PC<->Ethernut.

After a lot more tracing, I found that if I read the receive status
register straight after "Start transmission", the times it failed the
DFR bit was set.  Further to this, the transmit start bit TXP in command
register, gets reset back to 0, indicating "transmission is completed or
aborted".  I tried checking TXP bit on its own, but it seems I had to
read the receive status register first?  Either that or it needs a nop
or two before checking TXP after a start transmission(tomorrow).

I have implemented a retry, which when detecting the above, simply does
a start transmission again, do..while(failed) kinda thing.  Occasionally
it has retried twice.

I have tested this to the point where I get some debug output (RS232)
when the retries occur, and capturing with etherreal.  Where the retries
occur, I am inspecting ethereal for duplicate or missing packets.  Seems
to be No duplicates, and No missing packets.

More tomorrow, damn I'm hungry cause I missed lunch.











More information about the En-Nut-Discussion mailing list