Skip to content

UDP buffer management. #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 2, 2016
Merged

UDP buffer management. #19

merged 1 commit into from
May 2, 2016

Conversation

dogmaphobic
Copy link
Collaborator

@dogmaphobic dogmaphobic commented May 2, 2016

This is a first step at handling the high data loss on the UDP link.

The low level UDP stack now properly reports how many bytes were actually written to its TX buffer. Before these changes, there was no indication of buffer overflow and packets would simply go into the bit bucket once the buffers were full. With that information, and the use of much larger FIFO buffers, the data loss has been greatly minimized. Ideally, it would be great if we had access to the TX buffer status before sending any data but this is better than nothing.

For now, when the code notices the buffer is full (after a failed write), it waits a bit and tries again (once) to send the remaining data within that one message. I can't wait around long otherwise we start losing data on the UART link and the existing code can't handle a partially sent MavLink message. It then bails out and stops trying to send the remaining messages until the next loop cycle.

With these changes, I brought the drop count down from around 20% under high stress to less than 1%.

I've put an issue requesting access to the buffer status (esp8266/Arduino#1988).

@dogmaphobic dogmaphobic merged commit 48a7789 into master May 2, 2016
@dogmaphobic dogmaphobic deleted the udpBuffers branch May 2, 2016 15:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant