fix(ncm): Return invalid NTBs to free list#2950
Conversation
In case we received invalid datagram, we silently fail a the buffer was not returned to empty list -> it was lost. If this happened more than CFG_TUD_NCM_OUT_NTB_N times, we run out of NTBs and all OUT transfers are NACKed. Closes espressif/esp-usb#107
|
@HiFiPhile @rgrr Could you please have a look? |
Seems reasonable to me. My memory is getting darker there, but AFAIR the buffer had been fetched before via recv_get_free_ntb(). And either it should go then into the ready list or back into the free list. What I find a little surprising is, that bad blocks are arriving at that point. Never had that. |
|
Thanks for the confirmation!
I did not investigate why the datagrams are invalid; this is only a hot-fix. During upload throughput test (that is, NCM device is receiving with OUT transfers) I got several invalid datagrams per second... |
|
:
Out of curiosity: what platform did you use for emitting the test datagrams? |
|
As I said, I did not dig too deep; this was my setup When I run speed test at speedtest.net I got this error often |
|
Thanks for fixing it ! |
In case we received invalid datagram, we silently fail and the buffer was not returned to empty list -> it was lost.
If this happened more than CFG_TUD_NCM_OUT_NTB_N times, we run out of NTBs and all OUT transfers are NACKed.
Closes espressif/esp-usb#107