-----Original Message-----
From: Intel-wired-lan <redacted> On Behalf Of
Alexander Lobakin
Sent: Wednesday, December 8, 2021 7:37 PM
To: intel-wired-lan@lists.osuosl.org
Cc: Song Liu <redacted>; Jesper Dangaard Brouer
[off-list ref]; Daniel Borkmann [off-list ref]; Yonghong
Song [off-list ref]; Martin KaFai Lau [off-list ref]; John Fastabend
[off-list ref]; Alexei Starovoitov [off-list ref]; Andrii
Nakryiko [off-list ref]; Björn Töpel [off-list ref];
netdev@vger.kernel.org; Jakub Kicinski [off-list ref]; KP Singh
[off-list ref]; bpf@vger.kernel.org; David S. Miller
[off-list ref]; linux-kernel@vger.kernel.org
Subject: [Intel-wired-lan] [PATCH v4 net-next 1/9] i40e: don't reserve
excessive XDP_PACKET_HEADROOM on XSK Rx to skb
{__,}napi_alloc_skb() allocates and reserves additional NET_SKB_PAD
+ NET_IP_ALIGN for any skb.
OTOH, i40e_construct_skb_zc() currently allocates and reserves additional
`xdp->data - xdp->data_hard_start`, which is XDP_PACKET_HEADROOM for
XSK frames.
There's no need for that at all as the frame is post-XDP and will go only to the
networking stack core.
Pass the size of the actual data only to __napi_alloc_skb() and don't reserve
anything. This will give enough headroom for stack processing.
Fixes: 0a714186d3c0 ("i40e: add AF_XDP zero-copy Rx support")
Signed-off-by: Alexander Lobakin <redacted>
Reviewed-by: Michal Swiatkowski <redacted>
---
drivers/net/ethernet/intel/i40e/i40e_xsk.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
Tested-by: Kiran Bhandare <redacted> A Contingent Worker at Intel