Skip to content

fix(dma): cache packet bounce buffers - #2

Open
tinywifi wants to merge 1 commit into
flxxxxddd:mt7921-fixesfrom
tinywifi:fix/dma-bounce-cache
Open

tinywifi wants to merge 1 commit into
flxxxxddd:mt7921-fixesfrom
tinywifi:fix/dma-bounce-cache

Conversation

@tinywifi

Copy link
Copy Markdown

Tracked down a lot of copying overhead on an MT7922 (14c3:7922), using AirportMtkWlan on Tahoe 26.7.1.

Packet bounce buffers inherit kIOMapInhibitCache from alloc_dma_memory. On this machine, the Wi-Fi workloop was spending most of its time in rep movsb. This gives those packet buffers normal cached RAM. Descriptor rings stay uncached, with the same physical contiguity and 32-bit DMA address limit.

Same 5 GHz AP, channel 161 / 80 MHz: Cloudflare downloads went from about 26 to 197 Mbps. Two networkQuality runs after the change gave 194/211 and 213/223 Mbps (down/up).

Those numbers are from my local build with earlier MT7922 HAL fixes already applied. This PR only includes the cache change and its allocation test.

Tested the Tahoe and Sequoia native Release builds and tests/run-all.sh (12 groups). The test checks the actual allocator and both allocation calls, including the uncached descriptor default and allocation failure.

Use normal cached RAM for packet bounce allocations instead of inheriting
kIOMapInhibitCache. Keep descriptor allocations uncached and retain the
physical contiguity and 32-bit DMA mask.

Add an extracted allocator test for the two cache policies, physical mask,
preparation and allocation failure.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-20T05:42:27.249676Z ff4e462 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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