worproject / Rockchip-Windows-Drivers

Windows on Arm drivers for RK35xx platforms.
123 stars 15 forks source link

dwc_eqos - network driver memory ordering issues in transmit path #23

Closed idigdoug closed 9 months ago

idigdoug commented 9 months ago

Not sure if this is a bug or just a hardware limitation. Might be worth further investigation.

In txqueue.cpp, the TxQueueAdvance function does the following:

Very frequently (according to the TxOwnDescriptors performance counter), the TxQueueAdvance function encouters a descriptor that is still marked as owned-by-adapter. This is not supposed to happen -- the adapter is supposed to mark the descriptor as owned-by-driver before it updates the Current_App_TxDesc register, and the descriptor is in uncached memory. So one of the following is true:

The driver has code to handle this condition, so I don't think this is causing corruption. There might be a scenario where this could lead to a hang, but I haven't seen that happen. I suspect that at present this is just a minor performance issue. If it's due to the hardware then it's probably fine, but if it's due to a bug in the driver it would be nice to track it down and fix it.

idigdoug commented 9 months ago

After further investigation, I don't think this is a real issue. Other drivers that I looked at just use the owned-by-adapter bit and ignore the Current_App_TxDesc register, so that's why they don't see this issue. I don't think any action is necessary.