Conversation
There's multiple arrays running around that are easy to conflate: * The SQ, a shared ringbuf allocated by the kernel containing indices into a separate SQE array containing RecvMsgMulti SQEs submitted by the user. We submit SQEs that identify socket FDs that we want to read from. The SQ and SQE arrays are hidden by the io-uring crate. * The CQ, a shared ringbuf containing allocated by the kernel CQEs. The CQE flags identify which buffer from the framebuf_ring_ptr contains the result. The CQ array is hidden by the io-uring crate. * The framebuf_ring_ptr array of BufRingEntry descriptors. Each descriptor points to a buffer that the kernel can write the CanFrame, cmsg and recvmsg_out header to. This array must be page-aligned. Each BufRingEntry descriptor *could* point to a unique allocation, but we have a single framebuf_data array that each BufRingEntry descriptor points into. * framebuf_data array actually holds the received CAN frame, plus recvmsg_out header and cmsg It didn't make sense for the framebuf_ring_ptr array to be a different size from the CQE array, because they're one-to-one. The kernel can't write to the framebuf_data without also writing a CQE. However, if we just make them equal sizes, I found that it resulted in lots and lots of frame drops due to DEFER_TASKRUN causing the kernel to not do any work until the next submit_with_args call.
This will allow integration tests in the workspace to run their own crate's binaries.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.