Skip to content
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

[catnip] Prepend Headers into DPDK MBufs when Possible and Appropriate #321

Open
BrianZill opened this issue Nov 10, 2022 · 0 comments · May be fixed by #1179
Open

[catnip] Prepend Headers into DPDK MBufs when Possible and Appropriate #321

BrianZill opened this issue Nov 10, 2022 · 0 comments · May be fixed by #1179
Labels
enhancement Enhancement Request on an Existing Feature

Comments

@BrianZill
Copy link
Contributor

In the current Catnip LibOs, once we've decided to send a packet, we always allocate a new DPDK MBuf to hold the headers. Then depending upon the size of the data in the body, and whether the body data is already contained in an MBuf or is in a heap-allocated buffer, we (a) copy the body data into the same MBuf as the headers, (b) use the existing body MBuf as is, or (c) allocate a new MBuf to hold the body data (this latter case is only if we have a heap-allocated body buffer to start with). The decision between (a) and (b) generally comes down to whether it is quicker to copy the data versus directing the NIC's DMA engine to pull from two regions instead of one. For a small enough amount of data, the copy can actually be quicker (cache considerations may also come into play).

We're missing another option that could potentially be even faster. If we have a body MBuf (i.e., DPDK-allocated) to send, and there is "headroom" in that MBuf to hold the packet headers, we could just prepend the headers into the empty space before the body data in the MBuf and send it. This option would require no MBuf allocations and require the NIC's DMA engine to pull from just a single region. It's a win/win.

Note that DPDK already supports the option to allocate MBufs that contain a configurable amount of "headroom" (which is extra empty space in the MBuf that comes before the region given to the user to write their data into).

@BrianZill BrianZill added the enhancement Enhancement Request on an Existing Feature label Nov 10, 2022
@ppenna ppenna added this to the Demikernel v1.6 milestone Apr 5, 2023
@carvalhof carvalhof linked a pull request Mar 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Enhancement Request on an Existing Feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants