Thread (27 messages) 27 messages, 6 authors, 2022-01-29

RE: [Intel-wired-lan] [PATCH v4 net-next 4/9] ice: don't reserve excessive XDP_PACKET_HEADROOM on XSK Rx to skb

From: Bhandare, KiranX <hidden>
Date: 2022-01-10 10:13:32
Also in: bpf, intel-wired-lan, lkml

-----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 4/9] ice: 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, ice_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: 2d4238f55697 ("ice: Add support for AF_XDP")
Signed-off-by: Alexander Lobakin <redacted>
Reviewed-by: Michal Swiatkowski <redacted>
---
 drivers/net/ethernet/intel/ice/ice_xsk.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
Tested-by: Kiran Bhandare <redacted>  A Contingent Worker at Intel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help