Skip to content

Commit 2ece429

Browse files
author
Ken Cox
committed
bnxt: make sure we return pages to the pool
Bugzilla: https://bugzilla.redhat.com/2112187 commit 97f5e03 Author: Jakub Kicinski <kuba@kernel.org> Date: Tue Jan 10 20:25:47 2023 -0800 bnxt: make sure we return pages to the pool Before the commit under Fixes the page would have been released from the pool before the napi_alloc_skb() call, so normal page freeing was fine (released page == no longer in the pool). After the change we just mark the page for recycling so it's still in the pool if the skb alloc fails, we need to recycle. Same commit added the same bug in the new bnxt_rx_multi_page_skb(). Fixes: 1dc4c55 ("bnxt: adding bnxt_xdp_build_skb to build skb from multibuffer xdp_buff") Reviewed-by: Andy Gospodarek <gospo@broadcom.com> Link: https://lore.kernel.org/r/20230111042547.987749-1-kuba@kernel.org Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: Ken Cox <jkc@redhat.com>
1 parent 8555fd5 commit 2ece429

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/ethernet/broadcom/bnxt

1 file changed

+2
-2
lines changed

drivers/net/ethernet/broadcom/bnxt/bnxt.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -991,7 +991,7 @@ static struct sk_buff *bnxt_rx_multi_page_skb(struct bnxt *bp,
991991
skb = build_skb(page_address(page), BNXT_PAGE_MODE_BUF_SIZE +
992992
bp->rx_dma_offset);
993993
if (!skb) {
994-
__free_page(page);
994+
page_pool_recycle_direct(rxr->page_pool, page);
995995
return NULL;
996996
}
997997
skb_mark_for_recycle(skb);
@@ -1029,7 +1029,7 @@ static struct sk_buff *bnxt_rx_page_skb(struct bnxt *bp,
10291029

10301030
skb = napi_alloc_skb(&rxr->bnapi->napi, payload);
10311031
if (!skb) {
1032-
__free_page(page);
1032+
page_pool_recycle_direct(rxr->page_pool, page);
10331033
return NULL;
10341034
}
10351035

0 commit comments

Comments
 (0)