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

Maintain a pool of RX->TX NBLs instead of using NDIS #140

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

mtfriesen
Copy link
Contributor

@mtfriesen mtfriesen commented Jan 27, 2023

The NDIS routines that allocate and free NBLs are not very efficient for our use case: most importantly they do not support batching, and they are also just complex.

Instead, use a per-RX-queue list (which can pop a single NBL without any synchronization) and a per-RX-queue s-list (which can push/pop a batch of NBLs in a single interlocked operation) to minimize forwarding overhead.

Increases XDPMP throughput to 350Gbps from 230Gbps on a 4-CPU test machine with 1514-byte frames.

@mtfriesen mtfriesen requested a review from a team as a code owner January 27, 2023 20:37
@mtfriesen mtfriesen enabled auto-merge (squash) January 27, 2023 20:42
}

if (RxQueue->TxCloneNblList != NULL) {
TxNbl = RxQueue->TxCloneNblList;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to nullify the Next field on TxNbl?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shouldn't need to, because NdisAppendSingleNblToNblCountedQueue below automatically NULLs the Next field, and the error cases also overwrite the Next field. It might be a good idea to NULL it, but many of our NBL routines are explicitly single-NBL and therefore Next is required to be ignored.

@mtfriesen mtfriesen merged commit a0b90db into main Jan 27, 2023
@mtfriesen mtfriesen deleted the mtfriesen/cache_fwd_nbls branch January 27, 2023 21:28
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.

None yet

2 participants