(I'm so sorry!) Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git

eth: mpnic: add a NAPI depletion check

The Rx path can wedge if page pool allocations fail in __mpnic_fill_bdq(). The problematic sequence is: page pool allocations fail, bdq rings are empty, device receives packet from the network, but drops it for lack of buffer space and does not raise interrupt, mpnic_poll() does not run, so page pool allocations are not retried. To break out of this cycle, we can add a depletion check to our service task. The depletion check checks if posted buffers are under a low watermark, and raises a completion queue interrupt, so that mpnic_poll will run on the corresponding napi vector. A note about the lock free reads: We don't bother synchronizing the ring head and tail reads with mpnic_poll(), because a false positive signal would simply raise a spurious interrupt scheduling mpnic_poll(), and a false negative signal will result in a retry, where if mpnic_poll() has truly not been running, should then report accurately whether or not posted Rx buffers are low. Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com> Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com> Link: https://patch.msgid.link/20261001-linux-mpnic-v1-4-6422ee74233a@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>


Author Daniel Zahka Committer Jakub Kicinski Date Commit Parent 9e072eda
+36
3 changed files
+36
3 changed files