🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: linux.kernel.netdev
1 messages
1 total messages Started by "Loktionov, Aleksandr" Fri, 06 Nov 2026 07:11
RE: [PATCH iwl-net v2] idpf: fix Rx payload buffer leak when header buffer allocation fails
#12035
Author: "Loktionov, Aleksandr"
Date: Fri, 06 Nov 2026 07:11
68 lines
25422 bytes

> -----Original Message-----
> From: Naman Gulati <namangulati@google.com>
> Sent: Friday, November 6, 2026 1:26 AM
> To: intel-wired-lan@lists.osuosl.org
> Cc: netdev@vger.kernel.org; Nguyen, Anthony L
> <anthony.l.nguyen@intel.com>; Kitszel, Przemyslaw
> <przemyslaw.kitszel@intel.com>; Lobakin, Aleksander
> <aleksander.lobakin@intel.com>; Brian Vazquez <brianvv@google.com>;
> Andrew Lunn <andrew+netdev@lunn.ch>; David S . Miller
> <davem@davemloft.net>; Eric Dumazet <edumazet@kernel.org>; Jakub
> Kicinski <kuba@kernel.org>; Paolo Abeni <pabeni@redhat.com>; Naman
> Gulati <namangulati@google.com>; stable@vger.kernel.org
> Subject: [PATCH iwl-net v2] idpf: fix Rx payload buffer leak when header
> buffer allocation fails
> 
> With header split, idpf_rx_update_bufq_desc() allocates the payload
> buffer for a buffer ID first and its header buffer second. If the header
> buffer allocation fails, it returns -ENOMEM and leaves the new payload
> buffer in bufq->buf[buf_id]. idpf_rx_clean_refillq() then stops without
> consuming the refill queue entry, and the next NAPI poll retries the
> same buffer ID, again starting with the payload buffer.
> libeth_rx_alloc() overwrites bufq->buf[buf_id], and the earlier payload
> buffer is never returned to its page_pool.
> 
> Each such failure leaks one payload buffer. The pool's inflight count
> never drops to zero, so when the queues are re-created or the device
> goes away, the pool never finishes shutting down and
> page_pool_release_retry() keeps warning about a stalled pool shutdown.
> 
> This happens when the header buffer pool runs dry while the payload pool
> still has pages, for example under memory pressure: a header page holds
> several header buffers and only goes back to its pool once the skbs
> using all of them have been freed. This was hit under high flow count
> TCP stream tests with memory pressure causing RX header buffer
> allocations to fail, and validated on idpf.
> 
> Release the payload buffer when the header buffer cannot be allocated,
> as ice_alloc_rx_bufs() already does, so that the retry starts from an
> empty slot. idpf_rx_page_rel() also clears the slot, so the buffer queue
> teardown cannot release the buffer a second time.
> 
> Fixes: 90912f9f4f2d ("idpf: convert header split mode to libeth +
> napi_build_skb()")
> Cc: stable@vger.kernel.org # 6.11+
> Signed-off-by: Naman Gulati <namangulati@google.com>
> Tested-by: Brian Vazquez <brianvv@google.com>
> Reviewed-by: Alexander Lobakin <aleksander.lobakin@intel.com>
> ---
> v2:
>   - Add Cc: stable@vger.kernel.org # 6.11+ (Alexander)
>   - Add Reviewed-by (Alexander) and Tested-by (Brian) tags
>   - Note how the issue was triggered and validated on idpf in the commit
> message
>   - v1: https://lore.kernel.org/intel-wired-lan/20261104013606.1527767-
> 1-namangulati@google.com/
>  drivers/net/ethernet/intel/idpf/idpf_txrx.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> index 885df6294ad94..7383d8241ead5 100644
> --- a/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> +++ b/drivers/net/ethernet/intel/idpf/idpf_txrx.c
> @@ -3745,8 +3745,10 @@ static int idpf_rx_update_bufq_desc(struct
> idpf_buf_queue *bufq, u32 buf_id,
>  	fq.truesize = bufq->hdr_truesize;
> 
>  	addr = libeth_rx_alloc(&fq, buf_id);
> -	if (addr == DMA_MAPPING_ERROR)
> +	if (addr == DMA_MAPPING_ERROR) {
> +		idpf_rx_page_rel(&bufq->buf[buf_id]);
>  		return -ENOMEM;
> +	}
> 
>  	buf_desc->hdr_addr = cpu_to_le64(addr);
> 
> --
> 2.56.0.455.g6c5a503b38-goog

Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads