[RFC 4/4] net/af_packet: add VPP-style prefetching to receive path
Stephen Hemminger
stephen at networkplumber.org
Mon Feb 2 19:43:30 CET 2026
On Thu, 29 Jan 2026 10:00:15 +0100
Morten Brørup <mb at smartsharesystems.com> wrote:
> > This and previous proposal to prefetch have no impact on performance.
> > Rolled a simple perf test and all three versions come out the same.
>
> Please be aware that many test cases are inadvertently designed in a way where mbufs unintendedly are hot in the cache, so prefetching does not provide the expected performance gain.
> E.g. when working on a newly allocated mbuf, the mbuf should be cold.
> But if it came from the mempool cache, and was recently worked on and then freed into the mempool cache, then it will be hot.
>
> > The bottleneck is not here, probably at system call and copies now.
>
> The most important bottleneck might be elsewhere.
> But this optimization might not be as irrelevant as the test results indicate.
>
> Anyway, I agree that dropping the patch (for now) makes sense.
I doubt pre-fetch will matter much in a driver like this because:
- on tx the data is still in cache since just setup by caller
- on rx the data is still in cache since kernel just copied
it into the buffer.
More information about the dev
mailing list