Skip to content

Commit

Permalink
xdp: recycle Page Pool backed skbs built from XDP frames
Browse files Browse the repository at this point in the history
__xdp_build_skb_from_frame() state(d):

/* Until page_pool get SKB return path, release DMA here */

Page Pool got skb pages recycling in April 2021, but missed this
function.

xdp_release_frame() is relevant only for Page Pool backed frames and it
detaches the page from the corresponding Pool in order to make it
freeable via page_frag_free(). It can instead just mark the output skb
as eligible for recycling if the frame is backed by a PP. No change for
other memory model types (the same condition check as before).
cpumap redirect and veth on Page Pool drivers now become zero-alloc (or
almost).

Signed-off-by: Alexander Lobakin <aleksander.lobakin@intel.com>
  • Loading branch information
alobakin authored and intel-lab-lkp committed Mar 1, 2023
1 parent ae256f9 commit a5ca557
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions net/core/xdp.c
Expand Up @@ -658,8 +658,8 @@ struct sk_buff *__xdp_build_skb_from_frame(struct xdp_frame *xdpf,
* - RX ring dev queue index (skb_record_rx_queue)
*/

/* Until page_pool get SKB return path, release DMA here */
xdp_release_frame(xdpf);
if (xdpf->mem.type == MEM_TYPE_PAGE_POOL)
skb_mark_for_recycle(skb);

/* Allow SKB to reuse area used by xdp_frame */
xdp_scrub_frame(xdpf);
Expand Down

0 comments on commit a5ca557

Please sign in to comment.