> Update skb_splice_bits() (spd_fill_page(), sock_spd_release(), and
> skb_pipe_buf_ops) and skb_append_pagefrags() to acquire and release
> references via netmem_inc_ref(), netmem_dec_ref(), and skb_frag_ref()
> so page_pool RX fragments spliced into a pipe remain pinned in the pool
> while in the pipe and pair with skb_append_pagefrags() and
> skb_release_data() when spliced into a TX socket once netmem_inc_ref()
> and netmem_dec_ref() handle page_pool netmems.
> 
> In tls_push_data(), fall back to copying when MSG_SPLICE_PAGES
> encounters a page_pool page because kTLS device offload record->frags[]
> tracks pages via raw struct page references rather than pp_ref_count
> before handing them to tls_push_sg().
> 
> Caveats:
> - Because pipe buffers created by skb_splice_bits() hold pp_ref_count
>   until released (including across tee()), user pipes holding
>   unconsumed spliced data keep those page_pool pages in-flight and
>   DMA-mapped in the pool (bounded by pipe capacity and RLIMIT_NOFILE
>   rather than sk_rcvbuf) until the pipe buffers are consumed or closed,
>   with page_pool_destroy() deferring pool release via its periodic
>   workqueue and page_pool_scrub() unmapping DMA.
> 
> Signed-off-by: Mina Almasry <[email protected]>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=2


Reply via email to