mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH net-next] eth: fbnic: put back netmem reference xdp_buff_add_frag() fails
@ 2026-09-22 19:53 Daniel Zahka
  2026-09-24 11:10 ` patchwork-bot+netdevbpf
  0 siblings, 1 reply; 2+ messages in thread
From: Daniel Zahka @ 2026-09-22 19:53 UTC (permalink / raw)
  To: Alexander Duyck, Jakub Kicinski, kernel-team, Andrew Lunn,
	David S. Miller, Eric Dumazet, Paolo Abeni, Alexei Starovoitov,
	Daniel Borkmann, Jesper Dangaard Brouer, John Fastabend,
	Stanislav Fomichev
  Cc: netdev, linux-kernel, bpf

fbnic_add_rx_frag() takes a page_pool reference out of the buffer's
pagecnt_bias before handing the fragment to xdp_buff_add_frag(). If that
call fails it has not taken ownership of the netmem: the fragment is not
recorded in the shared info, and fbnic_put_pkt_buff() will not put the
reference back.

Put the netmem reference back on the failure path.

Signed-off-by: Daniel Zahka <daniel.zahka@gmail.com>
---
This error path was introduced in commit 61f9a066c309 ("eth: fbnic: Use
shinfo to track frags state on Rx"). This is not a fix though, because
the branch is unreachable if the device is behaving correctly.
---
 drivers/net/ethernet/meta/fbnic/fbnic_txrx.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
index 447ec5522499..bbc3c9e89a38 100644
--- a/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
+++ b/drivers/net/ethernet/meta/fbnic/fbnic_txrx.c
@@ -1045,6 +1045,7 @@ static void fbnic_add_rx_frag(struct fbnic_napi_vector *nv, u64 rcd,
 		pkt->add_frag_failed = true;
 		netdev_err_once(nv->napi.dev,
 				"Failed to add fragment to xdp_buff\n");
+		page_pool_put_full_netmem(qt->sub1.page_pool, netmem, true);
 	}
 }
 

---
base-commit: 6598456d72e48d779445bfec8f72114747f8b8d7
change-id: 20260922-fbnic-refcount-fix-a78b3a7e536b

Best regards,
-- 
Daniel Zahka <daniel.zahka@gmail.com>


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH net-next] eth: fbnic: put back netmem reference xdp_buff_add_frag() fails
  2026-09-22 19:53 [PATCH net-next] eth: fbnic: put back netmem reference xdp_buff_add_frag() fails Daniel Zahka
@ 2026-09-24 11:10 ` patchwork-bot+netdevbpf
  0 siblings, 0 replies; 2+ messages in thread
From: patchwork-bot+netdevbpf @ 2026-09-24 11:10 UTC (permalink / raw)
  To: Daniel Zahka
  Cc: alexanderduyck, kuba, kernel-team, andrew+netdev, davem,
	edumazet, pabeni, ast, daniel, hawk, john.fastabend, sdf, netdev,
	linux-kernel, bpf

Hello:

This patch was applied to netdev/net-next.git (main)
by Paolo Abeni <pabeni@redhat.com>:

On Tue, 22 Sep 2026 12:53:28 -0700 you wrote:
> fbnic_add_rx_frag() takes a page_pool reference out of the buffer's
> pagecnt_bias before handing the fragment to xdp_buff_add_frag(). If that
> call fails it has not taken ownership of the netmem: the fragment is not
> recorded in the shared info, and fbnic_put_pkt_buff() will not put the
> reference back.
> 
> Put the netmem reference back on the failure path.
> 
> [...]

Here is the summary with links:
  - [net-next] eth: fbnic: put back netmem reference xdp_buff_add_frag() fails
    https://git.kernel.org/netdev/net-next/c/1c85ea5df86b

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2026-09-24 11:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-09-22 19:53 [PATCH net-next] eth: fbnic: put back netmem reference xdp_buff_add_frag() fails Daniel Zahka
2026-09-24 11:10 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®