-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
bgpd: use ring buffer for network input #1591
Conversation
Quick 'n easy way to copy the contents of one ringbuf to another. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
* Fix rare failure caused when end pointer is at end of buffer memory and a call to ringbuf_get() is made that reads all of the data in the buffer; start pointer was advanced past end pointer, causing some special handling to be skipped * Fix ringbuf_peek() moving start pointer * Fix use after free * Remove extraneous assignment * Update relevant tests Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
The multithreading code has a comment that reads: "XXX: Heavy abuse of stream API. This needs a ring buffer." This patch makes the relevant code use a ring buffer. Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
lib/ringbuf.c
Outdated
size_t tocopy = MIN(ringbuf_space(to), size); | ||
uint8_t *cbuf = XCALLOC(MTYPE_TMP, tocopy); | ||
tocopy = ringbuf_peek(from, 0, cbuf, tocopy); | ||
XFREE(MTYPE_TMP, cbuf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand, doesn't cbuf get set to NULL here? How does this work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I fixed that in the commit afterwards, look at the final diff not the commit diff
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2246/ This is a comment from an EXPERIMENTAL automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base21 Static Analyzer issues remaining.See details at |
The multithreading code has a comment that reads:
"XXX: Heavy abuse of stream API. This needs a ring buffer."
This patch makes the relevant code use a ring buffer.