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

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

From: Kraus, NechamaX <hidden>
Date: 2021-12-27 20:34:33
Also in: bpf, intel-wired-lan, lkml

On 12/8/2021 16:06, Alexander Lobakin wrote:
{__,}napi_alloc_skb() allocates and reserves additional NET_SKB_PAD
+ NET_IP_ALIGN for any skb.
OTOH, igc_construct_skb_zc() currently allocates and reserves
additional `xdp->data_meta - xdp->data_hard_start`, which is about
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 (+ meta) to
__napi_alloc_skb() and don't reserve anything. This will give
enough headroom for stack processing.
Also, net_prefetch() xdp->data_meta and align the copy size to
speed-up memcpy() a little and better match igc_costruct_skb().

Fixes: fc9df2a0b520 ("igc: Enable RX via AF_XDP zero-copy")
Signed-off-by: Alexander Lobakin <redacted>
Reviewed-by: Michal Swiatkowski <redacted>
---
  drivers/net/ethernet/intel/igc/igc_main.c | 13 +++++++------
  1 file changed, 7 insertions(+), 6 deletions(-)
Tested-by: Nechama Kraus <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help