⚡ Bolt: Use napi_alloc_skb for RX path performance - #23
Conversation
Replaced dev_alloc_skb with napi_alloc_skb in the sim_rx_dequeue function to utilize per-CPU NAPI caching for socket buffers, and removed the manual skb_reserve call since napi_alloc_skb automatically handles NET_IP_ALIGN. Co-authored-by: maxugly <64644401+maxugly@users.noreply.github.com>
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThe RX dequeue path now selects the relevant NAPI context and uses ChangesNAPI RX allocator
Estimated code review effort: 1 (Trivial) | ~5 minutes Possibly related PRs
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
What:
Replaced
dev_alloc_skbwithnapi_alloc_skbin thesim_rx_dequeuefunction and removed the manualskb_reservecall sincenapi_alloc_skbautomatically handlesNET_IP_ALIGN.Why:
The RX path operates in a NAPI polling context.
dev_alloc_skbuses a generic slab allocator which can cause lock contention.napi_alloc_skbuses NAPI-specific per-CPU caches, providing faster sk_buff allocations during high-speed packet reception.Impact:
Significantly reduces CPU overhead and lock contention during network packet receiving, increasing RX throughput and reducing latency.
Measurement:
Compare the
iperf3RX bandwidth betweennata-aandnata-bnodes usingscripts/nata-ns-up.shbefore and after the change, or check CPU utilization of softirqd under heavy RX load.PR created automatically by Jules for task 14843957356728935227 started by @maxugly
Summary by CodeRabbit