Skip to content
Snippets Groups Projects
Commit cb6cc8ed authored by Furong Xu's avatar Furong Xu Committed by Jakub Kicinski
Browse files

net: stmmac: Apply new page pool parameters when SPH is enabled

Commit df542f66 ("net: stmmac: Switch to zero-copy in
non-XDP RX path") makes DMA write received frame into buffer at offset
of NET_SKB_PAD and sets page pool parameters to sync from offset of
NET_SKB_PAD. But when Header Payload Split is enabled, the header is
written at offset of NET_SKB_PAD, while the payload is written at
offset of zero. Uncorrect offset parameter for the payload breaks dma
coherence [1] since both CPU and DMA touch the page buffer from offset
of zero which is not handled by the page pool sync parameter.

And in case the DMA cannot split the received frame, for example,
a large L2 frame, pp_params.max_len should grow to match the tail
of entire frame.

[1] https://lore.kernel.org/netdev/d465f277-bac7-439f-be1d-9a47dfe2d951@nvidia.com/



Reported-by: default avatarJon Hunter <jonathanh@nvidia.com>
Reported-by: default avatarBrad Griffis <bgriffis@nvidia.com>
Suggested-by: default avatarIdo Schimmel <idosch@idosch.org>
Fixes: df542f66 ("net: stmmac: Switch to zero-copy in non-XDP RX path")
Signed-off-by: default avatarFurong Xu <0x1207@gmail.com>
Tested-by: default avatarJon Hunter <jonathanh@nvidia.com>
Tested-by: default avatarThierry Reding <treding@nvidia.com>
Reviewed-by: default avatarIdo Schimmel <idosch@nvidia.com>
Link: https://patch.msgid.link/20250207085639.13580-1-0x1207@gmail.com


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 011b0335
Branches
Tags
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment